@Override public double remove(K1 o1, K2 o2) { ClassicCounter<K2> c = getCounter(o1); double oldCount = getCount(o1, o2); total -= oldCount; c.remove(o2); if (c.size() == 0) { map.remove(o1); } return oldCount; }
public void clean() { for (K1 key1 : Generics.newHashSet(map.keySet())) { ClassicCounter<K2> c = map.get(key1); for (K2 key2 : Generics.newHashSet(c.keySet())) { if (SloppyMath.isCloseTo(0.0, c.getCount(key2))) { c.remove(key2); } } if (c.keySet().isEmpty()) { map.remove(key1); } } }
void removeLearnedPattern(String label, SurfacePattern p) { this.learnedPatterns.get(label).remove(p); if (wordsPatExtracted.containsKey(label)) for (Entry<String, ClassicCounter<SurfacePattern>> en : this.wordsPatExtracted.get(label).entrySet()) { en.getValue().remove(p); } }
public void clean() { for (K1 key1 : new HashSet<K1>(map.keySet())) { ClassicCounter<K2> c = map.get(key1); for (K2 key2 : new HashSet<K2>(c.keySet())) { if (SloppyMath.isCloseTo(0.0, c.getCount(key2))) { c.remove(key2); } } if (c.keySet().isEmpty()) { map.remove(key1); } } }
@Override public double remove(K1 o1, K2 o2) { ClassicCounter<K2> c = getCounter(o1); double oldCount = getCount(o1, o2); total -= oldCount; c.remove(o2); if (c.size() == 0) { map.remove(o1); } return oldCount; }
public double remove(K1 o1, K2 o2) { ClassicCounter<K2> c = getCounter(o1); double oldCount = getCount(o1, o2); total -= oldCount; c.remove(o2); if (c.size() == 0) { map.remove(o1); } return oldCount; }
public double remove(K1 o1, K2 o2) { ClassicCounter<K2> c = getCounter(o1); double oldCount = getCount(o1, o2); total -= oldCount; c.remove(o2); if (c.size() == 0) { map.remove(o1); } return oldCount; }
@Override public double remove(K1 o1, K2 o2) { ClassicCounter<K2> c = getCounter(o1); double oldCount = getCount(o1, o2); total -= oldCount; c.remove(o2); if (c.size() == 0) { map.remove(o1); } return oldCount; }
public void clean() { for (K1 key1 : Generics.newHashSet(map.keySet())) { ClassicCounter<K2> c = map.get(key1); for (K2 key2 : Generics.newHashSet(c.keySet())) { if (SloppyMath.isCloseTo(0.0, c.getCount(key2))) { c.remove(key2); } } if (c.keySet().isEmpty()) { map.remove(key1); } } }
public void clean() { for (K1 key1 : Generics.newHashSet(map.keySet())) { ClassicCounter<K2> c = map.get(key1); for (K2 key2 : Generics.newHashSet(c.keySet())) { if (SloppyMath.isCloseTo(0.0, c.getCount(key2))) { c.remove(key2); } } if (c.keySet().isEmpty()) { map.remove(key1); } } }
public void clean() { for (K1 key1 : Generics.newHashSet(map.keySet())) { ClassicCounter<K2> c = map.get(key1); for (K2 key2 : Generics.newHashSet(c.keySet())) { if (SloppyMath.isCloseTo(0.0, c.getCount(key2))) { c.remove(key2); } } if (c.keySet().isEmpty()) { map.remove(key1); } } }