Exemple #1
0
        internal static POSSample CreatePredSample()
        {
            const string sentence = "the_DT stories_NNS about_NNS well-heeled_JJ " +
                                    "communities_NNS and_CC developers_CC";

            return(POSSample.Parse(sentence));
        }
Exemple #2
0
        public void TestParse()
        {
            const string sentence = "the_DT stories_NNS about_IN well-heeled_JJ " +
                                    "communities_NNS and_CC developers_NNS";

            var sample = POSSample.Parse(sentence);

            Assert.AreEqual(sentence, sample.ToString());
        }
Exemple #3
0
        public void TestParseEmptyString()
        {
            var sample = POSSample.Parse(string.Empty);

            Assert.AreEqual(0, sample.Sentence.Length);
            Assert.AreEqual(0, sample.Tags.Length);

            var value = sample.ToString();

            Assert.IsEmpty(value);
        }
        public void TestOutcomesForSingleSentence()
        {
            const string sentence = "That_DT sounds_VBZ good_JJ ._.";

            var sample = POSSample.Parse(sentence);

            var eventStream = new POSSampleEventStream(new GenericObjectStream <POSSample>(sample));

            Assert.AreEqual("DT", eventStream.Read().Outcome);
            Assert.AreEqual("VBZ", eventStream.Read().Outcome);
            Assert.AreEqual("JJ", eventStream.Read().Outcome);
            Assert.AreEqual(".", eventStream.Read().Outcome);

            Assert.Null(eventStream.Read());
        }
Exemple #5
0
 public void TestParseWithError()
 {
     Assert.Throws <InvalidFormatException> (() => {
         POSSample.Parse("the_DT stories");
     });
 }
Exemple #6
0
        public void TestParseEmptyToken()
        {
            var sample = POSSample.Parse("the_DT _NNS");

            Assert.AreEqual(string.Empty, sample.Sentence[1]);
        }
Exemple #7
0
        public void TestParseEmptyTag()
        {
            var sample = POSSample.Parse("the_DT stories_");

            Assert.AreEqual(string.Empty, sample.Tags[1]);
        }
Exemple #8
0
 public void TestParseWithError()
 {
     POSSample.Parse("the_DT stories");
 }