diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-06-19 15:06:34 +0100 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-06-19 15:06:34 +0100 |
commit | 34d8d1a1df61a1f9409e6d205ecfa1b7cfb70562 (patch) | |
tree | 8b9d8072cae6ac024b46196c4712a5f02afc33c0 /klm/lm/virtual_interface.hh | |
parent | a3243017d6b8c46cc3e41f4243311dc3dbc80ab4 (diff) | |
parent | f1ce46ec9b1b8efcc4a91a149454acf03c01db02 (diff) |
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'klm/lm/virtual_interface.hh')
-rw-r--r-- | klm/lm/virtual_interface.hh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/klm/lm/virtual_interface.hh b/klm/lm/virtual_interface.hh index 6a5a0196..17f064b2 100644 --- a/klm/lm/virtual_interface.hh +++ b/klm/lm/virtual_interface.hh @@ -6,6 +6,7 @@ #include "util/string_piece.hh" #include <string> +#include <string.h> namespace lm { namespace base { @@ -119,7 +120,9 @@ class Model { size_t StateSize() const { return state_size_; } const void *BeginSentenceMemory() const { return begin_sentence_memory_; } + void BeginSentenceWrite(void *to) const { memcpy(to, begin_sentence_memory_, StateSize()); } const void *NullContextMemory() const { return null_context_memory_; } + void NullContextWrite(void *to) const { memcpy(to, null_context_memory_, StateSize()); } // Requires in_state != out_state virtual float Score(const void *in_state, const WordIndex new_word, void *out_state) const = 0; |