opennlp.tools.sentdetect
Class DefaultEndOfSentenceScanner

java.lang.Object
  extended by opennlp.tools.sentdetect.DefaultEndOfSentenceScanner
All Implemented Interfaces:
EndOfSentenceScanner

public class DefaultEndOfSentenceScanner
extends Object
implements EndOfSentenceScanner

Default implementation of the EndOfSentenceScanner. It uses an character array with possible end of sentence chars to identify potential sentence endings.


Constructor Summary
DefaultEndOfSentenceScanner(char[] eosCharacters)
          Initializes the current instance.
 
Method Summary
 char[] getEndOfSentenceCharacters()
          Returns an array 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEndOfSentenceScanner

public DefaultEndOfSentenceScanner(char[] eosCharacters)
Initializes the current instance.

Parameters:
eosCharacters -
Method Detail

getPositions

public List<Integer> getPositions(String s)
Description copied from interface: EndOfSentenceScanner
The receiver scans the specified string for sentence ending characters and returns their offsets.

Specified by:
getPositions in interface EndOfSentenceScanner
Parameters:
s - a String value
Returns:
a List of Integer objects.

getPositions

public List<Integer> getPositions(StringBuffer buf)
Description copied from interface: EndOfSentenceScanner
The receiver scans `buf' for sentence ending characters and returns their offsets.

Specified by:
getPositions in interface EndOfSentenceScanner
Parameters:
buf - a StringBuffer value
Returns:
a List of Integer objects.

getPositions

public List<Integer> getPositions(char[] cbuf)
Description copied from interface: EndOfSentenceScanner
The receiver scans `cbuf' for sentence ending characters and returns their offsets.

Specified by:
getPositions in interface EndOfSentenceScanner
Parameters:
cbuf - a char[] value
Returns:
a List of Integer objects.

getEndOfSentenceCharacters

public char[] getEndOfSentenceCharacters()
Description copied from interface: EndOfSentenceScanner
Returns an array of character which can indicate the end of a sentence.

Specified by:
getEndOfSentenceCharacters in interface EndOfSentenceScanner
Returns:
an array of character which can indicate the end of a sentence.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.