示例#1
0
        public void ParseAndToStringSimpleIntransitive()
        {
            string  sample  = "jan Mato li jan soweli.";
            Dialect dialect = Dialect.LooseyGoosey;

            dialect.TargetGloss = "en";

            CorpusKnowledge ck = new CorpusKnowledge(sample, dialect);

            List <Sentence>[] s = ck.MakeSentences();
            foreach (List <Sentence> d in s)
            {
                foreach (Sentence js in d)
                {
                    Sentence sentence = js;
                    Console.WriteLine(sentence.ToString());
                    Console.WriteLine(sentence.ToString("b"));

                    Assert.AreEqual(sample, sentence.ToString());
                }
            }
        }
        public void IdentifyDiscourses_CanItEvenParseTheSentences()
        {
            string  sample  = CorpusTexts.UnpaText;
            Dialect dialect = Dialect.LooseyGoosey;

            dialect.TargetGloss = "en";
            CorpusKnowledge   ck   = new CorpusKnowledge(sample, dialect);
            NormalizeExplicit norm = new NormalizeExplicit(dialect);

            List <Sentence>[] s = ck.MakeSentences();
            for (int i = 0; i < s.Length; i++)
            {
                foreach (Sentence sentence in s[i])
                {
                    string reToStringed = sentence.ToString();
                    bool   match        = ck.Setences.Any(x => x.Trim() == reToStringed);
                    if (!match)
                    {
                        Console.WriteLine(match + " O:" + ck.Setences[i]);
                        Console.WriteLine(match + " R:" + sentence.ToString("b"));
                    }
                }
            }
        }