opennlp.tools.parser
Class AbstractParserEventStream
java.lang.Object
opennlp.tools.parser.AbstractParserEventStream
- All Implemented Interfaces:
- opennlp.maxent.EventStream
- Direct Known Subclasses:
- ParserEventStream
public abstract class AbstractParserEventStream
- extends java.lang.Object
- implements opennlp.maxent.EventStream
Abstract class extended by parser event streams which perform tagging and chunking.
- Author:
- Tom Morton
|
Method Summary |
protected abstract void |
addParseEvents(java.util.List newEvents,
Parse[] chunks)
Produces all events for the specified sentence chunks
and adds them to the specified list. |
static Parse[] |
getInitialChunks(Parse p)
|
boolean |
hasNext()
|
protected void |
init()
|
protected boolean |
lastChild(Parse child,
Parse parent)
Returns true if the specified child is the last child of the specified parent. |
opennlp.maxent.Event |
nextEvent()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rules
protected HeadRules rules
punctSet
protected java.util.Set punctSet
etype
protected ParserEventTypeEnum etype
- The type of events being generated by this event stream.
fixPossesives
protected boolean fixPossesives
dict
protected Dictionary dict
AbstractParserEventStream
public AbstractParserEventStream(opennlp.maxent.DataStream d,
HeadRules rules,
ParserEventTypeEnum etype,
Dictionary dict)
AbstractParserEventStream
public AbstractParserEventStream(opennlp.maxent.DataStream d,
HeadRules rules,
ParserEventTypeEnum etype)
init
protected void init()
nextEvent
public opennlp.maxent.Event nextEvent()
- Specified by:
nextEvent in interface opennlp.maxent.EventStream
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface opennlp.maxent.EventStream
getInitialChunks
public static Parse[] getInitialChunks(Parse p)
addParseEvents
protected abstract void addParseEvents(java.util.List newEvents,
Parse[] chunks)
- Produces all events for the specified sentence chunks
and adds them to the specified list.
- Parameters:
newEvents - A list of events to be added to.chunks - Pre-chunked constituents of a sentence.
lastChild
protected boolean lastChild(Parse child,
Parse parent)
- Returns true if the specified child is the last child of the specified parent.
- Parameters:
child - The child parse.parent - The parent parse.
- Returns:
- true if the specified child is the last child of the specified parent; false otherwise.
Copyright 2008 Jason Baldridge, Gann Bierner, and Thomas Morton. All Rights Reserved.