Lucene.Net.Analysis.Ru.RussianStemmer.Stem C# (CSharp) Method

Stem() public method

public Stem ( String input ) : String
input String
return String
        public virtual String Stem(String input)
        {
            markPositions(input);
            if (RV == 0)
                return input; //RV wasn't detected, nothing to stem
            StringBuilder stemmingZone = new StringBuilder(input.Substring(RV));
            // stemming goes on in RV
            // Step 1

            if (!perfectiveGerund(stemmingZone))
            {
                reflexive(stemmingZone);
                // variable r is unused, we are just interested in the flow that gets
                // created by logical expression: apply adjectival(); if that fails,
                // apply verb() etc
                bool r =
                    adjectival(stemmingZone)
                    || Verb(stemmingZone)
                    || noun(stemmingZone);
            }
            // Step 2
            removeI(stemmingZone);
            // Step 3
            derivational(stemmingZone);
            // Step 4
            Superlative(stemmingZone);
            UndoubleN(stemmingZone);
            removeSoft(stemmingZone);
            // return result
            return input.Substring(0, RV) + stemmingZone.ToString();
        }

Usage Example

        /// <summary>
        /// Static method for stemming with different charsets
        /// </summary>
        /// <param name="theWord"></param>
        /// <param name="charset"></param>
        /// <returns></returns>
        public static String Stem(String theWord, char[] charset)
        {
            RussianStemmer stemmer = new RussianStemmer();

            stemmer.SetCharset(charset);
            return(stemmer.Stem(theWord));
        }
All Usage Examples Of Lucene.Net.Analysis.Ru.RussianStemmer::Stem