-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (22 loc) · 735 Bytes
/
Copy pathmain.cpp
File metadata and controls
30 lines (22 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include "include/Wavelet.hpp"
#include "include/FMIndex.hpp"
#include "include/RIndex.hpp"
using namespace std;
int main() {
string input = "mississippi";
string pattern = "pp";
Wavelet tree(input);
cout << "Wavelet tree: " << endl;
tree.print();
cout << endl;
cout << "Input: " << input << endl;
cout << "Pattern: " << pattern << endl;
FMIndex fm_index(input);
fm_index.print_pattern_offsets(pattern);
cout << "Count of pattern appearances in text: " << fm_index.count(pattern) << endl;
RIndex r_index(input);
r_index.print_pattern_offsets(pattern);
cout << "Count of pattern appearances in text: " << r_index.count(pattern) << endl;
return 0;
}