Пример #1
0
 private void pronounButton_Click(object sender, EventArgs e)
 {
     this.highlightText(0, this.essayTextBox.Text.Length, Color.White, Color.Black);
     Pronoun[] pronouns = essay.getPronounArray();
     foreach (Pronoun p in pronouns)
     {
         this.highlightPronounText(p);
     }
 }
Пример #2
0
        private void initCharts()
        {
            int past = 0, present = 0, future = 0, active = 0, passive = 0;

            Verb[] verbs = essay.getVerbArray();
            foreach (Verb v in verbs)
            {
                switch (v.getTense())
                {
                case 0:
                    past++;
                    break;

                case 1:
                    present++;
                    break;

                case 2:
                    future++;
                    break;
                }
                switch (v.getVoice())
                {
                case 0:
                    active++;
                    break;

                case 1:
                    passive++;
                    break;
                }
            }

            tenseChart.Series.ElementAt(0).Points.ElementAt(0).YValues = new double[] { past };
            tenseChart.Series.ElementAt(0).Points.ElementAt(1).YValues = new double[] { present };
            tenseChart.Series.ElementAt(0).Points.ElementAt(2).YValues = new double[] { future };
            voiceChart.Series.ElementAt(0).Points.ElementAt(0).YValues = new double[] { active };
            voiceChart.Series.ElementAt(0).Points.ElementAt(1).YValues = new double[] { passive };

            int first = 0, second = 0, third = 0;

            Pronoun[] pronouns = essay.getPronounArray();
            foreach (Pronoun p in pronouns)
            {
                switch (p.getPerson())
                {
                case 1:
                    first++;
                    break;

                case 2:
                    second++;
                    break;

                case 3:
                    third++;
                    break;
                }
            }

            pronounChart.Series.ElementAt(0).Points.ElementAt(0).YValues = new double[] { first };
            pronounChart.Series.ElementAt(0).Points.ElementAt(1).YValues = new double[] { second };
            pronounChart.Series.ElementAt(0).Points.ElementAt(2).YValues = new double[] { third };
        }