2012-10-15 16:58:33 +04:00
|
|
|
#ifndef SEARCH_RULE__
|
|
|
|
#define SEARCH_RULE__
|
|
|
|
|
|
|
|
#include "lm/left.hh"
|
|
|
|
#include "lm/word_index.hh"
|
|
|
|
#include "search/types.hh"
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace search {
|
|
|
|
|
|
|
|
const lm::WordIndex kNonTerminal = lm::kMaxWordIndex;
|
|
|
|
|
2012-11-15 22:04:07 +04:00
|
|
|
struct ScoreRuleRet {
|
|
|
|
Score prob;
|
|
|
|
unsigned int oov;
|
|
|
|
};
|
|
|
|
|
2015-04-30 08:05:11 +03:00
|
|
|
// Pass <s> and </s> normally.
|
|
|
|
// Indicate non-terminals with kNonTerminal.
|
2012-11-15 22:04:07 +04:00
|
|
|
template <class Model> ScoreRuleRet ScoreRule(const Model &model, const std::vector<lm::WordIndex> &words, lm::ngram::ChartState *state_out);
|
2012-10-15 16:58:33 +04:00
|
|
|
|
|
|
|
} // namespace search
|
|
|
|
|
|
|
|
#endif // SEARCH_RULE__
|