public bool Equals(MorphemeRule other) { bool result = MorphRule.Equals(other.MorphRule) && GrammarCharacter == other.GrammarCharacter && AttributesRule.Equals(other.AttributesRule) && SubstitutionRule.Equals(other.SubstitutionRule); return(result); }
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); }
/// <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); }