Ejemplo n.º 1
0
        public void testPhraseAsSpan()
        {
            var spans = ChunkSample.PhrasesAsSpanList(createSentence(), createTags(), createChunks());

            Assert.AreEqual(10, spans.Length);
            Assert.AreEqual(new Span(0, 1, "NP"), spans[0]);
            Assert.AreEqual(new Span(1, 2, "PP"), spans[1]);
            Assert.AreEqual(new Span(2, 5, "NP"), spans[2]);
            Assert.AreEqual(new Span(5, 6, "VP"), spans[3]);
            Assert.AreEqual(new Span(6, 7, "ADVP"), spans[4]);
            Assert.AreEqual(new Span(8, 9, "NP"), spans[5]);
            Assert.AreEqual(new Span(9, 10, "PP"), spans[6]);
            Assert.AreEqual(new Span(10, 13, "NP"), spans[7]);
            Assert.AreEqual(new Span(13, 14, "VP"), spans[8]);
            Assert.AreEqual(new Span(14, 15, "ADVP"), spans[9]);
        }
Ejemplo n.º 2
0
 public void testInvalidPhraseAsSpan3()
 {
     ChunkSample.PhrasesAsSpanList(new string[1], new string[1], new string[2]);
 }
Ejemplo n.º 3
0
 public void TestInvalidPhraseAsSpan3()
 {
     Assert.Throws <ArgumentException> (() => {
         ChunkSample.PhrasesAsSpanList(new string[1], new string[1], new string[2]);
     });
 }