Class ParserEventStream

Namespace
NOpenNLP.Tools.Parser.Chunking
Assembly
NOpenNLP.Tools.dll

Wrapper class for one of four parser event streams. The particular event stream is specified at construction.

public class ParserEventStream : AbstractParserEventStream, IObjectStream<Event?>, IDisposable
Inheritance
ParserEventStream
Implements
Inherited Members

Constructors

ParserEventStream(IObjectStream<Parse?>, IHeadRules, ParserEventTypeEnum, Dictionary?)

Create an event stream based on the specified data stream of the specified type using the specified head rules.

public ParserEventStream(IObjectStream<Parse?> d, IHeadRules rules, ParserEventTypeEnum etype, Dictionary? dict = null)

Parameters

d IObjectStream<Parse>

A 1-parse-per-line Penn Treebank Style parse.

rules IHeadRules

The head rules.

etype ParserEventTypeEnum

The type of events desired (tag, chunk, build, or check).

dict Dictionary

A tri-gram dictionary to reduce feature generation.

Fields

bcg

protected BuildContextGenerator bcg

Field Value

BuildContextGenerator

kcg

protected CheckContextGenerator kcg

Field Value

CheckContextGenerator

Methods

AddParseEvents(IList<Event>, Parse[])

Adds events for parsing (post tagging and chunking to the specified list of events for the specified parse chunks.

protected override void AddParseEvents(IList<Event> parseEvents, Parse[] chunks)

Parameters

parseEvents IList<Event>

The events for the specified chunks.

chunks Parse[]

The incomplete parses to be parsed.

FirstChild(Parse, Parse)

Returns true if the specified child is the first child of the specified parent.

protected virtual bool FirstChild(Parse child, Parse parent)

Parameters

child Parse

The child parse.

parent Parse

The parent parse.

Returns

bool

true if the specified child is the first child of the specified parent; false otherwise.

Init()

protected override void Init()

ReduceChunks(Parse[], int, Parse)

public static Parse[] ReduceChunks(Parse[] chunks, int ci, Parse parent)

Parameters

chunks Parse[]
ci int
parent Parse

Returns

Parse[]