public virtual void TestStem() { NUnit.Framework.Assert.AreEqual("John", Morphology.StemStatic(new WordTag("John", "NNP")).Word()); NUnit.Framework.Assert.AreEqual("Corporations", Morphology.StemStatic(new WordTag("Corporations", "NNPS")).Word()); WordTag hunt = new WordTag("hunting", "V"); NUnit.Framework.Assert.AreEqual("hunt", Morphology.StemStatic(hunt).Word()); NUnit.Framework.Assert.AreEqual("hunt", Morphology.LemmatizeStatic(hunt).Lemma()); }
public virtual void TestMorph() { System.Diagnostics.Debug.Assert((exWords.Length == exTags.Length)); System.Diagnostics.Debug.Assert((exWords.Length == exAnswers.Length)); for (int i = 0; i < exWords.Length; i++) { WordLemmaTag ans = Morphology.LemmatizeStatic(new WordTag(exWords[i], exTags[i])); NUnit.Framework.Assert.AreEqual("Stemmed " + exWords[i] + '/' + exTags[i] + " to lemma " + ans.Lemma() + " versus correct " + exAnswers[i], ans.Lemma(), exAnswers[i]); } }