25 #ifndef DATABASECONNECTOR_H 26 #define DATABASECONNECTOR_H 32 #include "../../core/logger.h" 38 typedef std::vector<std::string>
Ngram;
48 const bool read_write);
51 const bool read_write,
52 const std::string& log_level);
75 const int count_threshold,
76 int limit = -1)
const;
146 const int count_threshold)
const;
170 #endif // DATABASECONNECTOR_H
bool get_read_write_mode() const
size_t get_cardinality() const
void createBigramTable() const
std::string set_database_filename(const std::string &filename)
int getNgramCount(const Ngram ngram) const
void insertNgram(const Ngram ngram, const int count) const
std::string expand_variables(std::string filename) const
void set_read_write_mode(const bool read_write)
int getUnigramCountsSum() const
virtual void openDatabase()=0
NgramTable getNgramLikeTable(const Ngram ngram, const char **filter, const int count_threshold, int limit=-1) const
void set_cardinality(const size_t cardinality)
std::string database_filename
DatabaseConnector(const std::string database_name, const size_t cardinality, const bool read_write)
void createUnigramTable() const
void removeNgram(const Ngram ngram) const
std::string buildValuesClause(const Ngram ngram, const int count) const
int extractFirstInteger(const NgramTable &) const
virtual NgramTable executeSql(const std::string query) const =0
std::vector< Ngram > NgramTable
void createTrigramTable() const
int incrementNgramCount(const Ngram ngram) const
virtual void beginTransaction() const
void updateNgram(const Ngram ngram, const int count) const
virtual void rollbackTransaction() const
std::string buildWhereClause(const Ngram ngram) const
virtual ~DatabaseConnector()
void createNgramTable(const size_t cardinality) const
std::vector< std::string > Ngram
std::string buildWhereLikeClause(const Ngram ngram, const char **filter, const int count_threshold) const
virtual void endTransaction() const
std::string buildSelectLikeClause(const int cardinality) const
std::string sanitizeString(const std::string) const
void substitute_variable_in_string(const std::string &variable_name, std::string &filepath) const
std::string get_database_filename() const
virtual void closeDatabase()=0