Пример #1
0
        public static string PorterStemming(string str)
        {
            EnglishPorter2Stemmer stemword = new EnglishPorter2Stemmer();
            string templine = null;

            List <string> StopWords = new List <string>();

            string[] temp = str.Split(' ');
            for (int i = 0; i < temp.Length; i++)
            {
                temp[i] = stemword.Stem(temp[i]).Value;
                if (i == (temp.Length - 1))
                {
                    templine = templine + temp[i];
                }
                else
                {
                    templine = templine + temp[i] + " ";
                }
            }
            return(templine);
        }
Пример #2
0
        public static string PorterStemming(string str)
        {
            EnglishPorter2Stemmer stemword = new EnglishPorter2Stemmer();
            StringBuilder         templine = new StringBuilder();

            List <string> StopWords = new List <string>();

            string[] temp = str.Split(' ');
            for (int i = 0; i < temp.Length; i++)
            {
                temp[i] = stemword.Stem(temp[i]).Value;
                if (i == (temp.Length - 1))
                {
                    templine.Append(temp[i]);
                }
                else
                {
                    templine.Append(temp[i] + " ");
                }
            }
            return(templine.ToString());
        }