From 1d25b3e4068ace2461beeb506dc88b152ab9caa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olivier=20Teuli=C3=A8re?= Date: Wed, 25 Sep 2013 20:44:29 +0200 Subject: [PATCH] Force the case of dictionary words, to avoid weird sorting issues --- dic/compdic.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dic/compdic.cpp b/dic/compdic.cpp index 958540b..0e490d7 100644 --- a/dic/compdic.cpp +++ b/dic/compdic.cpp @@ -1,6 +1,6 @@ /***************************************************************************** * Eliot - * Copyright (C) 1999-2012 Antoine Fraboulet & Olivier Teulière + * Copyright (C) 1999-2013 Antoine Fraboulet & Olivier Teulière * Authors: Antoine Fraboulet * Olivier Teulière * @@ -170,7 +170,11 @@ void CompDic::loadWordList(const string &iFileName, vector &oWordList) // Ignore empty lines if (line == "") continue; - oWordList.push_back(readFromUTF8(line, "loadWordList")); + // Ensure the word is in upper case + wstring wstr = readFromUTF8(line, "loadWordList"); + std::transform(wstr.begin(), wstr.end(), wstr.begin(), towupper); + + oWordList.push_back(wstr); } // Sort the word list, to perform a better compression