Beispiel #1
0
        /// <summary>
        /// Stem a word.
        /// </summary>
        /// <param name="word">input word to be stemmed.</param>
        /// <returns>stemmed word, or null if the stem could not be generated.</returns>
        public StringBuilder Stem(string word)
        {
            string cmd = stemmer.GetLastOnPath(word);

            if (cmd == null)
            {
                return(null);
            }

            buffer.Length = 0;
            buffer.Append(word);

            Diff.Apply(buffer, cmd);

            if (buffer.Length > 0)
            {
                return(buffer);
            }
            else
            {
                return(null);
            }
        }