Class BaseToolFactory

Namespace
NOpenNLP.Tools.Util
Assembly
NOpenNLP.Tools.dll

Base class for all tool factories.

Extensions of this class should:

public abstract class BaseToolFactory
Inheritance
BaseToolFactory
Derived
Inherited Members

Constructors

BaseToolFactory()

All sub-classes should have an empty constructor

protected BaseToolFactory()

Fields

artifactProvider

protected IArtifactProvider? artifactProvider

Field Value

IArtifactProvider

Methods

Create(string, IArtifactProvider)

public static BaseToolFactory? Create(string subclassName, IArtifactProvider artifactProvider)

Parameters

subclassName string
artifactProvider IArtifactProvider

Returns

BaseToolFactory

Create(Type?, IArtifactProvider)

public static BaseToolFactory? Create(Type? factoryClass, IArtifactProvider artifactProvider)

Parameters

factoryClass Type
artifactProvider IArtifactProvider

Returns

BaseToolFactory

CreateArtifactMap()

Creates an IDictionary<TKey, TValue> with pairs of keys and objects. The models implementation should call this constructor that creates a model programmatically.

The base implementation will return a Dictionary<TKey, TValue> that should be populated by sub-classes.

public virtual IDictionary<string, object> CreateArtifactMap()

Returns

IDictionary<string, object>

CreateArtifactSerializersMap()

Creates an IDictionary<TKey, TValue> with pairs of keys and IArtifactSerializer. The models implementation should call this method from BaseModel.CreateArtifactSerializersMap

The base implementation will return a Dictionary<TKey, TValue> that should be populated by sub-classes.

public virtual IDictionary<string, IArtifactSerializer> CreateArtifactSerializersMap()

Returns

IDictionary<string, IArtifactSerializer>

CreateManifestEntries()

Creates the manifest entries that will be added to the model manifest

public virtual IDictionary<string, string> CreateManifestEntries()

Returns

IDictionary<string, string>

the manifest entries to added to the model manifest

Init(IArtifactProvider)

Initializes the ToolFactory with an artifact provider.

protected virtual void Init(IArtifactProvider artifactProvider)

Parameters

artifactProvider IArtifactProvider

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.

public abstract void ValidateArtifactMap()

Exceptions

InvalidFormatException