Example of using segment_index over wide strings
#include <boost/locale.hpp>
#include <iostream>
#include <cassert>
#include <ctime>
int main()
{
using namespace boost::locale;
using namespace std;
locale loc=gen("");
locale::global(loc);
wcout.imbue(loc);
std::ios_base::sync_with_stdio(false);
wstring text=L"Hello World! あにま! Linux2.6 and Windows7 is word and number. שָלוֹם עוֹלָם!";
wcout<<text<<endl;
for(p=index.begin(),e=index.end();p!=e;++p) {
wcout<<L"Part ["<<*p<<L"] has ";
wcout<<L"number(s) ";
wcout<<L"letter(s) ";
wcout<<L"kana character(s) ";
wcout<<L"ideographic character(s) ";
wcout<<L"no word characters";
wcout<<endl;
}
for(p=index.begin(),e=index.end();p!=e;++p) {
wcout<<L"|" <<*p ;
}
wcout<<L"|\n\n";
for(p=index.begin(),e=index.end();p!=e;++p) {
wcout<<L"|" <<*p ;
}
wcout<<L"|\n\n";
for(p=index.begin(),e=index.end();p!=e;++p) {
wcout<<L"|" <<*p ;
}
wcout<<"|\n\n";
}