Package opennlp.tools.sentdetect
Class DefaultEndOfSentenceScanner
java.lang.Object
opennlp.tools.sentdetect.DefaultEndOfSentenceScanner
- All Implemented Interfaces:
EndOfSentenceScanner
Default implementation of the
EndOfSentenceScanner
.
It uses a character array with possible end of sentence chars
to identify potential sentence endings.-
Constructor Summary
ConstructorDescriptionDefaultEndOfSentenceScanner
(char[] eosCharacters) Initializes the current instance. -
Method Summary
Modifier and TypeMethodDescriptiongetPositions
(char[] cbuf) The receiver scanscbuf
for sentence ending characters and returns their offsets.The receiver scans the specified string for sentence ending characters and returns their offsets.getPositions
(StringBuffer buf) The receiver scansbuf
for sentence ending characters and returns their offsets.
-
Constructor Details
-
DefaultEndOfSentenceScanner
public DefaultEndOfSentenceScanner(char[] eosCharacters) Initializes the current instance.- Parameters:
eosCharacters
- The characters to be used to detect sentence endings.
-
-
Method Details
-
getPositions
Description copied from interface:EndOfSentenceScanner
The receiver scans the specified string for sentence ending characters and returns their offsets.- Specified by:
getPositions
in interfaceEndOfSentenceScanner
- Parameters:
s
- ACharSequence
to be scanned.- Returns:
- A
List
of Integer objects.
-
getPositions
Description copied from interface:EndOfSentenceScanner
The receiver scansbuf
for sentence ending characters and returns their offsets.- Specified by:
getPositions
in interfaceEndOfSentenceScanner
- Parameters:
buf
- AStringBuffer
to be scanned.- Returns:
- A
List
of Integer objects.
-
getPositions
Description copied from interface:EndOfSentenceScanner
The receiver scanscbuf
for sentence ending characters and returns their offsets.- Specified by:
getPositions
in interfaceEndOfSentenceScanner
- Parameters:
cbuf
- Achar[]
to be scanned.- Returns:
- A
List
of Integer objects.
-
getEOSCharacters
- Specified by:
getEOSCharacters
in interfaceEndOfSentenceScanner
- Returns:
- a set of
characters
which can indicate the end of a sentence.
-