Class AbstractParserEventStream
- All Implemented Interfaces:
AutoCloseable, ObjectStream<Event>
- Direct Known Subclasses:
ParserEventStream, ParserEventStream
Abstract class extended by parser event streams which perform tagging and chunking.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChunkerContextGeneratorprotected final Dictionaryprotected final ParserEventTypeEnumThe type of events being generated by this event stream.protected booleanprotected final HeadRulesprivate POSContextGenerator -
Constructor Summary
ConstructorsConstructorDescriptionAbstractParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype) AbstractParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype, Dictionary dict) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddChunkEvents(List<Event> chunkEvents, Parse[] chunks) protected abstract voidaddParseEvents(List<Event> newEvents, Parse[] chunks) Produces all events for the specified sentencechunksand adds them to the specifiednewEventslist.private voidaddTagEvents(List<Event> tagEvents, Parse[] chunks) createEvents(Parse sample) Creates events for the providedsample.static Parse[]private static voidgetInitialChunks(Parse p, List<Parse> ichunks) protected voidinit()protected booleanMethods inherited from class AbstractEventStream
close, read, reset
-
Field Details
-
chunkerContextGenerator
-
tagContextGenerator
-
rules
-
punctSet
-
etype
The type of events being generated by this event stream. -
fixPossesives
protected boolean fixPossesives -
dict
-
-
Constructor Details
-
AbstractParserEventStream
public AbstractParserEventStream(ObjectStream<Parse> d, HeadRules rules, ParserEventTypeEnum etype, Dictionary dict) -
AbstractParserEventStream
-
-
Method Details
-
createEvents
Description copied from class:AbstractEventStreamCreates events for the providedsample.- Specified by:
createEventsin classAbstractEventStream<Parse>- Parameters:
sample- Thesamplefor which trainingeventsare created.- Returns:
- An
Iteratorof training events or an emptyIterator.
-
init
protected void init() -
getInitialChunks
-
getInitialChunks
-
addParseEvents
Produces all events for the specified sentencechunksand adds them to the specifiednewEventslist.- Parameters:
newEvents- A list ofeventsto be added to.chunks- Pre-chunkedconstituentsof a sentence.
-
addChunkEvents
-
addTagEvents
-
lastChild
-