2013-11-28 16:47:57 +01:00
|
|
|
#ifndef INDEX_SEARCHER_HDR
|
|
|
|
#define INDEX_SEARCHER_HDR
|
|
|
|
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
2015-04-15 10:55:26 +02:00
|
|
|
#include <vector>
|
2013-11-28 16:47:57 +01:00
|
|
|
|
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-05-14 16:29:44 +02:00
|
|
|
#include "concordia/anubis_searcher.hpp"
|
2014-03-11 14:29:30 +01:00
|
|
|
#include "concordia/anubis_search_result.hpp"
|
2013-11-28 16:47:57 +01:00
|
|
|
|
2014-04-29 14:46:04 +02:00
|
|
|
#include <divsufsort.h>
|
2014-02-20 18:46:04 +01:00
|
|
|
|
2013-11-28 16:47:57 +01:00
|
|
|
/*!
|
|
|
|
Class for searching the index with a sentence.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
class IndexSearcher {
|
|
|
|
public:
|
|
|
|
explicit IndexSearcher();
|
|
|
|
|
|
|
|
/*! Destructor.
|
|
|
|
*/
|
|
|
|
virtual ~IndexSearcher();
|
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::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,
|
2015-04-15 14:14:10 +02:00
|
|
|
const std::string & pattern) throw(ConcordiaException);
|
2014-03-11 14:29:30 +01:00
|
|
|
|
2015-04-15 14:14:10 +02:00
|
|
|
std::vector<AnubisSearchResult> anubisSearch(
|
2014-03-11 14:29:30 +01:00
|
|
|
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,
|
2015-04-15 14:14:10 +02:00
|
|
|
const std::string & pattern) throw(ConcordiaException);
|
2013-11-28 16:47:57 +01:00
|
|
|
private:
|
2014-05-14 16:29:44 +02:00
|
|
|
boost::shared_ptr<AnubisSearcher> _anubisSearcher;
|
2013-11-28 16:47:57 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|