Class SentenceDetector

java.lang.Object
org.apache.uima.analysis_component.AnalysisComponent_ImplBase
org.apache.uima.analysis_component.Annotator_ImplBase
org.apache.uima.analysis_component.CasAnnotator_ImplBase
opennlp.uima.sentdetect.AbstractSentenceDetector
opennlp.uima.sentdetect.SentenceDetector
All Implemented Interfaces:
org.apache.uima.analysis_component.AnalysisComponent

public final class SentenceDetector extends AbstractSentenceDetector
An OpenNLP-based Sentence annotator.

Mandatory parameters:

Type Name Description
String opennlp.uima.ModelName The name of the model file
String opennlp.uima.SentenceType The full name of the sentence type

Optional parameters:

Type Name Description
String opennlp.uima.ContainerType The name of the container type
String opennlp.uima.ProbabilityFeature The name of the double probability feature (not set by default)
  • Field Details

    • sentenceDetector

      private SentenceDetectorME sentenceDetector
      OpenNLP sentence detector.
    • probabilityFeature

      private org.apache.uima.cas.Feature probabilityFeature
  • Constructor Details

    • SentenceDetector

      public SentenceDetector()
      Initializes a new instance.

      Note: Use initialize(UimaContext) to initialize this instance. Not use the constructor.

  • Method Details

    • initialize

      public void initialize(org.apache.uima.UimaContext context) throws org.apache.uima.resource.ResourceInitializationException
      Initializes the current instance with the given context.

      Note: Do all initialization in this method, do not use the constructor.

      Specified by:
      initialize in interface org.apache.uima.analysis_component.AnalysisComponent
      Overrides:
      initialize in class AbstractSentenceDetector
      Throws:
      org.apache.uima.resource.ResourceInitializationException
    • typeSystemInit

      public void typeSystemInit(org.apache.uima.cas.TypeSystem typeSystem) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
      Initializes the type system.
      Overrides:
      typeSystemInit in class AbstractSentenceDetector
      Throws:
      org.apache.uima.analysis_engine.AnalysisEngineProcessException
    • detectSentences

      protected Span[] detectSentences(String text)
      Specified by:
      detectSentences in class AbstractSentenceDetector
    • postProcessAnnotations

      protected void postProcessAnnotations(org.apache.uima.cas.text.AnnotationFS[] sentences)
      Overrides:
      postProcessAnnotations in class AbstractSentenceDetector
    • destroy

      public void destroy()
      Releases allocated resources.
      Specified by:
      destroy in interface org.apache.uima.analysis_component.AnalysisComponent
      Overrides:
      destroy in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase