public class POSTaggerFactory extends BaseToolFactory
Modifier and Type | Field and Description |
---|---|
protected Dictionary |
ngramDictionary |
protected TagDictionary |
posDictionary |
artifactProvider
Constructor and Description |
---|
POSTaggerFactory()
Creates a
POSTaggerFactory that provides the default implementation
of the resources. |
POSTaggerFactory(Dictionary ngramDictionary,
TagDictionary posDictionary)
Creates a
POSTaggerFactory . |
create, create, createManifestEntries, init
protected Dictionary ngramDictionary
protected TagDictionary posDictionary
public POSTaggerFactory()
POSTaggerFactory
that provides the default implementation
of the resources.public POSTaggerFactory(Dictionary ngramDictionary, TagDictionary posDictionary)
POSTaggerFactory
. Use this constructor to
programmatically create a factory.ngramDictionary
- posDictionary
- protected void init(Dictionary ngramDictionary, TagDictionary posDictionary)
public Map<String,ArtifactSerializer> createArtifactSerializersMap()
BaseToolFactory
Map
with pairs of keys and ArtifactSerializer
.
The models implementation should call this method from
BaseModel#createArtifactSerializersMap
The base implementation will return a HashMap
that should be
populated by sub-classes.
createArtifactSerializersMap
in class BaseToolFactory
public Map<String,Object> createArtifactMap()
BaseToolFactory
Map
with pairs of keys and objects. The models
implementation should call this constructor that creates a model
programmatically.
The base implementation will return a HashMap
that should be
populated by sub-classes.
createArtifactMap
in class BaseToolFactory
public TagDictionary createTagDictionary(File dictionary) throws InvalidFormatException, FileNotFoundException, IOException
public TagDictionary createTagDictionary(InputStream in) throws InvalidFormatException, IOException
InvalidFormatException
IOException
public void setTagDictionary(TagDictionary dictionary)
public TagDictionary getTagDictionary()
public Dictionary getDictionary()
public void setDictionary(Dictionary ngramDict)
public POSContextGenerator getPOSContextGenerator()
public POSContextGenerator getPOSContextGenerator(int cacheSize)
public SequenceValidator<String> getSequenceValidator()
protected void validatePOSDictionary(POSDictionary posDict, AbstractModel posModel) throws InvalidFormatException
InvalidFormatException
public void validateArtifactMap() throws InvalidFormatException
BaseToolFactory
InvalidFormatException
.
Note:
Subclasses should generally invoke super.validateArtifactMap at the beginning
of this method.validateArtifactMap
in class BaseToolFactory
InvalidFormatException
public static POSTaggerFactory create(String subclassName, Dictionary ngramDictionary, TagDictionary posDictionary) throws InvalidFormatException
InvalidFormatException
public TagDictionary createEmptyTagDictionary()
Copyright © 2019 The Apache Software Foundation. All rights reserved.