Esempio n. 1
0
        private void Top_10_NoStopsButton_Click_1(object sender, EventArgs e)
        {
            Top_10NoStops.Clear();

            string        raw_input = this.InputTextBox.Text;
            List <string> stopwords = new List <string>();

            if (Stopwords.CheckedItems.Count == 0)
            {
                MessageBox.Show("No Stopwords selected!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                for (int i = 0; i < Stopwords.Items.Count; i++)
                {
                    if (Stopwords.GetItemChecked(i))
                    {
                        stopwords.Add((string)Stopwords.Items[i]);
                    }
                }
                var stopwords_docs = Program.GetDocs_NoStopwords(raw_input, stopwords);
                var stoplist_docs  = Program.TF_IDF(stopwords_docs);

                var top10_noStops = stoplist_docs.SelectMany(x => x).OrderBy(x => x.Value).Select(x => x.Key).Distinct().Take(10).ToList();

                for (int i = 0; i < top10_noStops.Count; i++)
                {
                    Top_10NoStops.Items.Add(top10_noStops[i]);
                }
            }
        }
Esempio n. 2
0
 private void InputTextBox_TextChanged(object sender, EventArgs e)
 {
     Bigrams.Clear();
     Trigrams.Clear();
     Stopwords.Items.Clear();
     Top_10NoStops.Clear();
     top_10_Stem.Clear();
     Top_10Words.Clear();
     Stem_NoStops.Clear();
 }