File: expl-14.cpp

package info (click to toggle)
libsdsl 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 3,980 kB
  • sloc: cpp: 42,286; makefile: 1,171; ansic: 318; sh: 201; python: 27
file content (18 lines) | stat: -rw-r--r-- 502 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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;
}