dimanche 28 décembre 2014

Why boost locale didn't provide character level rule type?

Env: boost1.53.0 c++11;


New to c++.


In boost locale boundary analysis, the rule type is specified for word(eg.boundary::word_letter, boundary::word_number) and sentence , but there is no boundary rule type for character. All I want is something like isUpperCase(), isLowerCase(), isDigit(), isPunctuation().


Tried boost string algorithm which didn't work.



boost::locale::generator gen;
std::locale loc = gen("ru_RU.UTF-8");
std::string context = "ДВ";
std::cout << boost::algorithm::all(context, boost::algorithm::is_upper(loc));


Why these features can be accessed easily in Java or python but so so confusing in C++? Any consist way to achieve these?


Aucun commentaire:

Enregistrer un commentaire