diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-09-28 16:04:52 +0100 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-09-28 16:04:52 +0100 |
commit | d90a90e61084c069addaa919023dc6896d2f401a (patch) | |
tree | 4b55330e9ebf5c0204eeb82c096946304b883d15 /klm/lm/trie.hh | |
parent | 1706bda5f393808583c6ab21a5d073b204827f52 (diff) | |
parent | 32288c27a523a1152afa019b9152f4401c3097ce (diff) |
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'klm/lm/trie.hh')
-rw-r--r-- | klm/lm/trie.hh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/klm/lm/trie.hh b/klm/lm/trie.hh index a9f5e417..06cc96ac 100644 --- a/klm/lm/trie.hh +++ b/klm/lm/trie.hh @@ -99,10 +99,11 @@ template <class Quant, class Bhiksha> class BitPackedMiddle : public BitPacked { bool FindNoProb(WordIndex word, float &backoff, NodeRange &range) const; NodeRange ReadEntry(uint64_t pointer, float &prob) { - quant_.ReadProb(base_, pointer, prob); + uint64_t addr = pointer * total_bits_; + addr += word_bits_; + quant_.ReadProb(base_, addr, prob); NodeRange ret; - // pointer/total_bits_ should always round down. - bhiksha_.ReadNext(base_, pointer + quant_.TotalBits(), pointer / total_bits_, total_bits_, ret); + bhiksha_.ReadNext(base_, addr + quant_.TotalBits(), pointer, total_bits_, ret); return ret; } |