Class DefaultPOSContextGenerator

Namespace
NOpenNLP.Tools.Postag
Assembly
NOpenNLP.Tools.dll

A context generator for the POS Tagger.

public class DefaultPOSContextGenerator : IPOSContextGenerator, IBeamSearchContextGenerator<string>
Inheritance
DefaultPOSContextGenerator
Implements
Inherited Members

Constructors

DefaultPOSContextGenerator(Dictionary?)

Initializes the current instance.

public DefaultPOSContextGenerator(Dictionary? dict)

Parameters

dict Dictionary

DefaultPOSContextGenerator(int, Dictionary?)

Initializes the current instance.

public DefaultPOSContextGenerator(int cacheSize, Dictionary? dict)

Parameters

cacheSize int
dict Dictionary

Fields

SB

protected const string SB = "*SB*"

Field Value

string

SE

protected const string SE = "*SE*"

Field Value

string

Methods

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

Returns the context for making a pos tag decision at the specified token index given the specified tokens and previous tags.

public virtual string[] GetContext(int index, object[] tokens, string[] tags)

Parameters

index int

The index of the token for which the context is provided.

tokens object[]

The tokens in the sentence.

tags string[]

The tags assigned to the previous words in the sentence.

Returns

string[]

The context for making a pos tag decision at the specified token index given the specified tokens and previous tags.

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

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

Parameters

index int
sequence string[]
priorDecisions string[]
additionalContext object[]

Returns

string[]

GetPrefixes(string)

protected static string[] GetPrefixes(string lex)

Parameters

lex string

Returns

string[]

GetSuffixes(string)

protected static string[] GetSuffixes(string lex)

Parameters

lex string

Returns

string[]