use of opennlp.tools.namefind.TokenNameFinder in project stanbol by apache.
the class OpenNLPTest method testLoadMissingNER.
@Test
public void testLoadMissingNER() throws IOException {
//first unknown type
TokenNameFinderModel model = openNLP.getNameModel("person2", "en");
Assert.assertNull(model);
TokenNameFinder ner = openNLP.getNameFinder("person2", "en");
Assert.assertNull(ner);
//unknown language
model = openNLP.getNameModel("person", "ru");
Assert.assertNull(model);
ner = openNLP.getNameFinder("person", "ru");
Assert.assertNull(ner);
}
use of opennlp.tools.namefind.TokenNameFinder in project stanbol by apache.
the class OpenNLPTest method testLoadEnNER.
@Test
public void testLoadEnNER() throws IOException {
for (String type : Arrays.asList("person", "organization", "location")) {
TokenNameFinderModel model = openNLP.getNameModel(type, "en");
Assert.assertNotNull(model);
TokenNameFinder ner = openNLP.getNameFinder(type, "en");
Assert.assertNotNull(ner);
}
}
Aggregations