Class UnknownDictionary
java.lang.Object
org.apache.lucene.analysis.ko.dict.BinaryDictionary
org.apache.lucene.analysis.ko.dict.UnknownDictionary
- All Implemented Interfaces:
Dictionary
Dictionary for unknown-word handling.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.lucene.analysis.ko.dict.BinaryDictionary
BinaryDictionary.ResourceSchemeNested classes/interfaces inherited from interface org.apache.lucene.analysis.ko.dict.Dictionary
Dictionary.Morpheme -
Field Summary
FieldsFields inherited from class org.apache.lucene.analysis.ko.dict.BinaryDictionary
DICT_FILENAME_SUFFIX, DICT_HEADER, HAS_READING, HAS_SINGLE_POS, POSDICT_FILENAME_SUFFIX, POSDICT_HEADER, TARGETMAP_FILENAME_SUFFIX, TARGETMAP_HEADER, VERSION -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateUnknownDictionary(URL targetMapUrl, URL posDictUrl, URL dictUrl) Create aUnknownDictionaryfrom an external resource URL (e.g.UnknownDictionary(Path targetMapFile, Path posDictFile, Path dictFile) Create aUnknownDictionaryfrom an external resource path.UnknownDictionary(BinaryDictionary.ResourceScheme scheme, String resourcePath) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprivate static InputStreamgetClassResource(String suffix) static UnknownDictionarygetMorphemes(int wordId, char[] surfaceForm, int off, int len) Get the morphemes of specified word (e.g.getReading(int wordId) Get the reading of specified word (mainly used for Hanja to Hangul conversion).Methods inherited from class org.apache.lucene.analysis.ko.dict.BinaryDictionary
getLeftId, getLeftPOS, getPOSType, getResource, getRightId, getRightPOS, getWordCost, lookupWordIds
-
Field Details
-
characterDefinition
-
-
Constructor Details
-
UnknownDictionary
@Deprecated(forRemoval=true, since="9.1") public UnknownDictionary(BinaryDictionary.ResourceScheme scheme, String resourcePath) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.replaced byUnknownDictionary(Path, Path, Path)for files andUnknownDictionary(URL, URL, URL)for classpath/module resources- Parameters:
scheme- scheme for loading resources (FILE or CLASSPATH).resourcePath- where to load resources from; a path, including the file base name without extension; this is used to match multiple files with the same base name.- Throws:
IOException
-
UnknownDictionary
Create aUnknownDictionaryfrom an external resource path.- Parameters:
targetMapFile- where to load target map resourceposDictFile- where to load POS dictionary resourcedictFile- where to load dictionary entries resource- Throws:
IOException- if resource was not found or broken
-
UnknownDictionary
Create aUnknownDictionaryfrom 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 resource- Throws:
IOException- if resource was not found or broken
-
UnknownDictionary
- Throws:
IOException
-
-
Method Details
-
getClassResource
- Throws:
IOException
-
getCharacterDefinition
-
getInstance
-
getReading
Description copied from interface:DictionaryGet the reading of specified word (mainly used for Hanja to Hangul conversion).- Specified by:
getReadingin interfaceDictionary- Overrides:
getReadingin classBinaryDictionary
-
getMorphemes
Description copied from interface:DictionaryGet the morphemes of specified word (e.g. 가깝으나: 가깝 + 으나).- Specified by:
getMorphemesin interfaceDictionary- Overrides:
getMorphemesin classBinaryDictionary
-
UnknownDictionary(Path, Path, Path)for files andUnknownDictionary(URL, URL, URL)for classpath/module resources