public class FSTLookup extends Object
Constructor and Description |
---|
FSTLookup(InputStream inStream,
String identifier)
Initialise the finite state transducer lookup.
|
FSTLookup(InputStream inStream,
String identifier,
String encoding)
Initialise the finite state transducer lookup.
|
FSTLookup(String fileName)
Initialise the finite state transducer lookup.
|
FSTLookup(String fileName,
String encoding)
Initialise the finite state transducer lookup.
|
Modifier and Type | Method and Description |
---|---|
String[] |
lookup(String word)
Look up a word in the FST.
|
String[] |
lookup(String word,
boolean generate)
Look up a word in the FST.
|
static void |
main(String[] args)
A simple command-line frontend for the FST.
|
static void |
showResults(String query,
String[] args) |
public FSTLookup(String fileName) throws IOException
fileName
- the name of the file from which to load the FST.IOException
- if the FST cannot be loaded from the given file.public FSTLookup(InputStream inStream, String identifier) throws IOException
inStream
- the stream from which to load the FST.identifier
- an identifier by which the FST lookup can be retrieved.IOException
- if the FST cannot be loaded from the given file.public FSTLookup(String fileName, String encoding) throws IOException, UnsupportedEncodingException
fileName
- the name of the file from which to load the FST.encoding
- the name of the encoding used in the file (e.g., UTF-8 or ISO-8859-1).IOException
- if the FST cannot be loaded from the given file.UnsupportedEncodingException
- if the encoding is not supported.public FSTLookup(InputStream inStream, String identifier, String encoding) throws IOException, UnsupportedEncodingException
inStream
- the stream from which to load the FST.identifier
- an identifier by which the FST lookup can be retrieved.encoding
- the name of the encoding used in the file (e.g., UTF-8 or ISO-8859-1).IOException
- if the FST cannot be loaded from the given file.UnsupportedEncodingException
- if the encoding is not supported.public String[] lookup(String word)
word
- the word to look up.public String[] lookup(String word, boolean generate)
word
- the word to look up.generate
- whether the FST is to run in inverse direction, i.e. generating the original form from the expanded form.public static void main(String[] args) throws IOException
args
- argsIOException
- IOExceptionCopyright © 2000–2016 DFKI GmbH. All rights reserved.