private List <string> createNGramText(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 = FrenchstopwordTool.RemoveStopwords(line).ToLower();
                    for (int i = 0; i < filteredLine.Length - nGramSize + 1; i++)
                    {
                        listNGram.Add(filteredLine.Substring(i, nGramSize));
                    }
                }
            }
            return(listNGram);
        }
예제 #2
0
        private List <string> createNGramTextFRN(List <string> textList, int nGramSize)
        {
            string        filteredLine = "";
            List <string> listNGram    = new List <string>();

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