org.annolab.tt4j
Class TreeTaggerModelUtil

java.lang.Object
  extended by org.annolab.tt4j.TreeTaggerModelUtil

public class TreeTaggerModelUtil
extends Object


Constructor Summary
TreeTaggerModelUtil()
           
 
Method Summary
static List<String> getTagset(File aModelFile, String aCharsetName)
          Read the tagset from a model.
static List<String> getTagset(InputStream aInputStream, String aCharsetName)
          Read the tagset from a model.
static TreeTaggerModel readModel(File aFile, String aCharsetName)
          Read a model from a file.
static TreeTaggerModel readModel(InputStream aInputStream, String aCharsetName)
          Read a model.
static TreeTaggerModel readModel(URL aUrl, String aCharsetName)
          Read a model from an URL.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeTaggerModelUtil

public TreeTaggerModelUtil()
Method Detail

getTagset

public static List<String> getTagset(File aModelFile,
                                     String aCharsetName)
                              throws IOException
Read the tagset from a model.

Parameters:
aModelFile - the model file.
aCharsetName - the model encoding (optional).
Returns:
the tag set.
Throws:
IOException

getTagset

public static List<String> getTagset(InputStream aInputStream,
                                     String aCharsetName)
                              throws IOException
Read the tagset from a model.

Parameters:
aModelFile - the model file.
aCharsetName - the model encoding (optional).
Returns:
the tag set.
Throws:
IOException

readModel

public static TreeTaggerModel readModel(File aFile,
                                        String aCharsetName)
                                 throws IOException
Read a model from a file.

Parameters:
aUrl - the file to load the model from. Supports gzipped models when the file name ends in ".gz".
aCharsetName - the model encoding (optional).
Returns:
the model.
Throws:
IOException

readModel

public static TreeTaggerModel readModel(URL aUrl,
                                        String aCharsetName)
                                 throws IOException
Read a model from an URL.

Parameters:
aUrl - the URL to load the model from. Supports gzipped models when the URL ends in ".gz".
aCharsetName - the model encoding (optional).
Returns:
the model.
Throws:
IOException

readModel

public static TreeTaggerModel readModel(InputStream aInputStream,
                                        String aCharsetName)
                                 throws IOException
Read a model.

Parameters:
aInputStream - the stream to read the model from. The stream is not closed after reading.
aCharsetName - the model encoding (optional).
Returns:
the model.
Throws:
IOException


Copyright © 2012. All Rights Reserved.