org.annolab.tt4j
Class DefaultModel

java.lang.Object
  extended by org.annolab.tt4j.DefaultModel
All Implemented Interfaces:
Model

public class DefaultModel
extends Object
implements Model


Constructor Summary
DefaultModel(String aName, File aFile, String aEncoding)
           
 
Method Summary
 void destroy()
          Destroy transient resources for the model.
 String getEncoding()
          Get the model encoding.
 File getFile()
          Get the location of the model.
 String getFlushSequence()
          The the token sequence used to flush the TreeTagger state for the given model.
 String getName()
          Get the name of the model.
 void install()
          Install the model to the file system (if necessary).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultModel

public DefaultModel(String aName,
                    File aFile,
                    String aEncoding)
Method Detail

destroy

public void destroy()
Description copied from interface: Model
Destroy transient resources for the model. E.g. if the model was extracted to a temporary location from an archive/classpath, it can be deleted by this method.

Specified by:
destroy in interface Model

getEncoding

public String getEncoding()
Description copied from interface: Model
Get the model encoding.

Specified by:
getEncoding in interface Model
Returns:
the model encoding.

getFile

public File getFile()
Description copied from interface: Model
Get the location of the model. Unless Model.install() is called before, the model may not actually be present at this location.

Specified by:
getFile in interface Model
Returns:
the model location.

getFlushSequence

public String getFlushSequence()
Description copied from interface: Model
The the token sequence used to flush the TreeTagger state for the given model. Usually this is a short full sentence in the language the model is trained on. The returned string needs to contain each token separated by a space including a full stop, e.g. "This is a sentence .".

Specified by:
getFlushSequence in interface Model
Returns:
the flush sequence.

getName

public String getName()
Description copied from interface: Model
Get the name of the model.

Specified by:
getName in interface Model
Returns:
the model name.

install

public void install()
             throws IOException
Description copied from interface: Model
Install the model to the file system (if necessary).

Specified by:
install in interface Model
Throws:
IOException - if the model cannot be installed.


Copyright © 2012. All Rights Reserved.