public override ProbableStrength IsMatch(PhraseAttribute attribute) { if (attribute is NumberAttribute) { NumberAttribute numberAttribute = (NumberAttribute)attribute; if (numberAttribute.number == number) return ProbableStrength.Full; else if (numberAttribute.number == NumberOptions.Zero || number == NumberOptions.Zero) return ProbableStrength.Half; else return ProbableStrength.Zero; } return ProbableStrength.None; }
public override PhraseAttribute Guess(InformedPhrase word) { ProbableStrength plural = SeemsPlural(word); if (plural.strength > .5) { NumberAttribute result = new NumberAttribute(NumberOptions.Many); result.strength.strength = 2.0 * (plural.strength - 0.5); result.strength.weight = plural.weight; return result; } else { NumberAttribute result = new NumberAttribute(NumberOptions.One); result.strength.strength = 2.0 * (.5 - plural.strength); result.strength.weight = plural.weight; return result; } }
public override PhraseAttribute Guess(InformedPhrase word) { ProbableStrength plural = SeemsPlural(word); if (plural.strength > .5) { NumberAttribute result = new NumberAttribute(NumberOptions.Many); result.strength.strength = 2.0 * (plural.strength - 0.5); result.strength.weight = plural.weight; return result; } else { NumberAttribute result = new NumberAttribute(NumberOptions.One); result.strength.strength = 2.0 * (.5 - plural.strength); result.strength.weight = plural.weight; return result; } }