Class SentenceModel

java.lang.Object
opennlp.tools.util.model.BaseModel
opennlp.tools.sentdetect.SentenceModel
All Implemented Interfaces:
Serializable, opennlp.tools.util.model.ArtifactProvider

public class SentenceModel extends BaseModel
The SentenceModel is the model used by a learnable SentenceDetector.
See Also:
  • Constructor Details

    • SentenceModel

      public SentenceModel(String languageCode, opennlp.tools.ml.model.MaxentModel sentModel, Map<String,String> manifestInfoEntries, SentenceDetectorFactory sdFactory)
      Initializes a SentenceModel instance via given parameters.
      Parameters:
      languageCode - The ISO language code for this model. Must not be null.
      sentModel - A valid MaxentModel.
      manifestInfoEntries - Additional information kept in the manifest.
      sdFactory - The SentenceDetectorFactory for creating related objects.
    • SentenceModel

      public SentenceModel(InputStream in) throws IOException
      Initializes a SentenceModel instance via a valid InputStream.
      Parameters:
      in - The InputStream used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
    • SentenceModel

      public SentenceModel(File modelFile) throws IOException
      Initializes a SentenceModel instance via a valid File.
      Parameters:
      modelFile - The File used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
    • SentenceModel

      public SentenceModel(Path modelPath) throws IOException
      Initializes a SentenceModel instance via a valid Path.
      Parameters:
      modelPath - The Path used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
    • SentenceModel

      public SentenceModel(URL modelURL) throws IOException
      Initializes a SentenceModel instance via a valid URL.
      Parameters:
      modelURL - The URL used for loading the model.
      Throws:
      IOException - Thrown if IO errors occurred during initialization.
  • Method Details

    • getFactory

      public SentenceDetectorFactory getFactory()
    • getMaxentModel

      public opennlp.tools.ml.model.MaxentModel getMaxentModel()
    • getAbbreviations

      public Dictionary getAbbreviations()
    • useTokenEnd

      public boolean useTokenEnd()
    • getEosCharacters

      public char[] getEosCharacters()