mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
change sorting mnemonic words for print out into case-insensitive
This commit is contained in:
parent
5630a62513
commit
a71a69a619
@ -270,6 +270,19 @@ std::string Mnemonic::getCompleteWordList()
|
||||
return result;
|
||||
}
|
||||
|
||||
// comparison, not case sensitive.
|
||||
bool compare_nocase(const std::string& first, const std::string& second)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
while ((i < first.length()) && (i < second.length()))
|
||||
{
|
||||
if (tolower(first[i]) < tolower(second[i])) return true;
|
||||
else if (tolower(first[i]) > tolower(second[i])) return false;
|
||||
++i;
|
||||
}
|
||||
return (first.length() < second.length());
|
||||
}
|
||||
|
||||
std::string Mnemonic::getCompleteWordListSorted()
|
||||
{
|
||||
std::shared_lock<std::shared_mutex> _lock(mWorkingMutex);
|
||||
@ -284,7 +297,7 @@ std::string Mnemonic::getCompleteWordListSorted()
|
||||
printf("missing word on %d\n", i);
|
||||
}
|
||||
}
|
||||
words.sort();
|
||||
words.sort(compare_nocase);
|
||||
|
||||
//std::string toReplaced[] = { "auml", "ouml", "uuml", "Auml", "Ouml", "Uuml", "szlig" };
|
||||
Poco::RegularExpression toReplaced[] = { "ä", "ö", "ü", "Ä", "Ö", "Ü", "ß" };
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user