How do we create custom dictionaries? #247

Closed
opened 2026-01-29 20:40:40 +00:00 by claunia · 1 comment
Owner

Originally created by @JoeUX on GitHub (Jul 13, 2018).

As per Jyrki's request, I'm filing this issue: How do we create custom dictionaries? I haven't found any user docs on it.

For example, with Zstd we would do something like:

zstd --train FullPathToTrainingSet/* -o dictionaryName

Then we'd compress and decompress with that custom generated dictionary. I've trained dictionaries on JS libraries, jquery, etc. to good effect.

How do we do this with brotli? Also, is the custom dictionary included in the compressed file or is it freestanding? (Zstd's is freestanding – you can't decompress without having the dictionary file, kind of like protobuf message types.)

Originally created by @JoeUX on GitHub (Jul 13, 2018). As per Jyrki's request, I'm filing this issue: How do we create custom dictionaries? I haven't found any user docs on it. For example, with Zstd we would do something like: `zstd --train FullPathToTrainingSet/* -o dictionaryName` Then we'd compress and decompress with that custom generated dictionary. I've trained dictionaries on JS libraries, jquery, etc. to good effect. How do we do this with brotli? Also, is the custom dictionary included in the compressed file or is it freestanding? (Zstd's is freestanding – you can't decompress without having the dictionary file, kind of like protobuf message types.)
Author
Owner

@eustas commented on GitHub (Jul 17, 2018):

Dictionary is freestanding.
There is dictionary_generator tool in research/ that generates dictionaries.
Currently there is only Bazel build file for the tool.
Going to add CMake, make, etc. build files soon and move the tool to c/tools/

@eustas commented on GitHub (Jul 17, 2018): Dictionary is freestanding. There is `dictionary_generator` tool in `research/` that generates dictionaries. Currently there is only `Bazel` build file for the tool. Going to add CMake, make, etc. build files soon and move the tool to `c/tools/`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#247