Exemplo n.º 1
0
        public void SplitSentence()
        {
            SentenceProcessor sp   = new SentenceProcessor();
            string            test =
                @"mi pilin pona. mi ken ala ken lukin e ni? ni li suli! mi wile e ni: jan li pona.";

            Collection <Sentence> sentences = sp.SplitIntoSentences(test);

            Assert.AreEqual(5, sentences.Count);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            SentenceProcessor sp = new SentenceProcessor(textBox1.Text.Split());

            label1.Text = "";

            String[] baseStr = sp.BaseSentence();

            for (int i = 0; i < baseStr.Length; i++)
            {
                label1.Text += " " + baseStr[i];
            }
        }
Exemplo n.º 3
0
        protected void btnGloss_Click(object sender, EventArgs e)
        {
            SentenceProcessor sp        = new SentenceProcessor();
            string            toConvert = Server.HtmlEncode(txtInput.Text);

            Collection <Sentence> sentences = sp.SplitIntoSentences(toConvert.ToLower().Trim());

            StringBuilder sb = new StringBuilder();

            foreach (Sentence sentence in sentences)
            {
                sb.Append(GlossASentence(sentence));
            }
            txtOutput.Text  = sb.ToString();
            Session["html"] = sb.ToString();
        }