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

opennlp.tools.sentdetect

## Interface EndOfSentenceScanner

- All Known Implementing Classes:
    DefaultEndOfSentenceScanner

      public interface EndOfSentenceScanner

  Scans Strings, StringBuffers, and char[] arrays for the offsets of sentence ending characters.

  Implementations of this interface can use regular expressions, hand-coded DFAs, and other scanning techniques to locate end of sentence offsets.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `char[]` | `getEndOfSentenceCharacters()` Deprecated.
    `Set<Character>` | `getEOSCharacters()` Returns a set of character which can indicate the end of a sentence.
    `List<Integer>` | `getPositions(char[] cbuf)` The receiver scans `cbuf' for sentence ending characters and returns their offsets.
    `List<Integer>` | `getPositions(String s)` The receiver scans the specified string for sentence ending characters and returns their offsets.
    `List<Integer>` | `getPositions(StringBuffer buf)` The receiver scans `buf' for sentence ending characters and returns their offsets.

- - ### Method Detail

    - #### getEndOfSentenceCharacters

          @Deprecated
          char[] getEndOfSentenceCharacters()

      Deprecated.
      Returns an array of character which can indicate the end of a sentence.
      Returns:
        an array of character which can indicate the end of a sentence.

    - #### getEOSCharacters

          Set<Character> getEOSCharacters()

      Returns a set of character which can indicate the end of a sentence.
      Returns:
        a set of character which can indicate the end of a sentence.

    - #### getPositions

          List<Integer> getPositions(String s)

      The receiver scans the specified string for sentence ending characters and returns their offsets.
      Parameters:
        `s` - a `String` value
      Returns:
        a `List` of Integer objects.

    - #### getPositions

          List<Integer> getPositions(StringBuffer buf)

      The receiver scans `buf' for sentence ending characters and returns their offsets.
      Parameters:
        `buf` - a `StringBuffer` value
      Returns:
        a `List` of Integer objects.

    - #### getPositions

          List<Integer> getPositions(char[] cbuf)

      The receiver scans `cbuf' for sentence ending characters and returns their offsets.
      Parameters:
        `cbuf` - a `char[]` value
      Returns:
        a `List` of Integer objects.

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