Class TokenInfoMorphData
java.lang.Object
org.apache.lucene.analysis.ko.dict.TokenInfoMorphData
- All Implemented Interfaces:
KoMorphData,MorphData
- Direct Known Subclasses:
UnknownMorphData
Morphological information for system dictionary.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.lucene.analysis.ko.dict.KoMorphData
KoMorphData.Morpheme -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ByteBufferstatic final intflag that the entry has reading data.static final intflag that the entry has a single part of speech (leftPOS)private final POS.Tag[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetLeftId(int morphId) Get left id of specified wordgetLeftPOS(int morphId) Get the leftPOS.Tagof specfied word.getMorphemes(int morphId, char[] surfaceForm, int off, int len) Get the morphemes of specified word (e.g.getPOSType(int morphId) Get thePOS.Typeof specified word (morpheme, compound, inflect or pre-analysis)getReading(int morphId) Get the reading of specified word (mainly used for Hanja to Hangul conversion).intgetRightId(int morphId) Get right id of specified wordgetRightPOS(int morphId) Get the rightPOS.Tagof specfied word.intgetWordCost(int morphId) Get word cost of specified wordprivate booleanhasReadingData(int wordId) private booleanhasSinglePOS(int wordId) private StringreadString(int offset)
-
Field Details
-
buffer
-
posDict
-
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
-
TokenInfoMorphData
TokenInfoMorphData(ByteBuffer buffer, IOSupplier<InputStream> posResource) throws IOException - Throws:
IOException
-
-
Method Details
-
getLeftId
public int getLeftId(int morphId) Description copied from interface:MorphDataGet left id of specified word -
getRightId
public int getRightId(int morphId) Description copied from interface:MorphDataGet right id of specified word- Specified by:
getRightIdin interfaceMorphData- Returns:
- right id
-
getWordCost
public int getWordCost(int morphId) Description copied from interface:MorphDataGet word cost of specified word- Specified by:
getWordCostin interfaceMorphData- Returns:
- word's cost
-
getPOSType
Description copied from interface:KoMorphDataGet thePOS.Typeof specified word (morpheme, compound, inflect or pre-analysis)- Specified by:
getPOSTypein interfaceKoMorphData
-
getLeftPOS
Description copied from interface:KoMorphDataGet the leftPOS.Tagof specfied word.For
POS.Type.MORPHEMEandPOS.Type.COMPOUNDthe left and right POS are the same.- Specified by:
getLeftPOSin interfaceKoMorphData
-
getRightPOS
Description copied from interface:KoMorphDataGet the rightPOS.Tagof specfied word.For
POS.Type.MORPHEMEandPOS.Type.COMPOUNDthe left and right POS are the same.- Specified by:
getRightPOSin interfaceKoMorphData
-
getReading
Description copied from interface:KoMorphDataGet the reading of specified word (mainly used for Hanja to Hangul conversion).- Specified by:
getReadingin interfaceKoMorphData
-
getMorphemes
Description copied from interface:KoMorphDataGet the morphemes of specified word (e.g. 가깝으나: 가깝 + 으나).- Specified by:
getMorphemesin interfaceKoMorphData
-
readString
-
hasSinglePOS
private boolean hasSinglePOS(int wordId) -
hasReadingData
private boolean hasReadingData(int wordId)
-