Writer in FO and Data structures. More...
#include <Oracle_learn.hpp>
Protected Attributes | |
O_oracle * | oracle |
FO structure to write in. | |
O_data * | data |
Data structure to write in. | |
Public Member Functions | |
Constructors & Destructors | |
O_learner () | |
Default constructor. | |
O_learner (O_oracle &, O_data &) | |
Create a learner from FO & Data structures. | |
~O_learner () | |
Standard destructor. | |
Set & Get | |
O_oracle * | get_oracle () |
Return a pointer to FO structure. | |
void | set_oracle (O_oracle &) |
Set the FO structure to write in. | |
O_data * | get_data () |
Return a pointer to Data structure. | |
void | set_data (O_data &) |
Set the Data structure to write in. | |
Build | |
template<class O_DataType > | |
int | add (O_DataType &) |
Add a data state and build FO in consequence. | |
int | lrs (O_state &, O_state &) |
Compute the length of common suffix. | |
template<class O_DataType > | |
int | search_trans (O_state &, O_DataType &) |
Find transition. |
Writer in FO and Data structures.
This class implements the building algorithm of FO and writes in both FO and data structures. As the Data structure can hold different types of data, some methodes are template functions
Definition at line 25 of file Oracle_learn.hpp.
O_learner::O_learner | ( | ) |
Default constructor.
Definition at line 73 of file Oracle_learn.hpp.
int O_learner::add | ( | O_DataType & | dataIn | ) | [inline] |
Add a data state and build FO in consequence.
This function adds the data dataIn to the Data sequence structure and adds the corresponding state in Factor Oracle following the construction described in Computing repeated factors with a factor oracle from Arnaud Lefebvre and Thierry Lecroq (June 2000). This implementation adds the reverse suffix links described in Navigating the Oracle: a Heuristic Approach by Gérard Assayag and Georges Bloch (2007)
Definition at line 108 of file Oracle_learn.hpp.
Compute the length of common suffix.
Backtrack the suffix path to calculate the length of the common suffix (lrs) between state1 and state2. This algorithm is described in Computing repeated factors with a factor oracle from Arnaud Lefebvre and Thierry Lecroq (June 2000).
Definition at line 189 of file Oracle_learn.hpp.
int O_learner::search_trans | ( | O_state & | statein, | |
O_DataType & | dataIn | |||
) | [inline] |
Find transition.
Search for a transition of state statein, labelled identically to dataIn
Definition at line 171 of file Oracle_learn.hpp.