Class ParserModel

Namespace
NOpenNLP.Tools.Parser
Assembly
NOpenNLP.Tools.dll

This is an abstract base class for ParserModel implementations.

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

Constructors

ParserModel(FileInfo)

public ParserModel(FileInfo modelFile)

Parameters

modelFile FileInfo

ParserModel(Stream)

public ParserModel(Stream @in)

Parameters

in Stream

ParserModel(string)

public ParserModel(string modelPath)

Parameters

modelPath string

ParserModel(string, IMaxentModel, IMaxentModel, IMaxentModel?, POSModel, ChunkerModel, IHeadRules, ParserType)

public ParserModel(string languageCode, IMaxentModel buildModel, IMaxentModel checkModel, IMaxentModel? attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, IHeadRules headRules, ParserType modelType)

Parameters

languageCode string
buildModel IMaxentModel
checkModel IMaxentModel
attachModel IMaxentModel
parserTagger POSModel
chunkerTagger ChunkerModel
headRules IHeadRules
modelType ParserType

ParserModel(string, IMaxentModel, IMaxentModel, IMaxentModel?, POSModel, ChunkerModel, IHeadRules, ParserType, Dictionary<string, string>)

public ParserModel(string languageCode, IMaxentModel buildModel, IMaxentModel checkModel, IMaxentModel? attachModel, POSModel parserTagger, ChunkerModel chunkerTagger, IHeadRules headRules, ParserType modelType, Dictionary<string, string> manifestInfoEntries)

Parameters

languageCode string
buildModel IMaxentModel
checkModel IMaxentModel
attachModel IMaxentModel
parserTagger POSModel
chunkerTagger ChunkerModel
headRules IHeadRules
modelType ParserType
manifestInfoEntries Dictionary<string, string>

ParserModel(string, IMaxentModel, IMaxentModel, POSModel, ChunkerModel, IHeadRules, ParserType, Dictionary<string, string>)

public ParserModel(string languageCode, IMaxentModel buildModel, IMaxentModel checkModel, POSModel parserTagger, ChunkerModel chunkerTagger, IHeadRules headRules, ParserType type, Dictionary<string, string> manifestInfoEntries)

Parameters

languageCode string
buildModel IMaxentModel
checkModel IMaxentModel
parserTagger POSModel
chunkerTagger ChunkerModel
headRules IHeadRules
type ParserType
manifestInfoEntries Dictionary<string, string>

Properties

AttachModel

public virtual IMaxentModel? AttachModel { get; }

Property Value

IMaxentModel

BuildModel

public virtual IMaxentModel? BuildModel { get; }

Property Value

IMaxentModel

CheckModel

public virtual IMaxentModel? CheckModel { get; }

Property Value

IMaxentModel

HeadRules

public virtual IHeadRules? HeadRules { get; }

Property Value

IHeadRules

ParserChunkerModel

public virtual ChunkerModel? ParserChunkerModel { get; }

Property Value

ChunkerModel

ParserTaggerModel

public virtual POSModel? ParserTaggerModel { get; }

Property Value

POSModel

ParserTypeValue

Retrieves the ParserType this model was trained for, or null if the manifest declares no known type.

public virtual ParserType? ParserTypeValue { get; }

Property Value

ParserType?

Remarks

NOpenNLP: this was getParserType() in Java.

Methods

CreateArtifactSerializers(IDictionary<string, IArtifactSerializer>)

Registers all IArtifactSerializer for their artifact file name extensions. The registered IArtifactSerializer are used to create and serialize resources in the model package.

Override this method to register custom IArtifactSerializers.

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

This method is called during construction.

public override void CreateArtifactSerializers(IDictionary<string, IArtifactSerializer> serializers)

Parameters

serializers IDictionary<string, IArtifactSerializer>

the key of the map is the file extension used to lookup the IArtifactSerializer.

UpdateBuildModel(IMaxentModel)

public virtual ParserModel UpdateBuildModel(IMaxentModel buildModel)

Parameters

buildModel IMaxentModel

Returns

ParserModel

UpdateCheckModel(IMaxentModel)

public virtual ParserModel UpdateCheckModel(IMaxentModel checkModel)

Parameters

checkModel IMaxentModel

Returns

ParserModel

UpdateChunkerModel(ChunkerModel)

public virtual ParserModel UpdateChunkerModel(ChunkerModel chunkModel)

Parameters

chunkModel ChunkerModel

Returns

ParserModel

UpdateTaggerModel(POSModel)

public virtual ParserModel UpdateTaggerModel(POSModel taggerModel)

Parameters

taggerModel POSModel

Returns

ParserModel

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