public bool Equals(WordAnalysis other) { if (other == null) { return(false); } if (m_mrulesUnapplied.Count != other.m_mrulesUnapplied.Count) { return(false); } foreach (KeyValuePair <MorphologicalRule, int> kvp in m_mrulesUnapplied) { int numUnapplies; if (!other.m_mrulesUnapplied.TryGetValue(kvp.Key, out numUnapplies) || numUnapplies != kvp.Value) { return(false); } } if (m_nonHead != null) { if (!m_nonHead.Equals(other.m_nonHead)) { return(false); } } else if (other.m_nonHead != null) { return(false); } return(m_shape.Equals(other.m_shape) && m_rzFeatures.Equals(other.m_rzFeatures)); }
public bool Equals(WordSynthesis other) { if (other == null) { return(false); } if (m_mrules.Count != other.m_mrules.Count) { return(false); } for (int i = 0; i < m_mrules.Count; i++) { if (m_mrules[i] != other.m_mrules[i]) { return(false); } } if (m_nonHead != null) { if (!m_nonHead.Equals(other.m_nonHead)) { return(false); } } else if (other.m_nonHead != null) { return(false); } return(m_shape.Equals(other.m_shape) && m_morphs.Equals(other.m_morphs) && m_rzFeatures.Equals(other.m_rzFeatures) && m_stratum == other.m_stratum && m_root == other.m_root); }