Search in sources :

Example 6 with SentenceDetectorME

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);
    }
}
Also used : InputStream(java.io.InputStream) SentenceModel(opennlp.tools.sentdetect.SentenceModel) SentenceDetectorME(opennlp.tools.sentdetect.SentenceDetectorME)

Aggregations

SentenceDetectorME (opennlp.tools.sentdetect.SentenceDetectorME)6 SentenceModel (opennlp.tools.sentdetect.SentenceModel)5 InputStream (java.io.InputStream)2 NameFinderME (opennlp.tools.namefind.NameFinderME)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1 GZIPInputStream (java.util.zip.GZIPInputStream)1 TokenNameFinderModel (opennlp.tools.namefind.TokenNameFinderModel)1 Tokenizer (opennlp.tools.tokenize.Tokenizer)1 TokenizerME (opennlp.tools.tokenize.TokenizerME)1 TokenizerModel (opennlp.tools.tokenize.TokenizerModel)1 Span (opennlp.tools.util.Span)1 NerTag (org.apache.stanbol.enhancer.nlp.ner.NerTag)1 EngineException (org.apache.stanbol.enhancer.servicesapi.EngineException)1 ConfigurationException (org.osgi.service.cm.ConfigurationException)1