opennlp.tools.parser
Class AbstractParserEventStream
java.lang.Object
opennlp.model.AbstractEventStream
opennlp.tools.util.AbstractEventStream<Parse>
opennlp.tools.parser.AbstractParserEventStream
- All Implemented Interfaces:
- opennlp.model.EventStream
- Direct Known Subclasses:
- ParserEventStream, ParserEventStream
public abstract class AbstractParserEventStream
- extends AbstractEventStream<Parse>
Abstract class extended by parser event streams which perform tagging and chunking.
- Author:
- Tom Morton
Method Summary |
protected abstract void |
addParseEvents(List<opennlp.model.Event> newEvents,
Parse[] chunks)
Produces all events for the specified sentence chunks
and adds them to the specified list. |
protected Iterator<opennlp.model.Event> |
createEvents(Parse sample)
Creates events for the provided sample. |
static Parse[] |
getInitialChunks(Parse p)
|
protected void |
init()
|
protected boolean |
lastChild(Parse child,
Parse parent)
Returns true if the specified child is the last child of the specified parent. |
Methods inherited from class opennlp.model.AbstractEventStream |
remove |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
rules
protected HeadRules rules
punctSet
protected Set<String> 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(ObjectStream<Parse> d,
HeadRules rules,
ParserEventTypeEnum etype,
Dictionary dict)
AbstractParserEventStream
public AbstractParserEventStream(ObjectStream<Parse> d,
HeadRules rules,
ParserEventTypeEnum etype)
createEvents
protected Iterator<opennlp.model.Event> createEvents(Parse sample)
- Description copied from class:
AbstractEventStream
- Creates events for the provided sample.
- Specified by:
createEvents
in class AbstractEventStream<Parse>
- Parameters:
sample
- the sample for which training Event
s
are be created.
- Returns:
- an
Iterator
of training events or
an empty Iterator
.
init
protected void init()
getInitialChunks
public static Parse[] getInitialChunks(Parse p)
addParseEvents
protected abstract void addParseEvents(List<opennlp.model.Event> 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 © 2010. All Rights Reserved.