Beispiel #1
0
        private void highlightPronounText(Pronoun p)
        {
            essayTextBox.shouldRun = false;
            int sentence = p.getSentence();
            int start    = essay.getSpan(sentence, p.getTokenStart()).getStart() + this.sentenceStarts[sentence];
            int length   = essay.getSpan(sentence, p.getTokenStart() + p.getLength() - 1).getEnd() - start + this.sentenceStarts[sentence];

            essayTextBox.Select(start, length);
            essayTextBox.SelectionColor = Color.Black;
            Color c;

            switch (p.getPerson())
            {
            case 1:
                if (p.getNumber() == 0)
                {
                    c = Color.FromArgb(255, 234, 175);
                    break;
                }
                else
                {
                    c = Color.FromArgb(255, 228, 151);
                    break;
                }

            case 2:
                c = Color.FromArgb(212, 216, 252);
                break;

            case 3:
                if (p.getNumber() == 0)
                {
                    c = Color.FromArgb(255, 208, 209);
                    break;
                }
                else
                {
                    c = Color.FromArgb(255, 175, 177);
                    break;
                }

            default:
                c = Color.White;
                break;
            }

            essayTextBox.SelectionBackColor = c;
            essayTextBox.shouldRun          = true;
        }
Beispiel #2
0
 public Pronoun[] getPronouns()
 {
     String[]  prons = this.readFile("pronoun.txt");
     Pronoun[] pro   = new Pronoun[prons.Length];
     for (int i = 0; i < prons.Length; i++)
     {
         String[] split    = prons[i].Split(',');
         int      sentence = Int32.Parse(split[0]);
         int      start    = Int32.Parse(split[1]);
         int      end      = Int32.Parse(split[2]);
         int      length   = end - start;
         start += this.sentenceStart(sentence);
         int person = Int32.Parse(split[3]);
         pro[i] = new Pronoun(start, length, person);
     }
     return(pro);
 }
Beispiel #3
0
 private void highlightPronounText(Pronoun l)
 {
     essayTextBox.Select(l.getStart(), l.getLength());
     essayTextBox.SelectionColor     = Color.Black;
     essayTextBox.SelectionBackColor = l.getColor();
 }