示例#1
0
 public static Token[] Stem(Token[] tokens)
 {
     PorterStemmer stemmer = new PorterStemmer();
     foreach (Token t in tokens)
     {
         string word = t.OringinalContent.ToLower();
         string root = getRootForm(lmtz, word);
         t.ProcessedContent= stemmer.stemTerm(root).ToLower();
     }
     return tokens;
 }
示例#2
0
        public static Token[] Stem(Token[] tokens)
        {
            PorterStemmer stemmer = new PorterStemmer();

            foreach (Token t in tokens)
            {
                string word = t.OringinalContent.ToLower();
                string root = getRootForm(lmtz, word);
                t.ProcessedContent = stemmer.stemTerm(root).ToLower();
            }
            return(tokens);
        }
 public Stopword_Remover()
 {
     StreamReader reader = new StreamReader(@"Resource\Data\stop_words.txt");
     string nextLine = "";
     List<string> stopwordlist = new List<string>();
     PorterStemmer stemmer = new PorterStemmer();
     while ((nextLine = reader.ReadLine()) != null)
     {
         stopwordlist.Add(stemmer.stemTerm(nextLine.Trim()));
     }
     stopwords = stopwordlist.ToArray();
     reader.Close();
 }
示例#4
0
        public Stopword_Remover()
        {
            StreamReader  reader       = new StreamReader(@"Resource\Data\stop_words.txt");
            string        nextLine     = "";
            List <string> stopwordlist = new List <string>();
            PorterStemmer stemmer      = new PorterStemmer();

            while ((nextLine = reader.ReadLine()) != null)
            {
                stopwordlist.Add(stemmer.stemTerm(nextLine.Trim()));
            }
            stopwords = stopwordlist.ToArray();
            reader.Close();
        }