Class BinaryDictionaryWriter
java.lang.Object
org.apache.lucene.analysis.ko.util.BinaryDictionaryWriter
- Direct Known Subclasses:
TokenInfoDictionaryWriter,UnknownDictionaryWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteBufferprivate static final intprivate final Class<? extends BinaryDictionary> private intprivate intprivate int[]private intprivate int[] -
Constructor Summary
ConstructorsConstructorDescriptionBinaryDictionaryWriter(Class<? extends BinaryDictionary> implClazz, int size) -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddMapping(int sourceId, int wordId) (package private) final Stringintput the entry in mapvoidWrite dictionary in fileprivate voidwriteDictionary(Path path) private voidwritePosDict(Path path) private voidprivate voidwriteTargetMap(Path path)
-
Field Details
-
ID_LIMIT
private static final int ID_LIMIT- See Also:
-
implClazz
-
buffer
-
targetMapEndOffset
private int targetMapEndOffset -
lastWordId
private int lastWordId -
lastSourceId
private int lastSourceId -
targetMap
private int[] targetMap -
targetMapOffsets
private int[] targetMapOffsets -
posDict
-
-
Constructor Details
-
BinaryDictionaryWriter
BinaryDictionaryWriter(Class<? extends BinaryDictionary> implClazz, int size)
-
-
Method Details
-
put
put the entry in mapmecab-ko-dic features
0 - surface 1 - left cost 2 - right cost 3 - word cost 4 - part of speech0+part of speech1+... 5 - semantic class 6 - T if the last character of the surface form has a coda, F otherwise 7 - reading 8 - POS type (*, Compound, Inflect, Preanalysis) 9 - left POS 10 - right POS 11 - expression
- Returns:
- current position of buffer, which will be wordId of next entry
-
writeString
-
addMapping
void addMapping(int sourceId, int wordId) -
getBaseFileName
-
write
Write dictionary in file- Throws:
IOException- if an I/O error occurs writing the dictionary files
-
writeTargetMap
- Throws:
IOException
-
writePosDict
- Throws:
IOException
-
writeDictionary
- Throws:
IOException
-