SentenceDetector (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.sentdetect

## Interface SentenceDetector

- All Known Implementing Classes:
    NewlineSentenceDetector, SentenceDetectorME

      public interface SentenceDetector

  The interface for sentence detectors, which find the sentence boundaries in a text.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `String[]` | `sentDetect(String s)` Sentence detect a string.
    `Span[]` | `sentPosDetect(String s)` Sentence detect a string.

- - ### Method Detail

    - #### sentDetect

          String[] sentDetect(String s)

      Sentence detect a string.
      Parameters:
        `s` - The string to be sentence detected.
      Returns:
        The String[] with the individual sentences as the array elements.

    - #### sentPosDetect

          Span[] sentPosDetect(String s)

      Sentence detect a string.
      Parameters:
        `s` - The string to be sentence detected.
      Returns:
        The Span[] with the spans (offsets into s) for each detected sentence as the individuals array elements.

Copyright © 2026 The Apache Software Foundation. All rights reserved.