Class TokenInfoDictionary
java.lang.Object
org.apache.lucene.analysis.ja.dict.BinaryDictionary
org.apache.lucene.analysis.ja.dict.TokenInfoDictionary
- All Implemented Interfaces:
Dictionary
Binary dictionary implementation for a known-word dictionary model: Words are encoded into an FST
mapping to a list of wordIDs.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.lucene.analysis.ja.dict.BinaryDictionary
BinaryDictionary.ResourceScheme -
Field Summary
FieldsFields inherited from class org.apache.lucene.analysis.ja.dict.BinaryDictionary
DICT_FILENAME_SUFFIX, DICT_HEADER, HAS_BASEFORM, HAS_PRONUNCIATION, HAS_READING, POSDICT_FILENAME_SUFFIX, POSDICT_HEADER, TARGETMAP_FILENAME_SUFFIX, TARGETMAP_HEADER, VERSIONFields inherited from interface org.apache.lucene.analysis.ja.dict.Dictionary
INTERNAL_SEPARATOR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateTokenInfoDictionary(URL targetMapUrl, URL posDictUrl, URL dictUrl, URL fstUrl) Create aTokenInfoDictionaryfrom an external resource URL (e.g.TokenInfoDictionary(Path targetMapFile, Path posDictFile, Path dictFile, Path fstFile) Create aTokenInfoDictionaryfrom an external resource path.TokenInfoDictionary(BinaryDictionary.ResourceScheme resourceScheme, String resourcePath) Deprecated, for removal: This API element is subject to removal in a future version.privateTokenInfoDictionary(IOSupplier<InputStream> targetMapResource, IOSupplier<InputStream> posResource, IOSupplier<InputStream> dictResource, IOSupplier<InputStream> fstResource) -
Method Summary
Modifier and TypeMethodDescription(package private) static InputStreamgetClassResource(String suffix) getFST()static TokenInfoDictionaryMethods inherited from class org.apache.lucene.analysis.ja.dict.BinaryDictionary
getBaseForm, getInflectionForm, getInflectionType, getLeftId, getPartOfSpeech, getPronunciation, getReading, getResource, getRightId, getWordCost, lookupWordIds
-
Field Details
-
FST_FILENAME_SUFFIX
- See Also:
-
fst
-
-
Constructor Details
-
TokenInfoDictionary
@Deprecated(forRemoval=true, since="9.1") public TokenInfoDictionary(BinaryDictionary.ResourceScheme resourceScheme, String resourcePath) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.replaced byTokenInfoDictionary(Path, Path, Path, Path)for files andTokenInfoDictionary(URL, URL, URL, URL)for classpath/module resources- Parameters:
resourceScheme- - scheme for loading resources (FILE or CLASSPATH).resourcePath- - where to load resources (dictionaries) from.- Throws:
IOException
-
TokenInfoDictionary
public TokenInfoDictionary(Path targetMapFile, Path posDictFile, Path dictFile, Path fstFile) throws IOException Create aTokenInfoDictionaryfrom an external resource path.- Parameters:
targetMapFile- where to load target map resourceposDictFile- where to load POS dictionary resourcedictFile- where to load dictionary entries resourcefstFile- where to load encoded FST data resource- Throws:
IOException- if resource was not found or broken
-
TokenInfoDictionary
public TokenInfoDictionary(URL targetMapUrl, URL posDictUrl, URL dictUrl, URL fstUrl) throws IOException Create aTokenInfoDictionaryfrom an external resource URL (e.g. from Classpath withClassLoader.getResource(String)).- Parameters:
targetMapUrl- where to load target map resourceposDictUrl- where to load POS dictionary resourcedictUrl- where to load dictionary entries resourcefstUrl- where to load encoded FST data resource- Throws:
IOException- if resource was not found or broken
-
TokenInfoDictionary
- Throws:
IOException
-
TokenInfoDictionary
private TokenInfoDictionary(IOSupplier<InputStream> targetMapResource, IOSupplier<InputStream> posResource, IOSupplier<InputStream> dictResource, IOSupplier<InputStream> fstResource) throws IOException - Throws:
IOException
-
-
Method Details
-
getClassResource
- Throws:
IOException
-
getFST
-
getInstance
-
TokenInfoDictionary(Path, Path, Path, Path)for files andTokenInfoDictionary(URL, URL, URL, URL)for classpath/module resources