opennlp.maxent
Class PlainTextByLineDataStream

java.lang.Object
  extended by opennlp.maxent.PlainTextByLineDataStream
All Implemented Interfaces:
DataStream

public class PlainTextByLineDataStream
extends Object
implements DataStream

This DataStream implementation will take care of reading a plain text file and returning the Strings between each new line character, which is what many Maxent applications need in order to create EventStreams.


Constructor Summary
PlainTextByLineDataStream(Reader dataSource)
           
 
Method Summary
 boolean hasNext()
          Test whether there are any Events remaining in this EventStream.
 Object nextToken()
          Returns the next slice of data held in this DataStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlainTextByLineDataStream

public PlainTextByLineDataStream(Reader dataSource)
Method Detail

nextToken

public Object nextToken()
Description copied from interface: DataStream
Returns the next slice of data held in this DataStream.

Specified by:
nextToken in interface DataStream
Returns:
the Object representing the data which is next in this DataStream

hasNext

public boolean hasNext()
Description copied from interface: DataStream
Test whether there are any Events remaining in this EventStream.

Specified by:
hasNext in interface DataStream
Returns:
true if this DataStream has more data tokens


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