sigtest-filter can now also filter lexical reordering tables.

didn't have a significant effect on performance in my tests, but it's nice to have smaller tables.
This commit is contained in:
Rico Sennrich 2012-07-12 16:04:23 +02:00
parent bed4bc08ad
commit c9f2f73de3

View File

@ -99,10 +99,15 @@ PTEntry::PTEntry(const std::string& str, int index) :
pos = nextPos + SEPARATOR.size();
nextPos = str.find(SEPARATOR, pos);
this->scores = str.substr(pos,nextPos-pos);
if (nextPos < str.size()) {
this->scores = str.substr(pos,nextPos-pos);
pos = nextPos + SEPARATOR.size();
this->extra = str.substr(pos);
pos = nextPos + SEPARATOR.size();
this->extra = str.substr(pos);
}
else {
this->scores = str.substr(pos,str.size()-pos);
}
int c = 0;
std::string::iterator i=scores.begin();