/// <summary>Subtracts the counts in the given Counter from the counts in this Counter.</summary> /// <remarks> /// Subtracts the counts in the given Counter from the counts in this Counter. /// <p> /// To copy the values from another Counter rather than subtracting them, use /// </remarks> public virtual void SubtractAll(Edu.Stanford.Nlp.Stats.IntCounter <E> counter) { foreach (E key in map.Keys) { DecrementCount(key, counter.GetIntCount(key)); } }
/// <summary>Adds the counts in the given Counter to the counts in this Counter.</summary> /// <remarks> /// Adds the counts in the given Counter to the counts in this Counter. /// <p> /// To copy the values from another Counter rather than adding them, use /// </remarks> public virtual void AddAll(Edu.Stanford.Nlp.Stats.IntCounter <E> counter) { foreach (E key in counter.KeySet()) { int count = counter.GetIntCount(key); IncrementCount(key, count); } }
// OBJECT STUFF public override bool Equals(object o) { if (this == o) { return(true); } if (!(o is Edu.Stanford.Nlp.Stats.IntCounter)) { return(false); } Edu.Stanford.Nlp.Stats.IntCounter counter = (Edu.Stanford.Nlp.Stats.IntCounter)o; return(map.Equals(counter.map)); }
/// <summary>Constructs a new Counter with the contents of the given Counter.</summary> public IntCounter(Edu.Stanford.Nlp.Stats.IntCounter <E> c) : this() { AddAll(c); }