public final class Util
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
close(java.io.Closeable aClosable)
Close the given
Closeable. |
static java.util.List<java.lang.String> |
getSearchPaths(java.util.List<java.lang.String> aAdditionalPaths,
java.lang.String aSubPath)
Get the search paths for a model or executable.
|
static java.lang.String |
join(java.util.Collection<java.lang.String> aStrings,
java.lang.String aSeparator)
Join the given strings into a single string separated by the given
separator.
|
static java.lang.String |
join(java.lang.String[] aStrings,
java.lang.String aSeparator)
Join the given strings into a single string separated by the given
separator.
|
static boolean |
matches(java.lang.String tokenSent,
java.lang.String tokenReturned)
Checks if a token returned by TreeTagger corresponds to the token sent to TreeTagger.
|
protected static java.lang.String |
readFile(java.io.File aFile,
java.lang.String aEncoding)
For tests only.
|
protected static java.lang.String[] |
tokenize(java.lang.String aText,
java.util.Locale aLocale)
For tests only.
|
protected static void |
writeFile(java.lang.String aText,
java.io.File aFile,
java.lang.String aEncoding)
For tests only.
|
public static java.util.List<java.lang.String> getSearchPaths(java.util.List<java.lang.String> aAdditionalPaths,
java.lang.String aSubPath)
aSubPath
argument, executables and models can be searched for in different
locations, e.g. executables in executable and models in
models.
The returned list contains the additional search paths, the value of the system property treetagger.home and the environment variables TREETAGGER_HOME and TAGDIR in this order.
aAdditionalPaths - additional paths to search in.aSubPath - search in the given sub-directory of the search paths.public static java.lang.String join(java.lang.String[] aStrings,
java.lang.String aSeparator)
aStrings - strings to join.aSeparator - a separator.public static java.lang.String join(java.util.Collection<java.lang.String> aStrings,
java.lang.String aSeparator)
aStrings - strings to join.aSeparator - a separator.public static boolean matches(java.lang.String tokenSent,
java.lang.String tokenReturned)
tokenSent - token sent to TreeTaggertokenReturned - token returned from TreeTaggerpublic static void close(java.io.Closeable aClosable)
Closeable.aClosable - a closable object.protected static java.lang.String readFile(java.io.File aFile,
java.lang.String aEncoding)
throws java.io.IOException
aFile - the file.aEncoding - the encoding.java.io.IOException - if an I/O error occurs.protected static void writeFile(java.lang.String aText,
java.io.File aFile,
java.lang.String aEncoding)
throws java.io.IOException
aText - the text to write.aFile - the file to write to.aEncoding - the encoding to use.java.io.IOException - if an I/O error occurs.protected static java.lang.String[] tokenize(java.lang.String aText,
java.util.Locale aLocale)
aText - the text to write.aLocale - the locale to use for tokenization.Copyright © 2014. All Rights Reserved.