Package opennlp.tools.util
Klasse BaseToolFactory
java.lang.Object
opennlp.tools.util.BaseToolFactory
- Bekannte direkte Unterklassen:
ChunkerFactory,DoccatFactory,LanguageDetectorFactory,LemmatizerFactory,POSTaggerFactory,SentenceDetectorFactory,TokenizerFactory,TokenNameFinderFactory
Base class for all tool
factories.
Extensions of this class should:
- implement an empty constructor,
- implement a constructor that takes the
ArtifactProvider}, - override
createArtifactMap()andcreateArtifactSerializersMap()methods if necessary.
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic BaseToolFactorycreate(Class<? extends BaseToolFactory> factoryClass, ArtifactProvider artifactProvider) Instantiates aBaseToolFactoryvia a givensubclassName.static BaseToolFactorycreate(String subclassName, ArtifactProvider artifactProvider) Instantiates aBaseToolFactoryvia a givensubclassName.A model's implementation should call this constructor that creates a model programmatically.Creates aMapwith pairs of keys andArtifactSerializer.abstract voidValidates the parsed artifacts.
-
Konstruktordetails
-
BaseToolFactory
public BaseToolFactory()All subclasses should have an empty constructor
-
-
Methodendetails
-
createArtifactSerializersMap
Creates aMapwith pairs of keys andArtifactSerializer. The models implementation should call this method fromBaseModel#createArtifactSerializersMap.The base implementation will return a
HashMapthat should be populated by subclasses. -
createArtifactMap
A model's implementation should call this constructor that creates a model programmatically.The base implementation will return a
HashMapthat should be populated by subclasses.- Gibt zurück:
- Retrieves a
Mapwith pairs of keys and objects.
-
createManifestEntries
- Gibt zurück:
- Retrieves the manifest entries to be added to the model manifest.
-
validateArtifactMap
Validates the parsed artifacts.Note: Subclasses should generally invoke
super.validateArtifactMapat the beginning of this method.- Löst aus:
InvalidFormatException- Thrown if validation found invalid states.
-
create
public static BaseToolFactory create(String subclassName, ArtifactProvider artifactProvider) throws InvalidFormatException Instantiates aBaseToolFactoryvia a givensubclassName.- Parameter:
subclassName- The class name used for instantiation. TheExtensionLoadermechanism is applied to load the requestedsubclassName.artifactProvider- TheArtifactProviderto be used.- Gibt zurück:
- A valid
BaseToolFactoryinstance. - Löst aus:
InvalidFormatException- Thrown if theExtensionLoadermechanism failed to create the factory associated withsubclassName.
-
create
public static BaseToolFactory create(Class<? extends BaseToolFactory> factoryClass, ArtifactProvider artifactProvider) throws InvalidFormatException Instantiates aBaseToolFactoryvia a givensubclassName.- Parameter:
factoryClass- The class used for instantiation. The no-arg constructor of that class will be used to create and init the resulting object.artifactProvider- TheArtifactProviderto be used.- Gibt zurück:
- A valid
BaseToolFactoryinstance. - Löst aus:
InvalidFormatException- Thrown if theExtensionLoadermechanism failed to create the factory associated withsubclassName.
-