Package opennlp.tools.sentdetect
Class DefaultEndOfSentenceScanner
- java.lang.Object
-
- opennlp.tools.sentdetect.DefaultEndOfSentenceScanner
-
- All Implemented Interfaces:
EndOfSentenceScanner
public class DefaultEndOfSentenceScanner extends Object implements EndOfSentenceScanner
Default implementation of theEndOfSentenceScanner
. It uses a character array with possible end of sentence chars to identify potential sentence endings.
-
-
Constructor Summary
Constructors Constructor Description DefaultEndOfSentenceScanner(char[] eosCharacters)
Initializes the current instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description char[]
getEndOfSentenceCharacters()
Deprecated.Set<Character>
getEOSCharacters()
List<Integer>
getPositions(char[] cbuf)
The receiver scanscbuf
for sentence ending characters and returns their offsets.List<Integer>
getPositions(CharSequence s)
The receiver scans the specified string for sentence ending characters and returns their offsets.List<Integer>
getPositions(StringBuffer buf)
The receiver scansbuf
for sentence ending characters and returns their offsets.
-
-
-
Method Detail
-
getPositions
public List<Integer> getPositions(CharSequence s)
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
public List<Integer> getPositions(StringBuffer buf)
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
public List<Integer> getPositions(char[] cbuf)
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.
-
getEndOfSentenceCharacters
@Deprecated public char[] getEndOfSentenceCharacters()
Deprecated.- Specified by:
getEndOfSentenceCharacters
in interfaceEndOfSentenceScanner
- Returns:
- an array of character which can indicate the end of a sentence.
-
getEOSCharacters
public Set<Character> getEOSCharacters()
- Specified by:
getEOSCharacters
in interfaceEndOfSentenceScanner
- Returns:
- a set of
characters
which can indicate the end of a sentence.
-
-