use of opennlp.tools.sentdetect.SentenceDetectorME in project useful-java-links by Vedenin.
the class OpenNLPSentenceDetectors method testOpenNLPPosition.
private Span[] testOpenNLPPosition(String text) throws Exception {
try (InputStream modelIn = this.getClass().getResourceAsStream(RESOURCES_EN_SENT_BIN)) {
SentenceModel model = new SentenceModel(modelIn);
SentenceDetectorME sentenceDetector = new SentenceDetectorME(model);
return sentenceDetector.sentPosDetect(text);
}
}
Aggregations