/// <summary>
 /// Processes a string by stemming terms via the Porter stemming algorithm
 /// </summary>
 /// <param name="textToProcess">Input text</param>
 /// <returns>Stemmed text</returns>
 public static string ProcessText(string textToProcess)
 {
     StringBuilder builder = new StringBuilder();
     string result = string.Empty;
     string stemmedWord;
     char[] delimiterChars = { ' ' };
     string[] tokens = textToProcess.Split(delimiterChars);
     PorterStemmer porterStemmer = new PorterStemmer();
     foreach (string token in tokens)
     {
         stemmedWord = porterStemmer.stemTerm(token);
         builder.AppendFormat("{0} ", stemmedWord);
     }
     result = builder.ToString().Trim();
     return result;
 }
Beispiel #2
0
 /// <summary>
 /// Processes a string by stemming terms via the Porter stemming algorithm
 /// </summary>
 /// <param name="textToProcess">Input text</param>
 /// <returns>Stemmed text</returns>
 public static string ProcessText(string textToProcess)
 {
     StringBuilder builder = new StringBuilder();
     string result = string.Empty;
     string stemmedWord;
     char[] delimiterChars = { ' ' };
     string[] tokens = textToProcess.Split(delimiterChars);
     PorterStemmer porterStemmer = new PorterStemmer();
     foreach (string token in tokens)
     {
         stemmedWord = porterStemmer.stemTerm(token);
         builder.AppendFormat("{0} ", stemmedWord);
     }
     result = builder.ToString().Trim();
     return result;
 }