summaryrefslogtreecommitdiff
path: root/klm/lm/model.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/lm/model.hh')
-rw-r--r--klm/lm/model.hh9
1 files changed, 3 insertions, 6 deletions
diff --git a/klm/lm/model.hh b/klm/lm/model.hh
index 8183bdf5..fd9640c3 100644
--- a/klm/lm/model.hh
+++ b/klm/lm/model.hh
@@ -4,6 +4,7 @@
#include "lm/binary_format.hh"
#include "lm/config.hh"
#include "lm/facade.hh"
+#include "lm/max_order.hh"
#include "lm/search_hashed.hh"
#include "lm/search_trie.hh"
#include "lm/vocab.hh"
@@ -19,12 +20,6 @@ namespace util { class FilePiece; }
namespace lm {
namespace ngram {
-// If you need higher order, change this and recompile.
-// Having this limit means that State can be
-// (kMaxOrder - 1) * sizeof(float) bytes instead of
-// sizeof(float*) + (kMaxOrder - 1) * sizeof(float) + malloc overhead
-const unsigned char kMaxOrder = 6;
-
// This is a POD but if you want memcmp to return the same as operator==, call
// ZeroRemaining first.
class State {
@@ -56,6 +51,8 @@ class State {
}
}
+ unsigned char ValidLength() const { return valid_length_; }
+
// You shouldn't need to touch anything below this line, but the members are public so FullState will qualify as a POD.
// This order minimizes total size of the struct if WordIndex is 64 bit, float is 32 bit, and alignment of 64 bit integers is 64 bit.
WordIndex history_[kMaxOrder - 1];