00001 #ifndef SEARCH_RULE__ 00002 #define SEARCH_RULE__ 00003 00004 #include "lm/left.hh" 00005 #include "lm/word_index.hh" 00006 #include "search/types.hh" 00007 00008 #include <vector> 00009 00010 namespace search { 00011 00012 const lm::WordIndex kNonTerminal = lm::kMaxWordIndex; 00013 00014 struct ScoreRuleRet { 00015 Score prob; 00016 unsigned int oov; 00017 }; 00018 00019 // Pass <s> and </s> normally. 00020 // Indicate non-terminals with kNonTerminal. 00021 template <class Model> ScoreRuleRet ScoreRule(const Model &model, const std::vector<lm::WordIndex> &words, lm::ngram::ChartState *state_out); 00022 00023 } // namespace search 00024 00025 #endif // SEARCH_RULE__