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 ByteBuffer
static final int
flag that the entry has reading data.static final int
flag that the entry has a single part of speech (leftPOS)private final POS.Tag[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getLeftId
(int morphId) Get left id of specified wordgetLeftPOS
(int morphId) Get the leftPOS.Tag
of specfied word.getMorphemes
(int morphId, char[] surfaceForm, int off, int len) Get the morphemes of specified word (e.g.getPOSType
(int morphId) Get thePOS.Type
of specified word (morpheme, compound, inflect or pre-analysis)getReading
(int morphId) Get the reading of specified word (mainly used for Hanja to Hangul conversion).int
getRightId
(int morphId) Get right id of specified wordgetRightPOS
(int morphId) Get the rightPOS.Tag
of specfied word.int
getWordCost
(int morphId) Get word cost of specified wordprivate boolean
hasReadingData
(int wordId) private boolean
hasSinglePOS
(int wordId) private String
readString
(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:MorphData
Get left id of specified word -
getRightId
public int getRightId(int morphId) Description copied from interface:MorphData
Get right id of specified word- Specified by:
getRightId
in interfaceMorphData
- Returns:
- right id
-
getWordCost
public int getWordCost(int morphId) Description copied from interface:MorphData
Get word cost of specified word- Specified by:
getWordCost
in interfaceMorphData
- Returns:
- word's cost
-
getPOSType
Description copied from interface:KoMorphData
Get thePOS.Type
of specified word (morpheme, compound, inflect or pre-analysis)- Specified by:
getPOSType
in interfaceKoMorphData
-
getLeftPOS
Description copied from interface:KoMorphData
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 interfaceKoMorphData
-
getRightPOS
Description copied from interface:KoMorphData
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 interfaceKoMorphData
-
getReading
Description copied from interface:KoMorphData
Get the reading of specified word (mainly used for Hanja to Hangul conversion).- Specified by:
getReading
in interfaceKoMorphData
-
getMorphemes
Description copied from interface:KoMorphData
Get the morphemes of specified word (e.g. 가깝으나: 가깝 + 으나).- Specified by:
getMorphemes
in interfaceKoMorphData
-
readString
-
hasSinglePOS
private boolean hasSinglePOS(int wordId) -
hasReadingData
private boolean hasReadingData(int wordId)
-