Update the dictionary and the transforms.

This commit is contained in:
Zoltan Szabadka
2014-03-25 16:48:25 +01:00
parent 494c85cebb
commit 0829e37293
9 changed files with 22402 additions and 11441 deletions
+3 -2
View File
@@ -909,12 +909,13 @@ void BrotliCompressor::StoreDictionaryWordHashes() {
if (static_dictionary_ == NULL) {
static_dictionary_ = new StaticDictionary;
for (int t = num_transforms - 1; t >= 0; --t) {
for (int i = kMaxDictionaryWordLength; i >= 3; --i) {
for (int i = kMaxDictionaryWordLength;
i >= kMinDictionaryWordLength; --i) {
const int num_words = 1 << kBrotliDictionarySizeBitsByLength[i];
for (int j = num_words - 1; j >= 0; --j) {
int word_id = t * num_words + j;
std::string word = GetTransformedDictionaryWord(i, word_id);
if (word.size() >= 3) {
if (word.size() >= 4) {
static_dictionary_->Insert(word, i, word_id);
}
}