public class LineWordReader extends java.lang.Object implements WordReader, java.io.Serializable
WordReaderthat considers each line of a document a single word.
The intended usage of this class is that of indexing stuff like lists of document
identifiers: if the identifiers contain nonalphabetical characters, the default
FastBufferedReader might do a poor job.
Note that the non-word returned by
next(MutableString, MutableString) is
|Modifier and Type||Method||Description|
Returns a copy of this word reader.
Extracts the next word and non-word.
Resets the internal state of this word reader, which will start again reading from the given reader.
public boolean next(MutableString word, MutableString nonWord) throws java.io.IOException
If this method returns true, a new non-empty word, and possibly
a new non-word, have been extracted. It is acceptable
that the first call to this method after creation
or after a call to
WordReader.setReader(Reader) returns an empty
word. In other words both
nonWord are maximal.
word- the next word returned by the underlying reader.
nonWord- the nonword following the next word returned by the underlying reader.
public LineWordReader setReader(java.io.Reader reader)