diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-04-05 07:49:49 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-04-05 07:49:49 +0400 |
commit | bcc1958d9454085d558966b4be2aa2f6345b33e9 (patch) | |
tree | ab7fe0f2a1760dac304e3dc9e489f410cf5d63b4 /mert/SemposScorer.cpp | |
parent | fecee1c4fc7333e4990e3930e222234a4919cb0e (diff) |
Fix a warning; remove duplicate function calls.
Diffstat (limited to 'mert/SemposScorer.cpp')
-rw-r--r-- | mert/SemposScorer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mert/SemposScorer.cpp b/mert/SemposScorer.cpp index 62a70c510..f2879feb8 100644 --- a/mert/SemposScorer.cpp +++ b/mert/SemposScorer.cpp @@ -126,10 +126,10 @@ int SemposScorer::encodeSempos(const string& sempos) if (sempos == "-") return -1; encoding_it it = m_semposMap.find(sempos); if (it == m_semposMap.end()) { - if (m_semposMap.size() == kMaxNOC) { + const int classNumber = static_cast<int>(m_semposMap.size()); + if (classNumber == kMaxNOC) { throw std::runtime_error("Number of classes is greater than kMaxNOC"); } - const int classNumber = static_cast<int>(m_semposMap.size()); m_semposMap[sempos] = classNumber; return classNumber; } else { @@ -174,6 +174,6 @@ void SemposScorer::loadWeights(const string& weightsfile) { cerr << "Unable to open file "<< weightsfile << endl; exit(1); - } + } } |