Class ParserEventStream
java.lang.Object
opennlp.tools.util.AbstractEventStream<Parse>
opennlp.tools.parser.AbstractParserEventStream
opennlp.tools.parser.chunking.ParserEventStream
- All Implemented Interfaces:
AutoCloseable, ObjectStream<Event>
Wrapper class for one of four
shift-reduce parser event streams.
The particular event type is specified at construction.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BuildContextGeneratorprotected CheckContextGeneratorprivate static final org.slf4j.LoggerFields inherited from class AbstractParserEventStream
dict, etype, fixPossesives, punctSet, rules -
Constructor Summary
ConstructorsConstructorDescriptionParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype) ParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype, Dictionary dict) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddParseEvents(List<Event> parseEvents, Parse[] chunks) Addseventsfor parsing (post tagging and chunking) to the specified list of events for the specified parse chunks.protected booleanfirstChild(Parse child, Parse parent) protected voidinit()static Parse[]reduceChunks(Parse[] chunks, int ci, Parse parent) Methods inherited from class AbstractParserEventStream
createEvents, getInitialChunks, lastChildMethods inherited from class AbstractEventStream
close, read, reset
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
bcg
-
kcg
-
-
Constructor Details
-
ParserEventStream
public ParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype, Dictionary dict) - Parameters:
d- A 1-parse-per-line Penn Treebank Style parse.rules- Thehead rulesto use.etype- Thetypeof events desired.dict- A tri-gramDictionaryto reduce feature generation.- See Also:
-
ParserEventStream
- Parameters:
d- A 1-parse-per-line Penn Treebank Style parse.rules- Thehead rulesto use.etype- Thetypeof events desired.- See Also:
-
-
Method Details
-
init
protected void init()- Overrides:
initin classAbstractParserEventStream
-
firstChild
-
reduceChunks
-
addParseEvents
Addseventsfor parsing (post tagging and chunking) to the specified list of events for the specified parse chunks.- Specified by:
addParseEventsin classAbstractParserEventStream- Parameters:
parseEvents- Theeventsfor the specified chunks.chunks- The incompleteparsesto be parsed.
-