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

Method initData

src/main/java/gate/gui/docview/CorefEditor.java:1010–1040  ·  view source on GitHub ↗

This will initialise the data

()

Source from the content-addressed store, hash-verified

1008 * This will initialise the data
1009 */
1010 private void initData() {
1011
1012 rootNode = new CorefTreeNode("Co-reference Data", true,
1013 CorefTreeNode.ROOT_NODE);
1014 corefChains = new HashMap<CorefTreeNode, Map<CorefTreeNode, List<Integer>>>();
1015 selectionChainsMap = new HashMap<String, Map<String,Boolean>>();
1016 currentSelections = new HashMap<String, Boolean>();
1017 colorChainsMap = new HashMap<String, Map<String,Color>>();
1018 currentColors = new HashMap<String, Color>();
1019 corefAnnotationSetNodesMap = new HashMap<String, CorefTreeNode>();
1020
1021 // now we need to findout the chains
1022 // for the defaultAnnotationSet
1023 CorefTreeNode annotSetNode = createChain(document.getAnnotations(), true);
1024 if (annotSetNode != null) {
1025 corefAnnotationSetNodesMap.put(DEFAULT_ANNOTSET_NAME, annotSetNode);
1026 }
1027
1028 // and for the rest AnnotationSets
1029 Map<String,AnnotationSet> annotSets = document.getNamedAnnotationSets();
1030 if (annotSets != null) {
1031 Iterator<String> annotSetsIter = annotSets.keySet().iterator();
1032 while (annotSetsIter.hasNext()) {
1033 String annotSetName = annotSetsIter.next();
1034 annotSetNode = createChain(document.getAnnotations(annotSetName), false);
1035 if (annotSetNode != null) {
1036 corefAnnotationSetNodesMap.put(annotSetName, annotSetNode);
1037 }
1038 }
1039 }
1040 }
1041
1042 private CorefTreeNode createAnnotSetNode(AnnotationSet set, boolean isDefaultSet) {
1043 // create the node for setName

Callers 1

initGUIMethod · 0.95

Calls 8

createChainMethod · 0.95
getAnnotationsMethod · 0.65
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
putMethod · 0.45
keySetMethod · 0.45

Tested by

no test coverage detected