diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-04-04 19:03:13 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-04-04 19:03:13 +0400 |
commit | 8a2495c96695146b1a74c5e6f71a8f6885c8c67c (patch) | |
tree | 3eb63d41efcc6851663d2d105bf6876914fa2a22 /mert/Data.cpp | |
parent | 8c5e69bb7041c2cff85193f5d7186282f7bc11be (diff) |
Use EndsWith().
Diffstat (limited to 'mert/Data.cpp')
-rw-r--r-- | mert/Data.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/mert/Data.cpp b/mert/Data.cpp index b0b8f12be..5405b0cb9 100644 --- a/mert/Data.cpp +++ b/mert/Data.cpp @@ -197,7 +197,6 @@ void Data::InitFeatureMap(const string& str) { void Data::AddFeatures(const string& str, const string& sentence_index) { - string::size_type loc; string buf = str; string substr; FeatureStats feature_entry; @@ -207,7 +206,7 @@ void Data::AddFeatures(const string& str, getNextPound(buf, substr); // no ':' -> feature value that needs to be stored - if ((loc = substr.find_last_of(":")) != substr.length()-1) { + if (!EndsWith(substr, ":")) { feature_entry.add(ConvertStringToFeatureStatsType(substr)); } else if (substr.find("_") != string::npos) { // sparse feature name? store as well |