Concordia
index_searcher.hpp
1 #ifndef INDEX_SEARCHER_HDR
2 #define INDEX_SEARCHER_HDR
3 
4 #include <boost/shared_ptr.hpp>
5 #include <fstream>
6 #include <iostream>
7 #include <vector>
8 
9 #include "concordia/common/config.hpp"
10 #include "concordia/matched_pattern_fragment.hpp"
11 #include "concordia/hash_generator.hpp"
12 #include "concordia/concordia_exception.hpp"
13 #include "concordia/concordia_searcher.hpp"
14 #include "concordia/anubis_search_result.hpp"
15 
16 #include <divsufsort.h>
17 
28 public:
31  explicit IndexSearcher();
32 
35  virtual ~IndexSearcher();
36 
49  boost::shared_ptr<HashGenerator> hashGenerator,
50  boost::shared_ptr<std::vector<sauchar_t> > T,
51  boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
52  boost::shared_ptr<std::vector<saidx_t> > SA,
53  const std::string & pattern,
54  bool byWhitespace = false) throw(ConcordiaException);
55 
71  boost::shared_ptr<HashGenerator> hashGenerator,
72  boost::shared_ptr<std::vector<sauchar_t> > T,
73  boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
74  boost::shared_ptr<std::vector<saidx_t> > SA,
75  const std::string & pattern,
76  bool byWhitespace = false) throw(ConcordiaException);
77 
78  SUFFIX_MARKER_TYPE countOccurences(
79  boost::shared_ptr<HashGenerator> hashGenerator,
80  boost::shared_ptr<std::vector<sauchar_t> > T,
81  boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
82  boost::shared_ptr<std::vector<saidx_t> > SA,
83  const std::string & pattern) throw(ConcordiaException);
84 
101  std::vector<AnubisSearchResult> anubisSearch(
102  boost::shared_ptr<ConcordiaConfig> config,
103  boost::shared_ptr<HashGenerator> hashGenerator,
104  boost::shared_ptr<std::vector<sauchar_t> > T,
105  boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
106  boost::shared_ptr<std::vector<saidx_t> > SA,
107  const std::string & pattern) throw(ConcordiaException);
108 
123  boost::shared_ptr<ConcordiaSearchResult> concordiaSearch(
124  boost::shared_ptr<HashGenerator> hashGenerator,
125  boost::shared_ptr<std::vector<sauchar_t> > T,
126  boost::shared_ptr<std::vector<SUFFIX_MARKER_TYPE> > markers,
127  boost::shared_ptr<std::vector<saidx_t> > SA,
128  const std::string & pattern,
129  bool byWhitespace = false) throw(ConcordiaException);
130 
131 private:
132  boost::shared_ptr<ConcordiaSearcher> _concordiaSearcher;
133 };
134 
135 #endif
Definition: concordia_exception.hpp:11
std::vector< AnubisSearchResult > anubisSearch(boost::shared_ptr< ConcordiaConfig > config, 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 std::string &pattern)
Definition: index_searcher.cpp:157
MatchedPatternFragment simpleSearch(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 std::string &pattern, bool byWhitespace=false)
Definition: index_searcher.cpp:16
boost::shared_ptr< ConcordiaSearchResult > concordiaSearch(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 std::string &pattern, bool byWhitespace=false)
Definition: index_searcher.cpp:169
IndexSearcher()
Definition: index_searcher.cpp:7
Definition: index_searcher.hpp:27
Definition: matched_pattern_fragment.hpp:21
virtual ~IndexSearcher()
Definition: index_searcher.cpp:13
MatchedPatternFragment lexiconSearch(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 std::string &pattern, bool byWhitespace=false)
Definition: index_searcher.cpp:57