LBJ2.nlp.seg
Class PlainToTokenParser

java.lang.Object
  extended by LBJ2.nlp.seg.PlainToTokenParser
All Implemented Interfaces:
Parser

public class PlainToTokenParser
extends java.lang.Object
implements Parser

This parser takes the Words in the representation created by another Parser and creates a new representation consisting of Tokens. The input parser is actually expected to return a LinkedVector populated by Words with each call to Parser.next(). The Tokens returned by calls to this class's next() method are also contained in LinkedVectors representing sentences which are accessible via the LinkedChild.parent field.


Field Summary
protected  Token next
          The next token to return.
protected  Parser parser
          A parser creating a representation consisting of Words.
 
Constructor Summary
PlainToTokenParser(Parser p)
          The only constructor.
 
Method Summary
 java.lang.Object next()
          This method returns Tokens until the input is exhausted, at which point it returns null.
 void reset()
          Sets this parser back to the beginning of the raw data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parser

protected Parser parser
A parser creating a representation consisting of Words.


next

protected Token next
The next token to return.

Constructor Detail

PlainToTokenParser

public PlainToTokenParser(Parser p)
The only constructor.

Parameters:
p - A parser creating a representation consisting of Words.
Method Detail

next

public java.lang.Object next()
This method returns Tokens until the input is exhausted, at which point it returns null.

Specified by:
next in interface Parser
Returns:
The next object parsed from the input data.

reset

public void reset()
Sets this parser back to the beginning of the raw data.

Specified by:
reset in interface Parser