org.annolab.tt4j
Class DefaultModelResolver

java.lang.Object
  extended by org.annolab.tt4j.DefaultModelResolver
All Implemented Interfaces:
ModelResolver

public class DefaultModelResolver
extends java.lang.Object
implements ModelResolver

Simple model provider. The model name is actually the path to the model. The path has to be followed by a ":" and the name model encoding. Example /usr/lib/model.par:UTF-8.

Author:
Richard Eckart de Castilho

Field Summary
protected  java.util.List<java.lang.String> _additionalPaths
           
protected  PlatformDetector _platform
           
 
Constructor Summary
DefaultModelResolver()
           
 
Method Summary
 Model getModel(java.lang.String aModelName)
          Load the model with the given name.
 Model getModel(java.lang.String aModelName, java.lang.String aLocation, java.lang.String aEncoding)
           
 PlatformDetector getPlatformDetector()
          Get platform information.
 void setAdditionalPaths(java.util.List<java.lang.String> aAdditionalPaths)
          Set additional paths that will be used for searching the TreeTagger executable.
 void setPlatformDetector(PlatformDetector aPlatform)
          Set platform information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_platform

protected PlatformDetector _platform

_additionalPaths

protected java.util.List<java.lang.String> _additionalPaths
Constructor Detail

DefaultModelResolver

public DefaultModelResolver()
Method Detail

setAdditionalPaths

public void setAdditionalPaths(java.util.List<java.lang.String> aAdditionalPaths)
Set additional paths that will be used for searching the TreeTagger executable.

Parameters:
aAdditionalPaths - list of additional paths.
See Also:
Util.getSearchPaths(List, String)

getPlatformDetector

public PlatformDetector getPlatformDetector()
Get platform information.

Returns:
platform information.

getModel

public Model getModel(java.lang.String aModelName)
               throws java.io.IOException
Description copied from interface: ModelResolver
Load the model with the given name.

Specified by:
getModel in interface ModelResolver
Parameters:
aModelName - the name of the model.
Returns:
the model.
Throws:
java.io.IOException - if the model can not be found.

getModel

public Model getModel(java.lang.String aModelName,
                      java.lang.String aLocation,
                      java.lang.String aEncoding)
               throws java.io.IOException
Throws:
java.io.IOException

setPlatformDetector

public void setPlatformDetector(PlatformDetector aPlatform)
Description copied from interface: ModelResolver
Set platform information.

Specified by:
setPlatformDetector in interface ModelResolver
Parameters:
aPlatform - the platform information.


Copyright © 2012. All Rights Reserved.