Package opennlp.tools.postag
Class POSTaggerFactory
java.lang.Object
opennlp.tools.util.BaseToolFactory
opennlp.tools.postag.POSTaggerFactory
The factory that provides POS Tagger default implementations and resources
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCreates aPOSTaggerFactorythat provides the default implementation of the resources.POSTaggerFactory(byte[] featureGeneratorBytes, Map<String, Object> resources, TagDictionary posDictionary) POSTaggerFactory(Dictionary ngramDictionary, TagDictionary posDictionary) Deprecated.this constructor is here for backward compatibility and is not functional anymore in the training of 1.8.x series models -
Method Summary
Modifier and TypeMethodDescriptionstatic POSTaggerFactorycreate(String subclassName, byte[] featureGeneratorBytes, Map<String, Object> resources, TagDictionary posDictionary) static POSTaggerFactorycreate(String subclassName, Dictionary ngramDictionary, TagDictionary posDictionary) Deprecated.Creates aMapwith pairs of keys and objects.Creates aMapwith pairs of keys andArtifactSerializer.Creates theAdaptiveFeatureGenerator.createTagDictionary(File dictionary) Deprecated.this will be reduced in visibility and later removedgetPOSContextGenerator(int cacheSize) voidsetDictionary(Dictionary ngramDict) Deprecated.voidsetTagDictionary(TagDictionary dictionary) voidValidates the parsed artifacts.Methods inherited from class opennlp.tools.util.BaseToolFactory
create, create, createManifestEntries
-
Constructor Details
-
POSTaggerFactory
public POSTaggerFactory()Creates aPOSTaggerFactorythat provides the default implementation of the resources. -
POSTaggerFactory
Deprecated.this constructor is here for backward compatibility and is not functional anymore in the training of 1.8.x series modelsCreates aPOSTaggerFactory. Use this constructor to programmatically create a factory.- Parameters:
ngramDictionary-posDictionary-
-
POSTaggerFactory
public POSTaggerFactory(byte[] featureGeneratorBytes, Map<String, Object> resources, TagDictionary posDictionary)
-
-
Method Details
-
createFeatureGenerators
Creates theAdaptiveFeatureGenerator. Usually this is a set of generators contained in theAggregatedFeatureGenerator. Note: The generators are created on every call to this method.- Returns:
- the feature generator or null if there is no descriptor in the model
-
createArtifactSerializersMap
Description copied from class:BaseToolFactoryCreates aMapwith pairs of keys andArtifactSerializer. The models implementation should call this method fromBaseModel#createArtifactSerializersMapThe base implementation will return a
HashMapthat should be populated by sub-classes.- Overrides:
createArtifactSerializersMapin classBaseToolFactory
-
createArtifactMap
Description copied from class:BaseToolFactoryCreates aMapwith pairs of keys and objects. The models implementation should call this constructor that creates a model programmatically.The base implementation will return a
HashMapthat should be populated by sub-classes.- Overrides:
createArtifactMapin classBaseToolFactory
-
createTagDictionary
- Throws:
IOException
-
createTagDictionary
- Throws:
IOException
-
setTagDictionary
-
getTagDictionary
-
getDictionary
Deprecated.this will be reduced in visibility and later removed -
setDictionary
Deprecated. -
getPOSContextGenerator
-
getPOSContextGenerator
-
getSequenceValidator
-
validateArtifactMap
Description copied from class:BaseToolFactoryValidates the parsed artifacts. If something is not valid subclasses should throw anInvalidFormatException. Note: Subclasses should generally invoke super.validateArtifactMap at the beginning of this method.- Specified by:
validateArtifactMapin classBaseToolFactory- Throws:
InvalidFormatException
-
create
@Deprecated public static POSTaggerFactory create(String subclassName, Dictionary ngramDictionary, TagDictionary posDictionary) throws InvalidFormatException Deprecated.- Throws:
InvalidFormatException
-
create
public static POSTaggerFactory create(String subclassName, byte[] featureGeneratorBytes, Map<String, Object> resources, TagDictionary posDictionary) throws InvalidFormatException- Throws:
InvalidFormatException
-
createEmptyTagDictionary
-