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
eosCharacterschar[]
DefaultSDContextGenerator(ISet<string>, char[])
Creates a new ISDContextGenerator instance which uses the set of induced abbreviations.
public DefaultSDContextGenerator(ISet<string> inducedAbbreviations, char[] eosCharacters)
Parameters
inducedAbbreviationsISet<string>a ISet<T> of strings representing induced abbreviations in the training data. Example: "Mr."
eosCharacterschar[]
Fields
buf
String buffer for generating features.
protected readonly StringBuilder buf
Field Value
collectFeats
List for holding features as they are generated.
protected readonly IList<string> collectFeats
Field Value
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
prefixstringString preceding the eos character in the eos token.
suffixstringString following the eos character in the eos token.
previousstringSpace delimited token preceding token containing eos character.
nextstringSpace 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
prefixstringString preceding the eos character in the eos token.
suffixstringString following the eos character in the eos token.
previousstringSpace delimited token preceding token containing eos character.
nextstringSpace delimited token following token containing eos character.
eosCharchar?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
sbstringpositionintAn 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.