Class ParserEventStream
java.lang.Object
opennlp.tools.util.AbstractEventStream<Parse>
opennlp.tools.parser.AbstractParserEventStream
opennlp.tools.parser.treeinsert.ParserEventStream
- All Implemented Interfaces:
AutoCloseable, ObjectStream<Event>
Wrapper class for one of four
built-attach parser event streams.
The particular event type is specified at construction.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AttachContextGeneratorprotected 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) Produces all events for the specified sentencechunksand adds them to the specifiednewEventslist.getNonAdjoinedParent(Parse node) Returns a map of parent nodes which consist of the immediate parent of the specifiednodeand any of its parent which share the same syntactic type.private intvoidinit()protected booleanprivate intnonPunctChildCount(Parse node) Methods inherited from class AbstractParserEventStream
createEvents, getInitialChunksMethods inherited from class AbstractEventStream
close, read, reset
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
attachContextGenerator
-
buildContextGenerator
-
checkContextGenerator
-
-
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
public void init()- Overrides:
initin classAbstractParserEventStream
-
getNonAdjoinedParent
Returns a map of parent nodes which consist of the immediate parent of the specifiednodeand any of its parent which share the same syntactic type. -
indexOf
-
nonPunctChildCount
-
lastChild
Description copied from class:AbstractParserEventStream- Overrides:
lastChildin classAbstractParserEventStream- Parameters:
child- The childParse.parent- The parentParse.- Returns:
trueif the specified child is the last child of the specified parent,falseotherwise.
-
addParseEvents
Description copied from class:AbstractParserEventStreamProduces all events for the specified sentencechunksand adds them to the specifiednewEventslist.- Specified by:
addParseEventsin classAbstractParserEventStream- Parameters:
parseEvents- A list ofeventsto be added to.chunks- Pre-chunkedconstituentsof a sentence.
-