public void HasSubjectPronounTest() { var phrase = new PronounPhrase( new PersonalPronoun("they"), new PersonalPronoun("themselves") ); Assert.True(phrase.HasSubjectPronoun()); }
public void ToTheLeftOfTest() { var target = new ParticlePhrase(new Particle("off"), new Preposition("of")); ILexical expected = new PronounPhrase(new PersonalPronoun("they")); ILexical actual; target.ToTheLeftOf = expected; actual = target.ToTheLeftOf; Check.That(actual).IsEqualTo(expected); }
public void HasSubjectPronounTest3() { var phrase = new PronounPhrase( new PersonalPronoun("him"), new Conjunction("and"), new PersonalPronoun("her") ); Assert.False(phrase.HasSubjectPronoun()); }
public void HasSubjectPronounTest2() { var phrase = new PronounPhrase( new PersonalPronoun("she"), new Conjunction("and"), new PersonalPronoun("it") ); Assert.True(phrase.HasSubjectPronoun()); }
private static Gender DeterminePronounPhraseGender(PronounPhrase pronounPhrase) { if (pronounPhrase.Words.All(w => w is Determiner)) { return(Gender.Undetermined); } var genders = pronounPhrase.Words.OfType <ISimpleGendered>().Select(w => w.Gender); return(pronounPhrase.Words.OfProperNoun().Any(n => !(n is ISimpleGendered)) ? DetermineNounPhraseGender(pronounPhrase) : genders.Any() ? genders.All(g => g.IsFemale()) ? Gender.Female : genders.All(g => g.IsMale()) ? Gender.Male : genders.All(g => g.IsNeutral()) ? Gender.Neutral : Gender.Undetermined : Gender.Undetermined); }