edu.stanford.nlp.process.Tokenizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stanford-parser Show documentation
Show all versions of stanford-parser Show documentation
Stanford Parser processes raw text in English, Chinese, German, Arabic, and French, and extracts constituency parse trees.
The newest version!
package edu.stanford.nlp.process;
import java.util.Iterator;
import java.util.List;
/**
* Tokenizers break up text into individual Objects. These objects may be
* Strings, Words, or other Objects. A Tokenizer extends the Iterator
* interface, but provides a lookahead operation {@code peek()}. An
* implementation of this interface is expected to have a constructor that
* takes a single argument, a Reader.
*
* @author Teg Grenager ([email protected])
*/
public interface Tokenizer extends Iterator {
/* Provides the standard Iterator methods: next(), hasNext().
* remove() will normally not be implemented.
*/
/**
* Returns the next token, without removing it, from the Tokenizer, so
* that the same token will be again returned on the next call to
* next() or peek().
*
* @return the next token in the token stream.
* @throws java.util.NoSuchElementException If the token stream has no more tokens.
*/
T peek();
/**
* Returns all tokens of this Tokenizer as a List for convenience.
*
* @return A list of all the tokens
*/
List tokenize();
}