From 8e1c05d3cfb73681475e9d431a21ccb6ced11ac5 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 3 Nov 2022 19:33:19 +0100 Subject: [PATCH] dialog:: refactor hasInfix --- dialogs.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dialogs.cpp b/dialogs.cpp index 852a7f5c..84ffe124 100644 --- a/dialogs.cpp +++ b/dialogs.cpp @@ -1513,8 +1513,7 @@ EX namespace dialog { string foreign_letters = "ÁÄÇÈÉÍÎÖÚÜßàáâãäçèéêìíîïòóôõöøùúüýąćČčĎďĘęĚěğİıŁłńňŘřŚśŞşŠšŤťůŹźŻżŽž"; string latin_letters = "AACEEIIOUUsAAAAACEEEIIIIOOOOOOUUUYACCCDDEEEEGIILLNNRRSSSSSSTTUZZZZZZ"; - EX bool hasInfix(const string &s) { - if(infix == "") return true; + EX string human_simplify(const string &s, bool include_symbols) { string t = ""; for(int i=0; i= 'a' && c <= 'z') tt += c - 32; else if(c >= 'A' && c <= 'Z') tt += c; else if(c == '@') tt += c; + else if(include_symbols && c > 0) tt += c; if(tt == 0) for(int k=0; k= 'A' && uni <= 'Z') infix += uni; else if(uni >= 'a' && uni <= 'z') infix += uni-32;