public void BigramsShowStatistik() { chart1.Series[0].Points.Clear(); AnalizMain am = new AnalizMain(); am.CountBigrams(); textBox1.Text = Convert.ToString(am.bigrams.Count); chart1.ChartAreas[0].AxisX.Interval = 1; for (int i = 0; i < am.bigrams.Count; i++) { string s = am.bigrams[i].Name; s = s.Replace(' ', '_'); this.chart1.Series[0].Points.AddXY(s, am.bigrams[i].Counted); } chart2.Series[0].Points.Clear(); chart2.ChartAreas[0].AxisX.Interval = 1; am.bigrams = am.bigrams.OrderByDescending(y => y.Counted).ToList(); for (int i = 0; i < am.bigrams.Count; i++) { string s = am.bigrams[i].Name; s = s.Replace(' ', '_'); this.chart2.Series[0].Points.AddXY(s, am.bigrams[i].Counted); } }
private void button4_Click(object sender, EventArgs e) { AnalizMain an = new AnalizMain(); an.CountBigrams(); an.CountTrigrams(); an.OneSimbolAnalys(); string[] path = { @"onesimbol.txt", @"bigram.txt", @"trigram.txt" }; WriteToFile(path[0], an.SortGrams(an.onegrams)); WriteToFile(path[1], an.SortGrams(an.bigrams)); WriteToFile(path[2], an.SortGrams(an.trigrams)); }
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { comboBox2.Items.Clear(); comboBox3.Items.Clear(); AnalizMain am = new AnalizMain(); switch (comboBox1.SelectedIndex) { case 0: { am.OneSimbolAnalys(); am.onegrams = am.onegrams.OrderByDescending(y => y.Counted).ToList(); for (int i = 0; i < am.onegrams.Count; i++) { comboBox2.Items.Add(am.onegrams[i].Name); comboBox3.Items.Add(am.onegrams[i].Counted); } comboBox2.SelectedIndex = 0; }; break; case 1: { am.CountBigrams(); am.bigrams = am.bigrams.OrderByDescending(y => y.Counted).ToList(); for (int i = 0; i < am.bigrams.Count; i++) { comboBox2.Items.Add(am.bigrams[i].Name); comboBox3.Items.Add(am.bigrams[i].Counted); } comboBox2.SelectedIndex = 0; }; break; case 2: { am.CountTrigrams(); am.trigrams = am.trigrams.OrderByDescending(y => y.Counted).ToList(); for (int i = 0; i < am.trigrams.Count; i++) { comboBox2.Items.Add(am.trigrams[i].Name); comboBox3.Items.Add(am.trigrams[i].Counted); } comboBox2.SelectedIndex = 0; };; break; default: break; } }