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