#include #include #include #include "config.hpp" #include #include using namespace std; int main() { Concordia concordia("/tmp", EXAMPLES_DIR"/../tests/resources/concordia-config/concordia.cfg"); // adding sentences to index concordia.addExample(Example("Alice has a cat", 56)); concordia.addExample(Example("Alice has a dog", 23)); concordia.addExample(Example("New test product has a mistake", 321)); concordia.addExample(Example("This is just testing and it has nothing to do with the above", 14)); // generating index concordia.refreshSAfromRAM(); // searching cout << "Searching for pattern: has a" << endl; vector result = concordia.simpleSearch("has a"); // printing results for(vector::iterator it = result.begin(); it != result.end(); ++it) { cout << "Found substring in sentence: " << it->getExampleId() << " at offset: " << it->getExampleOffset() << endl; } // clearing index concordia.clearIndex(); }