例如考虑以下代码:
using namespace boost::locale::boundary;
boost::locale::generator gen;
std::string text = "L'homme qu'on aimait trop.";
ssegment_index map(word, text.begin(), text.end(), gen("fr_FR.UTF-8"));
for (ssegment_index::iterator it = map.begin(), e = map.end(); it != e; ++it)
std::cout << "\"" << *it << "\", ";
std::cout << std::endl;
这输出:
"L'homme", " ", "qu'on", " ", "aimait", " ", "trop", ".",
是否可以自定义边界分析,以便输出:
"L", "'", "homme", " ", "qu", "'", "on", " ", "aimait", " ", "trop", ".",
我已经阅读了http://www.boost.org/doc/libs/1_56_0/libs/locale/doc/html/boundary_analysys.html并搜索了 Stack Overflow 和 Google,但到目前为止还没有找到任何东西。