Class ChunkContextGenerator

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

Creates predivtive context for the pre-chunking phases of parsing.

public class ChunkContextGenerator : IChunkerContextGenerator, IBeamSearchContextGenerator<TokenTag>
Inheritance
ChunkContextGenerator
Implements
Inherited Members

Constructors

ChunkContextGenerator(int)

public ChunkContextGenerator(int cacheSize = 0)

Parameters

cacheSize int

Methods

GetContext(int, TokenTag[], string[], object[])

Returns the context for the specified position in the specified sequence (list).

public virtual string[] GetContext(int index, TokenTag[] sequence, string[] priorDecisions, object[] additionalContext)

Parameters

index int

The index of the sequence.

sequence TokenTag[]

The sequence of items over which the beam search is performed.

priorDecisions string[]

The sequence of decisions made prior to the context for which this decision is being made.

additionalContext object[]

Any addition context specific to a class implementing this interface.

Returns

string[]

the context for the specified position in the specified sequence.

GetContext(int, string[], string[], string[])

Returns the contexts for chunking of the specified index.

public virtual string[] GetContext(int i, string[] words, string[] tags, string[] preds)

Parameters

i int

The index of the token in the specified toks array for which the context should be constructed.

words string[]
tags string[]

The POS tags for the specified tokens.

preds string[]

The previous decisions made in the taging of this sequence. Only indices less than i will be examined.

Returns

string[]

An array of predictive contexts on which a model basis its decisions.