Exemplo n.º 1
0
        public bool Equals(MorphemeRule other)
        {
            bool result = MorphRule.Equals(other.MorphRule) &&
                          GrammarCharacter == other.GrammarCharacter &&
                          AttributesRule.Equals(other.AttributesRule) &&
                          SubstitutionRule.Equals(other.SubstitutionRule);

            return(result);
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int hash = 486187739;

            hash = (hash * 16777619) ^ MorphRule.GetHashCode();
            hash = (hash * 16777619) ^ GrammarCharacter.GetHashCode();
            hash = (hash * 16777619) ^ AttributesRule.GetHashCode();
            hash = (hash * 16777619) ^ SubstitutionRule.GetHashCode();

            return(hash);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Checks if the morpheme matches the rule.
        /// </summary>
        /// <param name="morpheme"></param>
        /// <returns></returns>
        public bool Evaluate(Morpheme morpheme)
        {
            bool result = MorphRule.Evaluate(morpheme.Morph) && AttributesRule.Evaluate(morpheme.Attributes);

            return(result);
        }