Beispiel #1
0
 private void copy_from(PortugalStemmer other)
 {
     I_p2 = other.I_p2;
     I_p1 = other.I_p1;
     I_pV = other.I_pV;
     base.copy_from(other);
 }
Beispiel #2
0
        }//Stem text in English--------------------------------------

        public static List <List <string> > PortugueseStemming(List <List <string> > doc_words) //Stem text in Portuguese-----------------------------------
        {
            PortugalStemmer       stemmer       = new PortugalStemmer();
            List <string>         stemmed_words = new List <string>();
            List <List <string> > stem_docs     = new List <List <string> >();
            List <string>         test          = new List <string>();
            //string sorting;

            int i = 0;

            foreach (List <string> doc in doc_words)
            {
                stemmed_words = test.Select(x => x).Distinct().ToList();
                stem_docs.Add(stemmed_words);

                foreach (string word in doc)
                {
                    if (word.Length > 0)
                    {
                        var stem_word = stemmer.Stem(word);
                        if (!stemmed_words.Contains(word))
                        {
                            stemmed_words.Add(stem_word);
                        }
                        i++;
                    }
                }
            }
            return(stem_docs);
        }
 private void copy_from(PortugalStemmer other) {
     I_p2 = other.I_p2;
     I_p1 = other.I_p1;
     I_pV = other.I_pV;
     base.copy_from(other);
 }