gov.llnl.ontology.text.sentsplit
Class OpenNlpMESentenceSplitter

java.lang.Object
  extended by gov.llnl.ontology.text.sentsplit.OpenNlpMESentenceSplitter
All Implemented Interfaces:
opennlp.tools.sentdetect.SentenceDetector

public class OpenNlpMESentenceSplitter
extends Object
implements opennlp.tools.sentdetect.SentenceDetector

A wrapper around the SentenceDetectorME SentenceDetector so that it can be loaded with a no argument constructor using a predefined model.

Author:
Keith Stevens

Field Summary
static String DEFAULT_MODEL
           
 
Constructor Summary
OpenNlpMESentenceSplitter()
          Loads the model configuration from DEFAULT_MODEL
OpenNlpMESentenceSplitter(String modelPath, boolean loadFromJar)
          Loads a SentenceDetectorME model from modelPath.
 
Method Summary
 String[] sentDetect(String sentence)
          
 opennlp.tools.util.Span[] sentPosDetect(String sentence)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_MODEL

public static final String DEFAULT_MODEL
See Also:
Constant Field Values
Constructor Detail

OpenNlpMESentenceSplitter

public OpenNlpMESentenceSplitter()
Loads the model configuration from DEFAULT_MODEL


OpenNlpMESentenceSplitter

public OpenNlpMESentenceSplitter(String modelPath,
                                 boolean loadFromJar)
Loads a SentenceDetectorME model from modelPath. If loadFromJar is true, the binary file will found within the running class path.

Method Detail

sentDetect

public String[] sentDetect(String sentence)

Specified by:
sentDetect in interface opennlp.tools.sentdetect.SentenceDetector

sentPosDetect

public opennlp.tools.util.Span[] sentPosDetect(String sentence)

Specified by:
sentPosDetect in interface opennlp.tools.sentdetect.SentenceDetector


Copyright © 2010-2011. All Rights Reserved.