Class ParserModel
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
modelFileFileInfo
ParserModel(Stream)
public ParserModel(Stream @in)
Parameters
inStream
ParserModel(string)
public ParserModel(string modelPath)
Parameters
modelPathstring
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
languageCodestringbuildModelIMaxentModelcheckModelIMaxentModelattachModelIMaxentModelparserTaggerPOSModelchunkerTaggerChunkerModelheadRulesIHeadRulesmodelTypeParserType
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
languageCodestringbuildModelIMaxentModelcheckModelIMaxentModelattachModelIMaxentModelparserTaggerPOSModelchunkerTaggerChunkerModelheadRulesIHeadRulesmodelTypeParserTypemanifestInfoEntriesDictionary<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
languageCodestringbuildModelIMaxentModelcheckModelIMaxentModelparserTaggerPOSModelchunkerTaggerChunkerModelheadRulesIHeadRulestypeParserTypemanifestInfoEntriesDictionary<string, string>
Properties
AttachModel
public virtual IMaxentModel? AttachModel { get; }
Property Value
BuildModel
public virtual IMaxentModel? BuildModel { get; }
Property Value
CheckModel
public virtual IMaxentModel? CheckModel { get; }
Property Value
HeadRules
public virtual IHeadRules? HeadRules { get; }
Property Value
ParserChunkerModel
public virtual ChunkerModel? ParserChunkerModel { get; }
Property Value
ParserTaggerModel
public virtual POSModel? ParserTaggerModel { get; }
Property Value
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
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
serializersIDictionary<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
buildModelIMaxentModel
Returns
UpdateCheckModel(IMaxentModel)
public virtual ParserModel UpdateCheckModel(IMaxentModel checkModel)
Parameters
checkModelIMaxentModel
Returns
UpdateChunkerModel(ChunkerModel)
public virtual ParserModel UpdateChunkerModel(ChunkerModel chunkModel)
Parameters
chunkModelChunkerModel
Returns
UpdateTaggerModel(POSModel)
public virtual ParserModel UpdateTaggerModel(POSModel taggerModel)
Parameters
taggerModelPOSModel
Returns
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()