Package org.apache.lucene.analysis.morph
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 Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
BinaryDictionaryWriter
(Class<T> implClazz, DictionaryEntryWriter entryWriter) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addMapping
(int sourceId, int wordId) protected final String
int
put the entry in mapabstract void
Write whole dictionary in a directory.protected void
write
(Path baseDir, String targetMapCodecHeader, String posDictCodecHeader, String dictCodecHeader, int dictCodecVersion) 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...].....
-
Field Details
-
entryWriter
-
-
Constructor Details
-
BinaryDictionaryWriter
-
-
Method Details
-
put
put the entry in map- Returns:
- current position of buffer, which will be wordId of next entry
-
write
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
-