diff options
author | Jonathan Clark <jon.h.clark@gmail.com> | 2011-03-24 09:51:40 -0400 |
---|---|---|
committer | Jonathan Clark <jon.h.clark@gmail.com> | 2011-03-24 09:51:40 -0400 |
commit | eb33700d1c868662b5d0abedaaf3fa47948a89d0 (patch) | |
tree | ed70be84820d243524bab0b59a84b8da033a9c41 /decoder/trule.cc | |
parent | ba4f147f84aa0d4623da640a2d0de7e6242a53af (diff) | |
parent | a580faa8177331cf51138a2208e276b703470934 (diff) |
Undo some silly local changes so we can pull
Diffstat (limited to 'decoder/trule.cc')
-rw-r--r-- | decoder/trule.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/decoder/trule.cc b/decoder/trule.cc index 9820e6d5..40235542 100644 --- a/decoder/trule.cc +++ b/decoder/trule.cc @@ -5,7 +5,6 @@ #include "stringlib.h" #include "tdict.h" #include "rule_lexer.h" -#include "threadlocal.h" using namespace std; @@ -99,7 +98,7 @@ TRule* TRule::CreateRuleMonolingual(const string& rule) { namespace { // callback for lexer -THREADLOCAL int n_assigned=0; +int n_assigned=0; void assign_trule(const TRulePtr& new_rule, const unsigned int ctf_level, const TRulePtr& coarse_rule, void* extra) { TRule *assignto=(TRule *)extra; *assignto=*new_rule; @@ -145,7 +144,9 @@ bool TRule::ReadFromString(const string& line, bool strict, bool mono) { getline(is, ss); //cerr << "L: " << ss << endl; int start = 0; - const int len = ss.size(); + int len = ss.size(); + const size_t ppos = ss.find(" |||"); + if (ppos != string::npos) { len = ppos; } while (start < len) { while(start < len && (ss[start] == ' ' || ss[start] == ';')) ++start; |