public void TestExtractSingleLongTerm() { var nounPhrases = nounPhraseExtractor.Extract("The lovely red ironed rectangular Swiss flag."); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }
public void TestExtractSingleShortWord() { var nounPhrases = nounPhraseExtractor.Extract("There is a P."); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }
public void TestExtractSingle() { var nounPhrases = nounPhraseExtractor.Extract("A large red flag fluttered."); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); ISet <string> variants = new HashSet <string>(); variants.Add("large red flag"); expectedNounPhrases.Add("large red flag", variants); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }
public void TestExtractMultipleVariantsNumber() { var nounPhrases = nounPhraseExtractor.Extract("There are 12 dogs. A dog can't be seen."); Comparators.PrintDictionaryOfSets(nounPhrases); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); ISet <string> variants = new HashSet <string>(); // NOTE there is a TODO in the code to fix this problem //variants.Add("dogs"); variants.Add("dog"); expectedNounPhrases.Add("dog", variants); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }
public void TestExtractMultipleVariants() { var nounPhrases = nounPhraseExtractor.Extract("Dogs are looking at dogs but not at a dog."); Comparators.PrintDictionaryOfSets(nounPhrases); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); ISet <string> variants = new HashSet <string>(); variants.Add("Dogs"); variants.Add("dogs"); variants.Add("dog"); expectedNounPhrases.Add("dog", variants); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }
public void TestExtractMultipleVariantsIrregular() { var nounPhrases = nounPhraseExtractor.Extract("Wolves are looking at wolves but not at a wolf."); Comparators.PrintDictionaryOfSets(nounPhrases); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); ISet <string> variants = new HashSet <string>(); // NOTE there is a TODO in the code to fix this problem //variants.Add("Wolves"); //variants.Add("wolves"); variants.Add("wolf"); expectedNounPhrases.Add("wolf", variants); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }
public void TestExtractWithConjunction() { var nounPhrases = nounPhraseExtractor.Extract("The red and flat flag."); Comparators.PrintDictionaryOfSets(nounPhrases); Dictionary <string, ISet <string> > expectedNounPhrases = new Dictionary <string, ISet <string> >(); ISet <string> variants = new HashSet <string>(); variants.Add("red"); expectedNounPhrases.Add("red", variants); ISet <string> variants2 = new HashSet <string>(); variants2.Add("flat flag"); expectedNounPhrases.Add("flat flag", variants2); ISet <string> variants3 = new HashSet <string>(); variants3.Add("red and flat flag"); expectedNounPhrases.Add("red and flat flag", variants3); Assert.IsTrue(Comparators.DictionariesOfSetsAreEqual(expectedNounPhrases, nounPhrases)); }