示例#1
0
        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));
        }
示例#2
0
            public override bool ConstraintsEqual(Allomorph other)
            {
                RootAllomorph otherAllo = (RootAllomorph)other;

                return(m_shape.Equals(otherAllo.m_shape) && base.ConstraintsEqual(other));
            }
示例#3
0
 /// <summary>
 /// Determines if the specified word synthesis is a duplicate of this word synthesis. It differs from
 /// <c>Equals</c> in that it only checks the shape, root, and stratum. It is used for
 /// checking completed word synthesis records.
 /// </summary>
 /// <param name="other">The other.</param>
 /// <returns></returns>
 public bool Duplicates(WordSynthesis other)
 {
     return(m_shape.Equals(other.m_shape) && m_morphs.Equals(other.m_morphs) && m_stratum == other.m_stratum);
 }