Class BinaryDictionaryWriter<T extends BinaryDictionary<? extends MorphData>>

java.lang.Object
org.apache.lucene.analysis.morph.BinaryDictionaryWriter<T>

public abstract class BinaryDictionaryWriter<T extends BinaryDictionary<? extends MorphData>> extends Object
Abstract base dictionary writer class.
  • Field Details

  • Constructor Details

  • Method Details

    • put

      public int put(String[] entry)
      put the entry in map
      Returns:
      current position of buffer, which will be wordId of next entry
    • write

      public abstract void write(Path baseDir) throws IOException
      Write whole dictionary in a directory.
      Throws:
      IOException - if an I/O error occurs writing the dictionary files
    • addMapping

      protected void addMapping(int sourceId, int wordId)
    • write

      protected void write(Path baseDir, String targetMapCodecHeader, String posDictCodecHeader, String dictCodecHeader, int dictCodecVersion) throws IOException
      Write dictionary in file Dictionary format is: [Size of dictionary(int)], [entry:{left id(short)}{right id(short)}{word cost(short)}{length of pos info(short)}{pos info(char)}], [entry...], [entry...].....
      Throws:
      IOException - if an I/O error occurs writing the dictionary files
    • getBaseFileName

      protected final String getBaseFileName()