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; } 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); } } }
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; } 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); } } }
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; } 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); } } }