summaryrefslogtreecommitdiff
path: root/klm/lm/trie.cc
diff options
context:
space:
mode:
authorKenneth Heafield <kenlm@kheafield.com>2011-09-21 18:23:50 -0400
committerKenneth Heafield <kenlm@kheafield.com>2011-09-21 18:23:50 -0400
commit83cae8bd92a2ebffcf2b8b4d2500766da008fe3d (patch)
tree575a54bbebc74eaafef6e9ebe4b37e6ad211b632 /klm/lm/trie.cc
parent4b619c0ca5b8c521c6fb4c3df1c4b43756baa306 (diff)
Updated kenlm. Includes left state support but not the cdec-side use of it. Updated binary format.
Diffstat (limited to 'klm/lm/trie.cc')
-rw-r--r--klm/lm/trie.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/klm/lm/trie.cc b/klm/lm/trie.cc
index 8c536e66..4e60b184 100644
--- a/klm/lm/trie.cc
+++ b/klm/lm/trie.cc
@@ -86,7 +86,7 @@ template <class Quant, class Bhiksha> void BitPackedMiddle<Quant, Bhiksha>::Inse
++insert_index_;
}
-template <class Quant, class Bhiksha> bool BitPackedMiddle<Quant, Bhiksha>::Find(WordIndex word, float &prob, float &backoff, NodeRange &range) const {
+template <class Quant, class Bhiksha> bool BitPackedMiddle<Quant, Bhiksha>::Find(WordIndex word, float &prob, float &backoff, NodeRange &range, uint64_t &pointer) const {
uint64_t at_pointer;
if (!FindBitPacked(base_, word_mask_, word_bits_, total_bits_, range.begin, range.end, max_vocab_, word, at_pointer)) {
return false;
@@ -94,6 +94,9 @@ template <class Quant, class Bhiksha> bool BitPackedMiddle<Quant, Bhiksha>::Find
uint64_t index = at_pointer;
at_pointer *= total_bits_;
at_pointer += word_bits_;
+
+ pointer = at_pointer;
+
quant_.Read(base_, at_pointer, prob, backoff);
at_pointer += quant_.TotalBits();