diff options
author | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-02-25 20:18:08 +0400 |
---|---|---|
committer | Tetsuo Kiso <tetsuo-s@is.naist.jp> | 2012-02-25 20:18:08 +0400 |
commit | 2c2bd63bbda6f78c494b23c72ad4d4cf01f55f8b (patch) | |
tree | 1d3adf0271fb4ead60c41450c7108c2910e10426 /mert | |
parent | 17f06a32501289daf11181e24454a2d3f6635ba0 (diff) |
Replace string objects with const char[].
Diffstat (limited to 'mert')
-rw-r--r-- | mert/BleuScorer.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mert/BleuScorer.cpp b/mert/BleuScorer.cpp index 79f80da2e..4ab938b90 100644 --- a/mert/BleuScorer.cpp +++ b/mert/BleuScorer.cpp @@ -8,6 +8,16 @@ #include <stdexcept> #include "Util.h" +namespace { + +// configure regularisation +const char KEY_REFLEN[] = "reflen"; +const char REFLEN_AVERAGE[] = "average"; +const char REFLEN_SHORTEST[] = "shortest"; +const char REFLEN_CLOSEST[] = "closest"; + +} // namespace + // A simple STL-map based n-gram counts. // Basically, we provide typical accessors and mutaors, but // we intentionally does not allow erasing elements. @@ -77,13 +87,7 @@ BleuScorer::BleuScorer(const string& config) : StatisticsBasedScorer("BLEU", config), kLENGTH(4), m_ref_length_type(CLOSEST) { - //configure regularisation - static string KEY_REFLEN = "reflen"; - static string REFLEN_AVERAGE = "average"; - static string REFLEN_SHORTEST = "shortest"; - static string REFLEN_CLOSEST = "closest"; - - string reflen = getConfig(KEY_REFLEN,REFLEN_CLOSEST); + const string reflen = getConfig(KEY_REFLEN, REFLEN_CLOSEST); if (reflen == REFLEN_AVERAGE) { m_ref_length_type = AVERAGE; } else if (reflen == REFLEN_SHORTEST) { |