summaryrefslogtreecommitdiff
path: root/extools/featurize_grammar.cc
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-13 06:29:00 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-13 06:29:00 +0000
commitf47330182fdf2e44eb28d39d8db55deb31b54d1f (patch)
tree4b074d1f5a22d899a55ba2017ebc3ce5e65693ba /extools/featurize_grammar.cc
parent2dc76ceae3dfbe333b6b404e5b1298be99b211c9 (diff)
start moving toward striped grammar lexer
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@233 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'extools/featurize_grammar.cc')
-rw-r--r--extools/featurize_grammar.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/extools/featurize_grammar.cc b/extools/featurize_grammar.cc
index 27c0dadf..547f390a 100644
--- a/extools/featurize_grammar.cc
+++ b/extools/featurize_grammar.cc
@@ -21,6 +21,7 @@
#include "tdict.h"
#include "lex_trans_tbl.h"
#include "filelib.h"
+#include "striped_grammar.h"
#include <boost/tuple/tuple.hpp>
#include <boost/shared_ptr.hpp>
@@ -137,7 +138,6 @@ bool validate_non_terminal(const std::string& s)
namespace {
inline bool IsWhitespace(char c) { return c == ' ' || c == '\t'; }
- inline bool IsBracket(char c){return c == '[' || c == ']';}
inline void SkipWhitespace(const char* buf, int* ptr) {
while (buf[*ptr] && IsWhitespace(buf[*ptr])) { ++(*ptr); }
}
@@ -407,7 +407,7 @@ struct BackoffRule : public FeatureExtractor {
const RuleStatistics& /*info*/,
SparseVector<float>* result) const {
(void) lhs; (void) src; (void) trg;
- string lhstr = TD::Convert(lhs);
+ const string& lhstr = TD::Convert(lhs);
if(lhstr.find('_')!=string::npos)
result->set_value(fid_, -1);
}