From 2c2bd63bbda6f78c494b23c72ad4d4cf01f55f8b Mon Sep 17 00:00:00 2001 From: Tetsuo Kiso Date: Sun, 26 Feb 2012 01:18:08 +0900 Subject: Replace string objects with const char[]. --- mert/BleuScorer.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'mert') 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 #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) { -- cgit v1.2.3