public void TestHunspellDictionary_LoadEnUSDict() { var dictionary = HunspellDictionaryLoader.Dictionary("en_US"); Assert.AreEqual(2, dictionary.LookupSuffix(new[] { 'i', 'n', 'g', 's' }, 0, 4).Count()); Assert.AreEqual(1, dictionary.LookupPrefix(new[] { 'i', 'n' }, 0, 2).Count()); Assert.AreEqual(1, dictionary.LookupWord("drink").Count()); }
public void TestStem_RecursiveSuffix_EnUS() { var dictionary = HunspellDictionaryLoader.Dictionary("en_US"); var stemmer = new HunspellStemmer(dictionary); var stems = stemmer.Stem("drinkables").ToList(); Assert.AreEqual(1, stems.Count); Assert.AreEqual("drink", stems[0].Stem); }
public void TestStem_SimplePrefix_EnUS() { var dictionary = HunspellDictionaryLoader.Dictionary("en_US"); var stemmer = new HunspellStemmer(dictionary); var stems = stemmer.Stem("remove").ToList(); Assert.AreEqual(1, stems.Count); Assert.AreEqual("move", stems[0].Stem); }
public void TestStem_fietsenFiets_NlNL() { var dictionary = HunspellDictionaryLoader.Dictionary("nl_NL"); var stemmer = new HunspellStemmer(dictionary); var stems = stemmer.Stem("fietsen").ToList(); Assert.AreEqual(2, stems.Count); Assert.AreEqual("fietsen", stems[0].Stem); Assert.AreEqual("fiets", stems[1].Stem); stems = stemmer.Stem("fiets").ToList(); Assert.AreEqual(1, stems.Count); Assert.AreEqual("fiets", stems[0].Stem); }
public void TestHunspellDictionary_LoadFrModerneDict() { Assert.DoesNotThrow(() => HunspellDictionaryLoader.Dictionary("fr-moderne")); }
public DutchAnalyzer() { _dictionary = HunspellDictionaryLoader.Dictionary("nl_NL"); }