diff options
author | phikoehn <pkoehn@inf.ed.ac.uk> | 2013-05-17 11:37:29 +0400 |
---|---|---|
committer | phikoehn <pkoehn@inf.ed.ac.uk> | 2013-05-17 11:37:29 +0400 |
commit | 4cdffc8a891a3004a0102aa77ae26ceb91a1e881 (patch) | |
tree | 815350e8007c863a098d04689bd35177cc61569b /mert/FeatureStats.cpp | |
parent | 13991fc88fc6184139db46aa306789d855ef54cd (diff) |
fixes for sparse feature handling
Diffstat (limited to 'mert/FeatureStats.cpp')
-rw-r--r-- | mert/FeatureStats.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mert/FeatureStats.cpp b/mert/FeatureStats.cpp index 22f62e234..242d3fbd0 100644 --- a/mert/FeatureStats.cpp +++ b/mert/FeatureStats.cpp @@ -220,12 +220,12 @@ void FeatureStats::set(string &theString, const SparseVector& sparseWeights ) while (!theString.empty()) { getNextPound(theString, substring); // regular feature - if (substring.find(":") == string::npos) { + if (substring.find("=") == string::npos) { add(ConvertStringToFeatureStatsType(substring)); } // sparse feature else { - size_t separator = substring.find_last_of(":"); + size_t separator = substring.find_last_of("="); addSparse(substring.substr(0,separator), atof(substring.substr(separator+1).c_str()) ); } } |