Package opennlp.morfologik.tagdict
Class MorfologikPOSTaggerFactory
- java.lang.Object
-
- opennlp.tools.util.BaseToolFactory
-
- opennlp.tools.postag.POSTaggerFactory
-
- opennlp.morfologik.tagdict.MorfologikPOSTaggerFactory
-
public class MorfologikPOSTaggerFactory extends POSTaggerFactory
The factory provides a Morfologik specificPOSTaggerFactory
implementation and initializes related resources.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class opennlp.tools.postag.POSTaggerFactory
POSTaggerFactory.POSDictionarySerializer
-
-
Constructor Summary
Constructors Constructor Description MorfologikPOSTaggerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>
createArtifactMap()
Map<String,ArtifactSerializer>
createArtifactSerializersMap()
TagDictionary
createEmptyTagDictionary()
TagDictionary
createTagDictionary(File dictionary)
Initializes aTagDictionary
from adictionary file
.TagDictionary
createTagDictionary(InputStream in)
TagDictionary
getTagDictionary()
void
setTagDictionary(TagDictionary dictionary)
-
Methods inherited from class opennlp.tools.postag.POSTaggerFactory
create, createFeatureGenerators, getPOSContextGenerator, getPOSContextGenerator, getSequenceValidator, validateArtifactMap
-
Methods inherited from class opennlp.tools.util.BaseToolFactory
create, create, createManifestEntries
-
-
-
-
Method Detail
-
createTagDictionary
public TagDictionary createTagDictionary(File dictionary) throws IOException
Initializes aTagDictionary
from adictionary file
.- Overrides:
createTagDictionary
in classPOSTaggerFactory
- Parameters:
dictionary
- TheFile
used as input for creating the dictionary.- Returns:
- A valid
TagDictionary
ready for use. - Throws:
FileNotFoundException
- Thrown ifdictionary
or related metadata could not be read in.IOException
- Thrown if IO errors occurred.
-
getTagDictionary
public TagDictionary getTagDictionary()
- Overrides:
getTagDictionary
in classPOSTaggerFactory
- Returns:
- The
TagDictionary
used. - Throws:
RuntimeException
- Thrown if errors occurred loading or reading Morfologik dictionary files.
-
setTagDictionary
public void setTagDictionary(TagDictionary dictionary)
- Overrides:
setTagDictionary
in classPOSTaggerFactory
-
createEmptyTagDictionary
public TagDictionary createEmptyTagDictionary()
- Overrides:
createEmptyTagDictionary
in classPOSTaggerFactory
-
createTagDictionary
public TagDictionary createTagDictionary(InputStream in) throws IOException
- Overrides:
createTagDictionary
in classPOSTaggerFactory
- Throws:
IOException
-
createArtifactSerializersMap
public Map<String,ArtifactSerializer> createArtifactSerializersMap()
- Overrides:
createArtifactSerializersMap
in classPOSTaggerFactory
-
createArtifactMap
public Map<String,Object> createArtifactMap()
- Overrides:
createArtifactMap
in classPOSTaggerFactory
-
-