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
ConstructorsConstructorDescriptionDefaultEndOfSentenceScanner(char[] eosCharacters) Initializes the current instance. -
Method Summary
Modifier and TypeMethodDescriptiongetPositions(char[] cbuf) The receiver scanscbuffor 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 scansbuffor 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:EndOfSentenceScannerThe receiver scans the specified string for sentence ending characters and returns their offsets.- Specified by:
getPositionsin interfaceEndOfSentenceScanner- Parameters:
s- ACharSequenceto be scanned.- Returns:
- A
Listof Integer objects.
-
getPositions
Description copied from interface:EndOfSentenceScannerThe receiver scansbuffor sentence ending characters and returns their offsets.- Specified by:
getPositionsin interfaceEndOfSentenceScanner- Parameters:
buf- AStringBufferto be scanned.- Returns:
- A
Listof Integer objects.
-
getPositions
Description copied from interface:EndOfSentenceScannerThe receiver scanscbuffor sentence ending characters and returns their offsets.- Specified by:
getPositionsin interfaceEndOfSentenceScanner- Parameters:
cbuf- Achar[]to be scanned.- Returns:
- A
Listof Integer objects.
-
getEOSCharacters
- Specified by:
getEOSCharactersin interfaceEndOfSentenceScanner- Returns:
- a set of
characterswhich can indicate the end of a sentence.
-