public final class Dictionary extends Object
FSA
automaton and DictionaryMetadata
describing the way terms are encoded in the automaton.
A dictionary consists of two files:
DictionaryMetadata
, describing the way terms are encoded.
Modifier and Type | Field and Description |
---|---|
FSA |
fsa
FSA automaton with the compiled dictionary data. |
DictionaryMetadata |
metadata
Metadata associated with the dictionary.
|
Constructor and Description |
---|
Dictionary(FSA fsa,
DictionaryMetadata metadata)
It is strongly recommended to use static methods in this class for
reading dictionaries.
|
Modifier and Type | Method and Description |
---|---|
static Dictionary |
read(InputStream fsaStream,
InputStream metadataStream)
Attempts to load a dictionary from opened streams of FSA dictionary data
and associated metadata.
|
static Dictionary |
read(Path location)
Attempts to load a dictionary using the path to the FSA file and the
expected metadata extension.
|
static Dictionary |
read(URL dictURL)
Attempts to load a dictionary using the URL to the FSA file and the
expected metadata extension.
|
public final DictionaryMetadata metadata
public Dictionary(FSA fsa, DictionaryMetadata metadata)
fsa
- An instantiated FSA
instance.metadata
- A map of attributes describing the compression format and
other settings not contained in the FSA automaton. For an
explanation of available attributes and their possible values,
see DictionaryMetadata
.public static Dictionary read(Path location) throws IOException
location
- The location of the dictionary file (*.dict
).IOException
- if an I/O error occurs.public static Dictionary read(URL dictURL) throws IOException
dictURL
- The URL pointing to the dictionary file (*.dict
).IOException
- if an I/O error occurs.public static Dictionary read(InputStream fsaStream, InputStream metadataStream) throws IOException
fsaStream
- The stream with FSA datametadataStream
- The stream with metadataDictionary
.IOException
- if an I/O error occurs.Copyright © 2016. All rights reserved.