opennlp.tools.tokenize
Class TokSpanEventStream

java.lang.Object
  extended by opennlp.tools.tokenize.TokSpanEventStream
All Implemented Interfaces:
opennlp.maxent.EventStream

public class TokSpanEventStream
extends java.lang.Object
implements opennlp.maxent.EventStream

An implementation of EventStream which allows events to be added by offset and returns events for these offset-based tokens.


Constructor Summary
TokSpanEventStream(boolean skipAlphaNumerics)
          Initializes the current instance.
TokSpanEventStream(boolean skipAlphaNumerics, TokenContextGenerator cg)
          Initializes the current instance.
 
Method Summary
 void addEvents(Span[] tokens, java.lang.String text)
          Adds training events to the event stream for each of the specified tokens.
 boolean hasNext()
           
 opennlp.maxent.Event nextEvent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokSpanEventStream

public TokSpanEventStream(boolean skipAlphaNumerics,
                          TokenContextGenerator cg)
Initializes the current instance.

Parameters:
skipAlphaNumerics -
cg -

TokSpanEventStream

public TokSpanEventStream(boolean skipAlphaNumerics)
Initializes the current instance.

Parameters:
skipAlphaNumerics -
Method Detail

addEvents

public void addEvents(Span[] tokens,
                      java.lang.String text)
Adds training events to the event stream for each of the specified tokens.

Parameters:
tokens - charachter offsets into the specified text.
text - The text of the tokens.

hasNext

public boolean hasNext()
Specified by:
hasNext in interface opennlp.maxent.EventStream

nextEvent

public opennlp.maxent.Event nextEvent()
Specified by:
nextEvent in interface opennlp.maxent.EventStream


Copyright 2008 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.