private List <string> createNGramTextENG(string textList, int nGramSize)
        {
            string        filteredLine = "";
            string        line         = "";
            List <string> listNGram    = new List <string>();

            using (StringReader reader = new StringReader(textList))
            {
                while ((line = reader.ReadLine()) != null)
                {
                    filteredLine = StopwordTool.RemoveStopwords(line).ToLower();
                    for (int i = 0; i < filteredLine.Length - nGramSize + 1; i++)
                    {
                        listNGram.Add(filteredLine.Substring(i, nGramSize));
                    }
                }
            }
            return(listNGram);
        }
Esempio n. 2
0
        private List <string> createNGramTextENG(List <string> textList, int nGramSize)
        {
            string        filteredLine = "";
            List <string> listNGram    = new List <string>();

            foreach (string s in textList)
            {
                if (s != null)
                {
                    richTextBox1.AppendText("Raw Data1: " + "'" + s + "'" + "\n");
                    filteredLine = StopwordTool.RemoveStopwords(s).ToLower();
                    richTextBox1.AppendText("Filtered Data1: " + "'" + filteredLine + "'" + "\n");
                    for (int i = 0; i < filteredLine.Length - nGramSize + 1; i++)
                    {
                        listNGram.Add(filteredLine.Substring(i, nGramSize));
                    }
                }
            }
            return(listNGram);
        }