public final class Dictionary
extends java.lang.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 |
|---|---|
morfologik.fsa.FSA |
fsa
FSA automaton with the compiled dictionary data. |
DictionaryMetadata |
metadata
Metadata associated with the dictionary.
|
| Constructor and Description |
|---|
Dictionary(morfologik.fsa.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(java.io.InputStream fsaStream,
java.io.InputStream metadataStream)
Attempts to load a dictionary from opened streams of FSA dictionary data
and associated metadata.
|
static Dictionary |
read(java.nio.file.Path location)
Attempts to load a dictionary using the path to the FSA file and the
expected metadata extension.
|
static Dictionary |
read(java.net.URL dictURL)
Attempts to load a dictionary using the URL to the FSA file and the
expected metadata extension.
|
public final morfologik.fsa.FSA fsa
FSA automaton with the compiled dictionary data.public final DictionaryMetadata metadata
public Dictionary(morfologik.fsa.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(java.nio.file.Path location) throws java.io.IOException
location - The location of the dictionary file (*.dict).java.io.IOException - if an I/O error occurs.public static Dictionary read(java.net.URL dictURL) throws java.io.IOException
dictURL - The URL pointing to the dictionary file (*.dict).java.io.IOException - if an I/O error occurs.public static Dictionary read(java.io.InputStream fsaStream, java.io.InputStream metadataStream) throws java.io.IOException
fsaStream - The stream with FSA datametadataStream - The stream with metadataDictionary.java.io.IOException - if an I/O error occurs.Copyright © 2018. All rights reserved.