opennlp.tools.postag
Class POSTaggerFactory

java.lang.Object
  extended by opennlp.tools.util.BaseToolFactory
      extended by opennlp.tools.postag.POSTaggerFactory

public class POSTaggerFactory
extends BaseToolFactory

The factory that provides POS Tagger default implementations and resources


Constructor Summary
POSTaggerFactory()
          Creates a POSTaggerFactory that provides the default implementation of the resources.
POSTaggerFactory(Dictionary ngramDictionary, TagDictionary posDictionary)
          Creates a POSTaggerFactory.
 
Method Summary
static POSTaggerFactory create(String subclassName, Dictionary ngramDictionary, TagDictionary posDictionary)
           
 Map<String,Object> createArtifactMap()
          Creates a Map with pairs of keys and objects.
 Map<String,ArtifactSerializer> createArtifactSerializersMap()
          Creates a Map with pairs of keys and ArtifactSerializer.
 TagDictionary createEmptyTagDictionary()
           
 TagDictionary createTagDictionary(File dictionary)
           
 TagDictionary createTagDictionary(InputStream in)
           
 Dictionary getDictionary()
           
 POSContextGenerator getPOSContextGenerator()
           
 POSContextGenerator getPOSContextGenerator(int cacheSize)
           
 SequenceValidator<String> getSequenceValidator()
           
 TagDictionary getTagDictionary()
           
 void setDictionary(Dictionary ngramDict)
           
 void setTagDictionary(TagDictionary dictionary)
           
 void validateArtifactMap()
          Validates the parsed artifacts.
 
Methods inherited from class opennlp.tools.util.BaseToolFactory
create, create, createManifestEntries
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POSTaggerFactory

public POSTaggerFactory()
Creates a POSTaggerFactory that provides the default implementation of the resources.


POSTaggerFactory

public POSTaggerFactory(Dictionary ngramDictionary,
                        TagDictionary posDictionary)
Creates a POSTaggerFactory. Use this constructor to programmatically create a factory.

Parameters:
ngramDictionary -
posDictionary -
Method Detail

createArtifactSerializersMap

public Map<String,ArtifactSerializer> createArtifactSerializersMap()
Description copied from class: BaseToolFactory
Creates a 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.

Overrides:
createArtifactSerializersMap in class BaseToolFactory

createArtifactMap

public Map<String,Object> createArtifactMap()
Description copied from class: BaseToolFactory
Creates a 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.

Overrides:
createArtifactMap in class BaseToolFactory

createTagDictionary

public TagDictionary createTagDictionary(File dictionary)
                                  throws InvalidFormatException,
                                         FileNotFoundException,
                                         IOException
Throws:
InvalidFormatException
FileNotFoundException
IOException

createTagDictionary

public TagDictionary createTagDictionary(InputStream in)
                                  throws InvalidFormatException,
                                         IOException
Throws:
InvalidFormatException
IOException

setTagDictionary

public void setTagDictionary(TagDictionary dictionary)

getTagDictionary

public TagDictionary getTagDictionary()

getDictionary

public Dictionary getDictionary()

setDictionary

public void setDictionary(Dictionary ngramDict)

getPOSContextGenerator

public POSContextGenerator getPOSContextGenerator()

getPOSContextGenerator

public POSContextGenerator getPOSContextGenerator(int cacheSize)

getSequenceValidator

public SequenceValidator<String> getSequenceValidator()

validateArtifactMap

public void validateArtifactMap()
                         throws InvalidFormatException
Description copied from class: BaseToolFactory
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.

Specified by:
validateArtifactMap in class BaseToolFactory
Throws:
InvalidFormatException

create

public static POSTaggerFactory create(String subclassName,
                                      Dictionary ngramDictionary,
                                      TagDictionary posDictionary)
                               throws InvalidFormatException
Throws:
InvalidFormatException

createEmptyTagDictionary

public TagDictionary createEmptyTagDictionary()


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.