Lucene.Net.Analysis.Hunspell.HunspellStemmer.Stem C# (CSharp) Метод

Stem() публичный Метод

Find the stem(s) of the provided word.
public Stem ( String word ) : IEnumerable
word String Word to find the stems for.
Результат IEnumerable
        public IEnumerable<HunspellStem> Stem(String word) {
            if (word == null) throw new ArgumentNullException("word");

            var stems = new List<HunspellStem>();
            if (_dictionary.LookupWord(word) != null)
                stems.Add(new HunspellStem(word));

            stems.AddRange(Stem(word, null, 0));
            return stems;
        }

Same methods

HunspellStemmer::Stem ( String word, Char flags, Int32 recursionDepth ) : IEnumerable

Usage Example

Пример #1
0
        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);
        }
All Usage Examples Of Lucene.Net.Analysis.Hunspell.HunspellStemmer::Stem