uschindler commented on PR #15237:
URL: https://github.com/apache/lucene/pull/15237#issuecomment-3339071160
Here was my quick hack to serialize the bigram dictionary with DataOutput,
size was a megabyte smaller:
```java
private void saveToObj(Path serialObj) throws IOException {
try (OutputStreamDataOutput output = new OutputStreamDataOutput(new
BufferedOutputStream(Files.newOutputStream(serialObj), 8192))) {
CodecUtil.writeHeader(output, HEADER, VERSION);
output.writeVInt(bigramHashTable.length);
for (int i = 0; i < bigramHashTable.length; i++) {
output.writeZLong(bigramHashTable[i]);
}
output.writeVInt(frequencyTable.length);
for (int i = 0; i < frequencyTable.length; i++) {
output.writeVInt(frequencyTable[i]);
}
// log.info("serialize bigram dict.");
}
}
```
I posted this here as a first idea for future (e.g., main branch).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]