List of usage examples for edu.stanford.nlp.util TwoDimensionalSet hashSet
public static <K1, K2> TwoDimensionalSet<K1, K2> hashSet()
From source file:knu.univ.lingvo.coref.Document.java
License:Open Source License
public Document() { positions = Generics.newHashMap();/* ww w .j a v a 2 s .co m*/ mentionheadPositions = Generics.newHashMap(); roleSet = Generics.newHashSet(); corefClusters = Generics.newHashMap(); goldCorefClusters = null; allPredictedMentions = Generics.newHashMap(); allGoldMentions = Generics.newHashMap(); speakers = Generics.newHashMap(); speakerPairs = Generics.newHashSet(); incompatibles = TwoDimensionalSet.hashSet(); incompatibleClusters = TwoDimensionalSet.hashSet(); acronymCache = TwoDimensionalMap.hashMap(); }
From source file:knu.univ.lingvo.coref.Document.java
License:Open Source License
public void mergeAcronymCache(CorefCluster to, CorefCluster from) { TwoDimensionalSet<Integer, Integer> replacements = TwoDimensionalSet.hashSet(); for (Integer first : acronymCache.firstKeySet()) { for (Integer second : acronymCache.get(first).keySet()) { if (acronymCache.get(first, second)) { Integer other = null; if (first == from.clusterID) { other = second;/* ww w. j a v a2 s . c o m*/ } else if (second == from.clusterID) { other = first; } if (other != null && other != to.clusterID) { int cid1 = Math.min(other, to.clusterID); int cid2 = Math.max(other, to.clusterID); replacements.add(cid1, cid2); } } } } for (Integer first : replacements.firstKeySet()) { for (Integer second : replacements.secondKeySet(first)) { acronymCache.put(first, second, true); } } }