MCPcopy Create free account
hub / github.com/GateNLP/gate-core / addAnnotSet2Map

Method addAnnotSet2Map

src/test/java/gate/xml/TestXml.java:418–429  ·  view source on GitHub ↗
(AnnotationSet annotSet, Map<Integer,Annotation> id2AnnMap)

Source from the content-addressed store, hash-verified

416
417
418 private Map<Integer,Annotation> addAnnotSet2Map(AnnotationSet annotSet, Map<Integer,Annotation> id2AnnMap){
419 for (Iterator<Annotation> it = annotSet.iterator(); it.hasNext();){
420 Annotation a = it.next();
421 Integer id = a.getId();
422
423 assertTrue("Found two annotations(one with type = " + a.getType() +
424 ")with the same ID=" + id, !id2AnnMap.keySet().contains(id));
425
426 id2AnnMap.put(id, a);
427 }// End for
428 return id2AnnMap;
429 }
430
431 /**
432 * Scans a target Doc for all Annotations and builds a map (from anot ID to annot) in the process

Callers 1

buildID2AnnotMapMethod · 0.95

Calls 8

iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getIdMethod · 0.65
getTypeMethod · 0.65
containsMethod · 0.45
keySetMethod · 0.45
putMethod · 0.45

Tested by

no test coverage detected