11 #include <unordered_map> 49 if(last_added_sl != root) {
65 return pos - node->
start+1;
75 STNode(
int s,
int e = 0) : start(s), end (e) {}
136 inline void add_char(
char c){
142 while(remainder > 0){
143 if(active_length==0){
153 auto next_it = active_inner->
child_nodes.find(active_edge);
159 new_leaf->
suffix=suffix++;
160 add_sl(active_inner);
170 active_edge = Text[pos-active_length];
175 if(Text[next->
start +active_length] == c){
177 add_sl(active_inner);
196 if(active_node==root && active_length>0){
198 active_edge = Text[pos-remainder+1];
219 for(
uint i = 0; i<input.length();i++){
231 for (
uint i = 0; i < input.
size(); i++) {
232 uint8_t c = input[i];
Contains the text compression and encoding framework.
void append_input(Input &input)
void append_input(io::InputView &input)
SuffixTree(std::string input)
size_type size() const
Returns size of the View.
STInnerNode * suffix_link
SuffixTree(io::InputView &input)
void append_string(std::string input)
SuffixTree::STNode * get_root()
std::string get_string_of_edge(STNode *node)
uint edge_length(STNode *node)
std::unordered_map< char, STNode * > child_nodes
STInnerNode(int s, int e=0)