Exemple #1
0
        private void test(string[] sent, EarleyParser parser)
        {
            StringBuilder output = new StringBuilder();

            for (int i = 0; i < sent.Length - 1; i++)
            {
                output.Append(sent[i] + " ");
            }

            output.Append(sent[sent.Length - 1] + ".");
            string sentence = output.ToString();

            textBox1.Text += "Sentence: " + sentence + "\r\n";
            bool successful = parser.parseSentence(sent);

            textBox1.Text += "Parse Sucessful: " + successful.ToString() + "\r\n";
            Chart[] charts = parser.getCharts();
            textBox1.Text += "Charts produced by the sentence: " + sentence + "\r\n";

            for (int i = 0; i < charts.Length; i++)
            {
                textBox1.Text += "Chart[" + i.ToString() + "] :\r\n";
                textBox1.Text += charts[i].ToString() + "\r\n";
            }

            textBox1.Text += "\r\n";
        }
Exemple #2
0
        private void test(string[] sent, EarleyParser parser)
        {
            StringBuilder output = new StringBuilder();

            for (int i = 0; i < sent.Length - 1; i++)
            {
                output.Append(sent[i] + " ");
            }

            output.Append(sent[sent.Length - 1] + ".");
            string sentence = output.ToString();

            textBox1.Text += "Xâu Input: " + sentence + "\r\n";
            bool successful = parser.parseSentence(sent);

            textBox1.Text += "Kết quả: " + successful.ToString() + "\r\n";
            Chart[] charts = parser.getCharts();
            textBox1.Text += "Bảng  phân tích trạng thái xâu: " + sentence + "\r\n";

            for (int i = 0; i < charts.Length; i++)
            {
                textBox1.Text += "Bảng[" + i.ToString() + "] :\r\n";
                textBox1.Text += charts[i].ToString() + "\r\n";
            }

            textBox1.Text += "\r\n";
        }