Class ChunkContextGenerator
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
cacheSizeint
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
indexintThe index of the sequence.
sequenceTokenTag[]The sequence of items over which the beam search is performed.
priorDecisionsstring[]The sequence of decisions made prior to the context for which this decision is being made.
additionalContextobject[]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
iintThe index of the token in the specified toks array for which the context should be constructed.
wordsstring[]tagsstring[]The POS tags for the specified tokens.
predsstring[]The previous decisions made in the taging of this sequence. Only indices less than
iwill be examined.
Returns
- string[]
An array of predictive contexts on which a model basis its decisions.