use of com.graphaware.nlp.domain.Sentence in project neo4j-nlp by graphaware.
the class TestAnnotatedTesterUnitTest method testSentencesCountIsCorrect.
@Test
public void testSentencesCountIsCorrect() {
AnnotatedText annotatedText = new AnnotatedText();
TestAnnotatedText test = new TestAnnotatedText(annotatedText);
Sentence sentence = new Sentence("hello");
sentence.addTag(new Tag("hello", "en"));
annotatedText.addSentence(sentence);
test.assertSentencesCount(1);
}
use of com.graphaware.nlp.domain.Sentence in project neo4j-nlp by graphaware.
the class TestAnnotatedTesterUnitTest method assertTagEquals.
@Test
public void assertTagEquals() {
AnnotatedText annotatedText = new AnnotatedText();
TestAnnotatedText test = new TestAnnotatedText(annotatedText);
Sentence sentence = new Sentence("John is working in Denver for IBM");
sentence.addTag(newTag("John", singletonList("PERSON"), emptyList()));
sentence.addTag(newTag("Denver", singletonList("LOCATION"), emptyList()));
sentence.addTag(newTag("IBM", singletonList("ORGANIZATION"), emptyList()));
sentence.addTag(newTag("work"));
annotatedText.addSentence(sentence);
test.assertTag(newTag("John", singletonList("PERSON"), emptyList()));
test.assertTag(newTag("IBM", singletonList("ORGANIZATION"), emptyList()));
test.assertTag(newTag("work"));
}
use of com.graphaware.nlp.domain.Sentence in project neo4j-nlp by graphaware.
the class TestAnnotatedTesterUnitTest method testTagIsNotFound.
@Test(expected = AssertionError.class)
public void testTagIsNotFound() {
AnnotatedText annotatedText = new AnnotatedText();
TestAnnotatedText test = new TestAnnotatedText(annotatedText);
Sentence sentence = new Sentence("hello it is me");
sentence.addTag(new Tag("hello", "en"));
annotatedText.addSentence(sentence);
test.assertTagWithLemma("hella");
}
use of com.graphaware.nlp.domain.Sentence in project neo4j-nlp by graphaware.
the class TestAnnotatedTesterUnitTest method assertTagNotEquals.
@Test(expected = AssertionError.class)
public void assertTagNotEquals() {
AnnotatedText annotatedText = new AnnotatedText();
TestAnnotatedText test = new TestAnnotatedText(annotatedText);
Sentence sentence = new Sentence("John is working in Denver for IBM");
sentence.addTag(newTag("John", singletonList("PERSON"), emptyList()));
sentence.addTag(newTag("Denver", singletonList("LOCATION"), emptyList()));
sentence.addTag(newTag("IBM", singletonList("ORGANIZATION"), emptyList()));
sentence.addTag(newTag("work"));
annotatedText.addSentence(sentence);
test.assertTag(newTag("John"));
}
use of com.graphaware.nlp.domain.Sentence in project neo4j-nlp by graphaware.
the class TestAnnotatedTesterUnitTest method testTagIsFound.
@Test
public void testTagIsFound() {
AnnotatedText annotatedText = new AnnotatedText();
TestAnnotatedText test = new TestAnnotatedText(annotatedText);
Sentence sentence = new Sentence("hello");
sentence.addTag(new Tag("hello", "en"));
annotatedText.addSentence(sentence);
test.assertSentencesCount(1);
test.assertTagWithLemma("hello");
}
Aggregations