Esempio n. 1
0
        internal static EnglishWord CreateForTest(string text)
        {
            EnglishWord word = new EnglishWord();

            word.Create(text);
            return(word);
        }
Esempio n. 2
0
        internal static EnglishWord CreateWithR1R2(string text)
        {
            EnglishWord result = CreateForTest(text);

            result._r1 = CalculateR(result.Stem, 0);
            result._r2 = CalculateR(result.Stem, result._r1.Start);
            return(result);
        }
Esempio n. 3
0
        public string StemWord(string word)
        {
            string tryValue;

            if (wordCache.TryGetValue(word, out tryValue))
            {
                return(tryValue);
            }
            else
            {
                var stemmedWord = new EnglishWord(word).Stem;
                wordCache.TryAdd(word, stemmedWord);
                return(stemmedWord);
            }
        }