-#include <string>
+#include <cstdlib>
-#include <glibmm/stringutils.h>
+#include <sstream>
+#include <string>
#include "rule.h"
{
i++;
}
- setProbability(Glib::Ascii::strtod(string(ruleString, 2, i - 2)));
+
+ setProbability(strtod(string(ruleString, 2, i - 2).c_str(), NULL));
// ignore the '='
i += 2;
// probability factor
- if (_probability != 0.0)
+ if (_probability > 0.0 && _probability < 1.0)
{
- // TODO: precision
- string probabilityString(Glib::Ascii::dtostr(getProbability()), 0, 4);
+ ostringstream probabilityString;
+ probabilityString << getProbability();
+ // TODO: precision
rulesString += '(';
- rulesString += probabilityString;
+ rulesString += string(probabilityString.str(), 0, 4);
rulesString += ')';
}