summaryrefslogtreecommitdiff
path: root/klm/search/rule.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/search/rule.hh')
-rw-r--r--klm/search/rule.hh31
1 files changed, 2 insertions, 29 deletions
diff --git a/klm/search/rule.hh b/klm/search/rule.hh
index 920c64a7..0ce2794d 100644
--- a/klm/search/rule.hh
+++ b/klm/search/rule.hh
@@ -3,44 +3,17 @@
#include "lm/left.hh"
#include "lm/word_index.hh"
-#include "search/arity.hh"
#include "search/types.hh"
-#include <boost/array.hpp>
-
-#include <iosfwd>
#include <vector>
namespace search {
template <class Model> class Context;
-class Rule {
- public:
- Rule() : arity_(0) {}
-
- static const lm::WordIndex kNonTerminal = lm::kMaxWordIndex;
-
- // Use kNonTerminal for non-terminals.
- template <class Model> void Init(const Context<Model> &context, Score additive, const std::vector<lm::WordIndex> &words, bool prepend_bos);
-
- Score Bound() const { return bound_; }
-
- Score Additive() const { return additive_; }
-
- unsigned int Arity() const { return arity_; }
-
- const lm::ngram::ChartState &Lexical(unsigned int index) const {
- return lexical_[index];
- }
-
- private:
- Score bound_, additive_;
-
- unsigned int arity_;
+const lm::WordIndex kNonTerminal = lm::kMaxWordIndex;
- std::vector<lm::ngram::ChartState> lexical_;
-};
+template <class Model> float ScoreRule(const Context<Model> &context, const std::vector<lm::WordIndex> &words, bool prepend_bos, lm::ngram::ChartState *state_out);
} // namespace search