Class BinaryDictionaryWriter
java.lang.Object
org.apache.lucene.analysis.ko.util.BinaryDictionaryWriter
- Direct Known Subclasses:
TokenInfoDictionaryWriter
,UnknownDictionaryWriter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteBuffer
private static final int
private final Class
<? extends BinaryDictionary> private int
private int
private int[]
private int
private int[]
-
Constructor Summary
ConstructorsConstructorDescriptionBinaryDictionaryWriter
(Class<? extends BinaryDictionary> implClazz, int size) -
Method Summary
Modifier and TypeMethodDescription(package private) void
addMapping
(int sourceId, int wordId) (package private) final String
int
put the entry in mapvoid
Write dictionary in fileprivate void
writeDictionary
(Path path) private void
writePosDict
(Path path) private void
private void
writeTargetMap
(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
-