Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphikoehn <pkoehn@inf.ed.ac.uk>2013-05-17 11:37:29 +0400
committerphikoehn <pkoehn@inf.ed.ac.uk>2013-05-17 11:37:29 +0400
commit4cdffc8a891a3004a0102aa77ae26ceb91a1e881 (patch)
tree815350e8007c863a098d04689bd35177cc61569b /mert/FeatureStats.cpp
parent13991fc88fc6184139db46aa306789d855ef54cd (diff)
fixes for sparse feature handling
Diffstat (limited to 'mert/FeatureStats.cpp')
-rw-r--r--mert/FeatureStats.cpp4
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()) );
}
}