Class DefaultSDContextGenerator

Namespace
NOpenNLP.Tools.Sentdetect
Assembly
NOpenNLP.Tools.dll

Generate event contexts for maxent decisions for sentence detection.

public class DefaultSDContextGenerator : ISDContextGenerator
Inheritance
DefaultSDContextGenerator
Implements
Derived
Inherited Members

Constructors

DefaultSDContextGenerator(char[])

Creates a new ISDContextGenerator instance with no induced abbreviations.

public DefaultSDContextGenerator(char[] eosCharacters)

Parameters

eosCharacters char[]

DefaultSDContextGenerator(ISet<string>, char[])

Creates a new ISDContextGenerator instance which uses the set of induced abbreviations.

public DefaultSDContextGenerator(ISet<string> inducedAbbreviations, char[] eosCharacters)

Parameters

inducedAbbreviations ISet<string>

a ISet<T> of strings representing induced abbreviations in the training data. Example: "Mr."

eosCharacters char[]

Fields

buf

String buffer for generating features.

protected readonly StringBuilder buf

Field Value

StringBuilder

collectFeats

List for holding features as they are generated.

protected readonly IList<string> collectFeats

Field Value

IList<string>

Methods

CollectFeatures(string, string, string, string)

Determines some of the features for the sentence detector and adds them to list features.

protected virtual void CollectFeatures(string prefix, string suffix, string previous, string next)

Parameters

prefix string

String preceding the eos character in the eos token.

suffix string

String following the eos character in the eos token.

previous string

Space delimited token preceding token containing eos character.

next string

Space delimited token following token containing eos character.

Remarks

Deprecated: Use CollectFeatures instead.

CollectFeatures(string, string, string, string, char?)

Determines some of the features for the sentence detector and adds them to list features.

protected virtual void CollectFeatures(string prefix, string suffix, string previous, string next, char? eosChar)

Parameters

prefix string

String preceding the eos character in the eos token.

suffix string

String following the eos character in the eos token.

previous string

Space delimited token preceding token containing eos character.

next string

Space delimited token following token containing eos character.

eosChar char?

the EOS character been analyzed

GetContext(string, int)

Returns an array of contextual features for the potential sentence boundary at the specified position within the specified string buffer.

public virtual string[] GetContext(string sb, int position)

Parameters

sb string
position int

An index into the specified string buffer when a sentence boundary may occur.

Returns

string[]

an array of contextual features for the potential sentence boundary at the specified position within the specified string buffer.