Class SentenceModel

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

The SentenceModel is the model used by a learnable ISentenceDetector.

public class SentenceModel : BaseModel, IArtifactProvider
Inheritance
SentenceModel
Implements
Inherited Members

Constructors

SentenceModel(FileInfo)

public SentenceModel(FileInfo modelFile)

Parameters

modelFile FileInfo

SentenceModel(Stream)

public SentenceModel(Stream @in)

Parameters

in Stream

SentenceModel(string, IMaxentModel, bool, Dictionary)

public SentenceModel(string languageCode, IMaxentModel sentModel, bool useTokenEnd, Dictionary abbreviations)

Parameters

languageCode string
sentModel IMaxentModel
useTokenEnd bool
abbreviations Dictionary

SentenceModel(string, IMaxentModel, bool, Dictionary, char[])

TODO: was added in 1.5.3 -> remove

public SentenceModel(string languageCode, IMaxentModel sentModel, bool useTokenEnd, Dictionary abbreviations, char[] eosCharacters)

Parameters

languageCode string
sentModel IMaxentModel
useTokenEnd bool
abbreviations Dictionary
eosCharacters char[]

Remarks

Deprecated: Use SentenceModel instead and pass in a SentenceDetectorFactory

SentenceModel(string, IMaxentModel, bool, Dictionary, char[]?, IDictionary<string, string>?)

TODO: was added in 1.5.3 -> remove

public SentenceModel(string languageCode, IMaxentModel sentModel, bool useTokenEnd, Dictionary abbreviations, char[]? eosCharacters, IDictionary<string, string>? manifestInfoEntries)

Parameters

languageCode string
sentModel IMaxentModel
useTokenEnd bool
abbreviations Dictionary
eosCharacters char[]
manifestInfoEntries IDictionary<string, string>

Remarks

Deprecated: Use SentenceModel instead and pass in a SentenceDetectorFactory

SentenceModel(string, IMaxentModel, bool, Dictionary, IDictionary<string, string>)

public SentenceModel(string languageCode, IMaxentModel sentModel, bool useTokenEnd, Dictionary abbreviations, IDictionary<string, string> manifestInfoEntries)

Parameters

languageCode string
sentModel IMaxentModel
useTokenEnd bool
abbreviations Dictionary
manifestInfoEntries IDictionary<string, string>

SentenceModel(string, IMaxentModel, IDictionary<string, string>?, SentenceDetectorFactory)

public SentenceModel(string languageCode, IMaxentModel sentModel, IDictionary<string, string>? manifestInfoEntries, SentenceDetectorFactory sdFactory)

Parameters

languageCode string
sentModel IMaxentModel
manifestInfoEntries IDictionary<string, string>
sdFactory SentenceDetectorFactory

Properties

Abbreviations

public virtual Dictionary? Abbreviations { get; }

Property Value

Dictionary

DefaultFactory

Sub-classes should override this method if their module has a default BaseToolFactory sub-class.

protected override Type DefaultFactory { get; }

Property Value

Type

the default BaseToolFactory for the module, or null if none.

EosCharacters

public virtual char[]? EosCharacters { get; }

Property Value

char[]

Factory

public virtual SentenceDetectorFactory? Factory { get; }

Property Value

SentenceDetectorFactory

MaxentModel

public virtual IMaxentModel MaxentModel { get; }

Property Value

IMaxentModel

Methods

UseTokenEnd()

public virtual bool UseTokenEnd()

Returns

bool

ValidateArtifactMap()

Validates the parsed artifacts. If something is not valid subclasses should throw an InvalidFormatException.

Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.

protected override void ValidateArtifactMap()

Exceptions

InvalidFormatException

See Also