summaryrefslogtreecommitdiff
path: root/klm/lm/trie.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2011-10-19 14:02:34 +0200
committerPatrick Simianer <p@simianer.de>2011-10-19 14:02:34 +0200
commit9beaeb42b71fa504bfa41a402cb17eb6ac4001af (patch)
tree0add4afabc526391753e4e6b9443a7bf21e3e2c3 /klm/lm/trie.cc
parentce3b4db94d40c111ede321ac6de2bb061a81c4af (diff)
parent09297047e446f49804d3f48bf320cdbd38d6396a (diff)
merge upstream/master
Diffstat (limited to 'klm/lm/trie.cc')
-rw-r--r--klm/lm/trie.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/klm/lm/trie.cc b/klm/lm/trie.cc
index 8c536e66..a1136b6f 100644
--- a/klm/lm/trie.cc
+++ b/klm/lm/trie.cc
@@ -86,11 +86,12 @@ 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;
}
+<<<<<<< HEAD
uint64_t index = at_pointer;
at_pointer *= total_bits_;
at_pointer += word_bits_;
@@ -98,6 +99,16 @@ template <class Quant, class Bhiksha> bool BitPackedMiddle<Quant, Bhiksha>::Find
at_pointer += quant_.TotalBits();
bhiksha_.ReadNext(base_, at_pointer, index, total_bits_, range);
+=======
+ pointer = at_pointer;
+ at_pointer *= total_bits_;
+ at_pointer += word_bits_;
+
+ quant_.Read(base_, at_pointer, prob, backoff);
+ at_pointer += quant_.TotalBits();
+
+ bhiksha_.ReadNext(base_, at_pointer, pointer, total_bits_, range);
+>>>>>>> upstream/master
return true;
}