summaryrefslogtreecommitdiff
path: root/klm/lm/search_trie.hh
diff options
context:
space:
mode:
authorKenneth Heafield <github@kheafield.com>2013-05-19 10:02:45 -0400
committerKenneth Heafield <github@kheafield.com>2013-05-19 10:02:45 -0400
commit596033ec83d1365d7a5df31d28f91347320fe155 (patch)
tree522933405aa0f0a4eac8b0b103df5c76a9327160 /klm/lm/search_trie.hh
parent1d96c9c9c521edfca1d10e4d8c5064f79fda3ec5 (diff)
KenLM 10ddf7d92335 Comment some asserts, update uusage
Diffstat (limited to 'klm/lm/search_trie.hh')
-rw-r--r--klm/lm/search_trie.hh3
1 files changed, 2 insertions, 1 deletions
diff --git a/klm/lm/search_trie.hh b/klm/lm/search_trie.hh
index 1264baf5..60be416b 100644
--- a/klm/lm/search_trie.hh
+++ b/klm/lm/search_trie.hh
@@ -41,7 +41,8 @@ template <class Quant, class Bhiksha> class TrieSearch {
static void UpdateConfigFromBinary(int fd, const std::vector<uint64_t> &counts, Config &config) {
Quant::UpdateConfigFromBinary(fd, counts, config);
util::AdvanceOrThrow(fd, Quant::Size(counts.size(), config) + Unigram::Size(counts[0]));
- Bhiksha::UpdateConfigFromBinary(fd, config);
+ // Currently the unigram pointers are not compresssed, so there will only be a header for order > 2.
+ if (counts.size() > 2) Bhiksha::UpdateConfigFromBinary(fd, config);
}
static uint64_t Size(const std::vector<uint64_t> &counts, const Config &config) {