summaryrefslogtreecommitdiff
path: root/klm/lm/trie.hh
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-01-18 15:55:40 -0500
committerChris Dyer <cdyer@cs.cmu.edu>2011-01-18 15:55:40 -0500
commitd04c0ca2d9df0e147239b18e90650ca8bd51d594 (patch)
tree1e728067b0606870df89961d10922b4226e614bb /klm/lm/trie.hh
parentb49944ee0e5f347a936df244a7c354a867c79c93 (diff)
new version of klm
Diffstat (limited to 'klm/lm/trie.hh')
-rw-r--r--klm/lm/trie.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/klm/lm/trie.hh b/klm/lm/trie.hh
index 35dc2c96..6aef050c 100644
--- a/klm/lm/trie.hh
+++ b/klm/lm/trie.hh
@@ -89,9 +89,10 @@ class BitPackedMiddle : public BitPacked {
static std::size_t Size(uint64_t entries, uint64_t max_vocab, uint64_t max_next);
- void Init(void *base, uint64_t max_vocab, uint64_t max_next);
+ // next_source need not be initialized.
+ void Init(void *base, uint64_t max_vocab, uint64_t max_next, const BitPacked &next_source);
- void Insert(WordIndex word, float prob, float backoff, uint64_t next);
+ void Insert(WordIndex word, float prob, float backoff);
bool Find(WordIndex word, float &prob, float &backoff, NodeRange &range) const;
@@ -102,6 +103,8 @@ class BitPackedMiddle : public BitPacked {
private:
uint8_t backoff_bits_, next_bits_;
uint64_t next_mask_;
+
+ const BitPacked *next_source_;
};