Stem() public method

public Stem ( String input ) : String
input String
return String
Exemplo n.º 1
0
        /// <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));
        }
Exemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 /// <returns>Returns the next token in the stream, or null at EOS</returns>
 public override Token Next()
 {
     if ((token = input.Next()) == null)
     {
         return(null);
     }
     else
     {
         String s = stemmer.Stem(token.TermText());
         if (!s.Equals(token.TermText()))
         {
             return(new Token(s, token.StartOffset(), token.EndOffset(),
                              token.Type()));
         }
         return(token);
     }
 }
Exemplo n.º 3
0
 /*
  * Returns the next token in the stream, or null at EOS
  */
 public sealed override bool IncrementToken()
 {
     if (input.IncrementToken())
     {
         String term = termAtt.Term;
         String s    = stemmer.Stem(term);
         if (s != null && !s.Equals(term))
         {
             termAtt.SetTermBuffer(s);
         }
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
        /*
         * Static method for stemming.
         */
        public static String StemWord(String theWord)
        {
            RussianStemmer stemmer = new RussianStemmer();

            return(stemmer.Stem(theWord));
        }
Exemplo n.º 5
0
 /*
  * Static method for stemming.
  */
 public static String StemWord(String theWord)
 {
     RussianStemmer stemmer = new RussianStemmer();
     return stemmer.Stem(theWord);
 }
Exemplo n.º 6
0
		/// <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);
		}