https://github.com/simongog/sdsl-lite
Raw File
Tip revision: e0145d9d9bc7ed06495c8ef8d9eec12d312f1b84 authored by Simon Gog on 15 November 2016, 07:48:33 UTC
Merge branch 'hyb_sd_vector_slow' of github.com:simongog/sdsl-lite into hyb_sd_vector_slow
Tip revision: e0145d9
expl-14.cpp
#include <sdsl/wavelet_trees.hpp>
#include <iostream>

using namespace std;
using namespace sdsl;

int main()
{
    wt_hutu<rrr_vector<63>> wt;
    construct_im(wt, "こんにちは世界", 1);
    for (size_t i=0; i < wt.size(); ++i)
        cout << wt[i];
    cout << endl;
    auto t1 = wt.lex_count(0, wt.size(), 0x80);
    auto t2 = wt.lex_count(0, wt.size(), 0xbf);
    cout << "# of bytes        : " << wt.size() << endl;
    cout << "# of UTF-8 symbols: " << get<1>(t1) + get<2>(t2) << endl;
}
back to top