84 static QRegularExpression reCapital(
"^[[:upper:]]+$", QRegularExpression::UseUnicodePropertiesOption);
85 static QRegularExpression reSmall(
"^[[:lower:]]+$", QRegularExpression::UseUnicodePropertiesOption);
86 static QRegularExpression reCapital1st(
"^[[:upper:]]\\w+$", QRegularExpression::UseUnicodePropertiesOption);
87 static QRegularExpression reAcronym(
"^([[:upper:]]\\.)+$", QRegularExpression::UseUnicodePropertiesOption);
88 static QRegularExpression reCapitalSmall(
"^([[:upper:][:lower:]])+$", QRegularExpression::UseUnicodePropertiesOption);
89 static QRegularExpression reAbbrev(
"^\\w+\\.$", QRegularExpression::UseUnicodePropertiesOption);
90 static QRegularExpression reTwitter(
"^[@#]\\w+$", QRegularExpression::UseUnicodePropertiesOption);
91 static QRegularExpression reAlphaHyphen(
"^\\w+[\\-]\\w+$", QRegularExpression::UseUnicodePropertiesOption);
94 static QRegularExpression reCardinalRoman(
"^(?=[MDCLXVI])M*(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3})$");
96 static QRegularExpression reOrdinalRoman(
"^(?=[MDCLXVI])M*(C[MD]|D?C{0,3})(X[CL]|L?X{0,3})(I[XV]|V?I{0,3})(st|nd|d|th|er|ème)$");
98 static QRegularExpression reInteger(
"^\\d+$");
100 static QRegularExpression reCommaNumber(
"^\\d+,\\d$");
102 static QRegularExpression reDotNumber(
"^\\d\\.\\d$");
104 static QRegularExpression reFraction(
"^\\d([.,]\\d+)?/\\d([.,]\\d+)?$");
106 static QRegularExpression reOrdinalInteger(
"^\\d+(st|nd|d|th|er|ème)$");
108 static QRegularExpression reAlphanumeric(
"^[\\d[:lower:][:upper:]]+$", QRegularExpression::UseUnicodePropertiesOption);
109 static QRegularExpression reSentenceBreak(
"^[;.!?]$");
112 if (reCapital.match(token.
stringForm()).hasMatch())
119 else if (reSmall.match(token.
stringForm()).hasMatch())
126 else if (reCapital1st.match(token.
stringForm()).hasMatch())
131 curSettings.
setDefaultKey(QString::fromUtf8(
"t_capital_1st"));
133 else if (reAcronym.match(token.
stringForm()).hasMatch())
140 else if (reCapitalSmall.match(token.
stringForm()).hasMatch())
145 curSettings.
setDefaultKey(QString::fromUtf8(
"t_capital_small"));
147 else if (reAbbrev.match(token.
stringForm()).hasMatch())
154 else if (reTwitter.match(token.
stringForm()).hasMatch())
161 else if (reCardinalRoman.match(token.
stringForm()).hasMatch())
166 curSettings.
setDefaultKey(QString::fromUtf8(
"t_cardinal_roman"));
168 else if (reOrdinalRoman.match(token.
stringForm()).hasMatch())
173 curSettings.
setDefaultKey(QString::fromUtf8(
"t_ordinal_roman"));
175 else if (reInteger.match(token.
stringForm()).hasMatch())
182 else if (reCommaNumber.match(token.
stringForm()).hasMatch())
187 curSettings.
setDefaultKey(QString::fromUtf8(
"t_comma_number"));
189 else if (reDotNumber.match(token.
stringForm()).hasMatch())
194 curSettings.
setDefaultKey(QString::fromUtf8(
"t_dot_number"));
196 else if (reFraction.match(token.
stringForm()).hasMatch())
203 else if (reOrdinalInteger.match(token.
stringForm()).hasMatch())
208 curSettings.
setDefaultKey(QString::fromUtf8(
"t_ordinal_integer"));
210 else if (reAlphanumeric.match(token.
stringForm()).hasMatch())
215 curSettings.
setDefaultKey(QString::fromUtf8(
"t_alphanumeric"));
217 else if (reAlphaHyphen.match(token.
stringForm()).hasMatch())
219 curSettings.
setDefaultKey(QString::fromUtf8(
"t_alpha_hyphen"));
222 else if (reSentenceBreak.match(token.
stringForm()).hasMatch())
227 curSettings.
setDefaultKey(QString::fromUtf8(
"t_sentence_brk"));