2013-11-28 16:47:57 +01:00
|
|
|
#ifndef INDEX_SEARCHER_HDR
|
|
|
|
#define INDEX_SEARCHER_HDR
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
2014-02-20 10:49:17 +01:00
|
|
|
#include <boost/ptr_container/ptr_vector.hpp>
|
2013-11-28 16:47:57 +01:00
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
|
|
|
|
2013-12-06 22:29:25 +01:00
|
|
|
#include "concordia/common/config.hpp"
|
2014-02-20 10:49:17 +01:00
|
|
|
#include "concordia/substring_occurence.hpp"
|
2013-11-28 16:47:57 +01:00
|
|
|
#include "concordia/hash_generator.hpp"
|
|
|
|
#include "concordia/concordia_exception.hpp"
|
2014-03-11 14:29:30 +01:00
|
|
|
#include "concordia/anubis_search_result.hpp"
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2014-02-20 18:46:04 +01:00
|
|
|
#include "divsufsort.h"
|
|
|
|
|
2013-11-28 16:47:57 +01:00
|
|
|
/*!
|
|
|
|
Class for searching the index with a sentence.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
class IndexSearcher {
|
|
|
|
public:
|
|
|
|
explicit IndexSearcher();
|
|
|
|
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~IndexSearcher();
|
|
|
|
|
2014-02-20 10:49:17 +01:00
|
|
|
boost::ptr_vector<SubstringOccurence> simpleSearch(
|
2013-12-14 15:23:17 +01:00
|
|
|
boost::shared_ptr<HashGenerator> hashGenerator,
|
|
|
|
boost::shared_ptr<std::vector<sauchar_t> > T,
|
2014-02-20 10:49:17 +01:00
|
|
|
boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
|
2013-12-14 15:23:17 +01:00
|
|
|
boost::shared_ptr<std::vector<saidx_t> > SA,
|
|
|
|
const string & pattern) throw(ConcordiaException);
|
2014-03-11 14:29:30 +01:00
|
|
|
|
|
|
|
boost::ptr_vector<AnubisSearchResult> anubisSearch(
|
|
|
|
boost::shared_ptr<HashGenerator> hashGenerator,
|
|
|
|
boost::shared_ptr<std::vector<sauchar_t> > T,
|
|
|
|
boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
|
|
|
|
boost::shared_ptr<std::vector<saidx_t> > SA,
|
|
|
|
const string & pattern) throw(ConcordiaException);
|
2013-11-28 16:47:57 +01:00
|
|
|
private:
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|