Class BinaryDictionary
java.lang.Object
org.apache.lucene.analysis.ko.dict.BinaryDictionary
- All Implemented Interfaces:
Dictionary
- Direct Known Subclasses:
TokenInfoDictionary
,UnknownDictionary
Base class for a binary-encoded in-memory dictionary.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Deprecated, for removal: This API element is subject to removal in a future version.Nested classes/interfaces inherited from interface org.apache.lucene.analysis.ko.dict.Dictionary
Dictionary.Morpheme
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final int
flag that the entry has reading data.static final int
flag that the entry has a single part of speech (leftPOS)static final String
static final String
static final String
static final String
static final int
-
Constructor Summary
ModifierConstructorDescriptionprotected
BinaryDictionary
(IOSupplier<InputStream> targetMapResource, IOSupplier<InputStream> posResource, IOSupplier<InputStream> dictResource) -
Method Summary
Modifier and TypeMethodDescriptionint
getLeftId
(int wordId) Get left id of specified wordgetLeftPOS
(int wordId) Get the leftPOS.Tag
of specfied word.getMorphemes
(int wordId, char[] surfaceForm, int off, int len) Get the morphemes of specified word (e.g.getPOSType
(int wordId) Get thePOS.Type
of specified word (morpheme, compound, inflect or pre-analysis)getReading
(int wordId) Get the reading of specified word (mainly used for Hanja to Hangul conversion).int
getRightId
(int wordId) Get right id of specified wordgetRightPOS
(int wordId) Get the rightPOS.Tag
of specfied word.int
getWordCost
(int wordId) Get word cost of specified wordvoid
lookupWordIds
(int sourceId, IntsRef ref)
-
Field Details
-
TARGETMAP_FILENAME_SUFFIX
- See Also:
-
DICT_FILENAME_SUFFIX
- See Also:
-
POSDICT_FILENAME_SUFFIX
- See Also:
-
DICT_HEADER
- See Also:
-
TARGETMAP_HEADER
- See Also:
-
POSDICT_HEADER
- See Also:
-
VERSION
public static final int VERSION- See Also:
-
HAS_SINGLE_POS
public static final int HAS_SINGLE_POSflag that the entry has a single part of speech (leftPOS)- See Also:
-
HAS_READING
public static final int HAS_READINGflag that the entry has reading data. otherwise reading is surface form- See Also:
-
-
Constructor Details
-
BinaryDictionary
protected BinaryDictionary(IOSupplier<InputStream> targetMapResource, IOSupplier<InputStream> posResource, IOSupplier<InputStream> dictResource) throws IOException - Throws:
IOException
-
-
Method Details
-
lookupWordIds
-
getLeftId
public int getLeftId(int wordId) Description copied from interface:Dictionary
Get left id of specified word- Specified by:
getLeftId
in interfaceDictionary
-
getRightId
public int getRightId(int wordId) Description copied from interface:Dictionary
Get right id of specified word- Specified by:
getRightId
in interfaceDictionary
-
getWordCost
public int getWordCost(int wordId) Description copied from interface:Dictionary
Get word cost of specified word- Specified by:
getWordCost
in interfaceDictionary
-
getPOSType
Description copied from interface:Dictionary
Get thePOS.Type
of specified word (morpheme, compound, inflect or pre-analysis)- Specified by:
getPOSType
in interfaceDictionary
-
getLeftPOS
Description copied from interface:Dictionary
Get the leftPOS.Tag
of specfied word.For
POS.Type.MORPHEME
andPOS.Type.COMPOUND
the left and right POS are the same.- Specified by:
getLeftPOS
in interfaceDictionary
-
getRightPOS
Description copied from interface:Dictionary
Get the rightPOS.Tag
of specfied word.For
POS.Type.MORPHEME
andPOS.Type.COMPOUND
the left and right POS are the same.- Specified by:
getRightPOS
in interfaceDictionary
-
getReading
Description copied from interface:Dictionary
Get the reading of specified word (mainly used for Hanja to Hangul conversion).- Specified by:
getReading
in interfaceDictionary
-
getMorphemes
Description copied from interface:Dictionary
Get the morphemes of specified word (e.g. 가깝으나: 가깝 + 으나).- Specified by:
getMorphemes
in interfaceDictionary
-