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 an 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()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
-
getPositions
public List<Integer> getPositions(String s)
Description copied from interface:EndOfSentenceScannerThe receiver scans the specified string for sentence ending characters and returns their offsets.- Specified by:
getPositionsin interfaceEndOfSentenceScanner- Parameters:
s- aStringvalue- Returns:
- a
Listof Integer objects.
-
getPositions
public List<Integer> getPositions(StringBuffer buf)
Description copied from interface:EndOfSentenceScannerThe receiver scans `buf' for sentence ending characters and returns their offsets.- Specified by:
getPositionsin interfaceEndOfSentenceScanner- Parameters:
buf- aStringBuffervalue- Returns:
- a
Listof Integer objects.
-
getPositions
public List<Integer> getPositions(char[] cbuf)
Description copied from interface:EndOfSentenceScannerThe receiver scans `cbuf' for sentence ending characters and returns their offsets.- Specified by:
getPositionsin interfaceEndOfSentenceScanner- Parameters:
cbuf- achar[]value- Returns:
- a
Listof Integer objects.
-
getEndOfSentenceCharacters
@Deprecated public char[] getEndOfSentenceCharacters()
Deprecated.Description copied from interface:EndOfSentenceScannerReturns an array of character which can indicate the end of a sentence.- Specified by:
getEndOfSentenceCharactersin interfaceEndOfSentenceScanner- Returns:
- an array of character which can indicate the end of a sentence.
-
getEOSCharacters
public Set<Character> getEOSCharacters()
Description copied from interface:EndOfSentenceScannerReturns a set of character which can indicate the end of a sentence.- Specified by:
getEOSCharactersin interfaceEndOfSentenceScanner- Returns:
- a set of character which can indicate the end of a sentence.
-
-