Ejemplo n.º 1
0
 public static IEnumerable <string> Normalise(this string str)
 {
     return(str.Split(Separators, StringSplitOptions.RemoveEmptyEntries)
            .Select(word => word.ToLowerInvariant())
            .Where(word => !StopWords.Contains(word))
            .Select(word =>
     {
         Stemmer stemmer = new Stemmer();
         stemmer.add(word.ToCharArray(0, word.Length), word.Length);
         stemmer.stem();
         return stemmer.ToString();
     }));
 }
Ejemplo n.º 2
0
 public static IEnumerable<string> Normalise(this string str)
 {
     return str.Split(Separators, StringSplitOptions.RemoveEmptyEntries)
         .Select(word => word.ToLowerInvariant())
         .Where(word => !StopWords.Contains(word))
         .Select(word =>
             {
                 Stemmer stemmer = new Stemmer();
                 stemmer.add(word.ToCharArray(0, word.Length), word.Length);
                 stemmer.stem();
                 return stemmer.ToString();
             });
 }