Class TokenInfoMorphData

java.lang.Object
org.apache.lucene.analysis.ko.dict.TokenInfoMorphData
All Implemented Interfaces:
KoMorphData, MorphData
Direct Known Subclasses:
UnknownMorphData

class TokenInfoMorphData extends Object implements KoMorphData
Morphological information for system dictionary.
  • Field Details

    • buffer

      private final ByteBuffer buffer
    • posDict

      private final POS.Tag[] posDict
    • HAS_SINGLE_POS

      public static final int HAS_SINGLE_POS
      flag that the entry has a single part of speech (leftPOS)
      See Also:
    • HAS_READING

      public static final int HAS_READING
      flag that the entry has reading data. otherwise reading is surface form
      See Also:
  • Constructor Details

  • Method Details

    • getLeftId

      public int getLeftId(int morphId)
      Description copied from interface: MorphData
      Get left id of specified word
      Specified by:
      getLeftId in interface MorphData
      Returns:
      left id
    • getRightId

      public int getRightId(int morphId)
      Description copied from interface: MorphData
      Get right id of specified word
      Specified by:
      getRightId in interface MorphData
      Returns:
      right id
    • getWordCost

      public int getWordCost(int morphId)
      Description copied from interface: MorphData
      Get word cost of specified word
      Specified by:
      getWordCost in interface MorphData
      Returns:
      word's cost
    • getPOSType

      public POS.Type getPOSType(int morphId)
      Description copied from interface: KoMorphData
      Get the POS.Type of specified word (morpheme, compound, inflect or pre-analysis)
      Specified by:
      getPOSType in interface KoMorphData
    • getLeftPOS

      public POS.Tag getLeftPOS(int morphId)
      Description copied from interface: KoMorphData
      Get the left POS.Tag of specfied word.

      For POS.Type.MORPHEME and POS.Type.COMPOUND the left and right POS are the same.

      Specified by:
      getLeftPOS in interface KoMorphData
    • getRightPOS

      public POS.Tag getRightPOS(int morphId)
      Description copied from interface: KoMorphData
      Get the right POS.Tag of specfied word.

      For POS.Type.MORPHEME and POS.Type.COMPOUND the left and right POS are the same.

      Specified by:
      getRightPOS in interface KoMorphData
    • getReading

      public String getReading(int morphId)
      Description copied from interface: KoMorphData
      Get the reading of specified word (mainly used for Hanja to Hangul conversion).
      Specified by:
      getReading in interface KoMorphData
    • getMorphemes

      public KoMorphData.Morpheme[] getMorphemes(int morphId, char[] surfaceForm, int off, int len)
      Description copied from interface: KoMorphData
      Get the morphemes of specified word (e.g. 가깝으나: 가깝 + 으나).
      Specified by:
      getMorphemes in interface KoMorphData
    • readString

      private String readString(int offset)
    • hasSinglePOS

      private boolean hasSinglePOS(int wordId)
    • hasReadingData

      private boolean hasReadingData(int wordId)