Segmenter.Base.Collectors.FrequencyDictionary.Equals C# (CSharp) Method

Equals() public method

The equals.
public Equals ( FrequencyDictionary other ) : bool
other FrequencyDictionary /// The other frequency dictionary. ///
return bool
        public bool Equals(FrequencyDictionary other)
        {
            if (other.Count != words.Count)
            {
                return false;
            }

            for (int index = 0; index < Count; index++)
            {
                if (!other.Contains(GetWord(index)))
                {
                    return false;
                }
            }

            return true;
        }

Usage Example

 public void CloneTest()
 {
     string str = chain.ToString();
     var alphabet1 = new FrequencyDictionary(str);
     var alphabet2 = new FrequencyDictionary(chain);
     FrequencyDictionary alphabet3 = alphabet2.Clone();
     Assert.True(alphabet1.Equals(alphabet2) && alphabet3.Equals(alphabet1));
 }
All Usage Examples Of Segmenter.Base.Collectors.FrequencyDictionary::Equals