8 #ifndef QNLP_CORPUS_LOADER 9 #define QNLP_CORPUS_LOADER 11 #include <unordered_map> 15 #define QNLP_DB_FILE "qnlp_tagged_corpus.sqlite" 35 typedef std::unordered_map<std::string, std::unordered_map<std::string, unsigned int> >
NTB;
36 typedef std::unordered_map<std::string, std::unordered_map<unsigned int, std::string> >
BTN;
57 void loadData(
const std::string data_type,
const std::string table=
"corpus");
71 void printData(
const std::string type,
const std::string table);
std::unordered_map< std::string, std::unordered_map< unsigned int, std::string > > BTN
Database access and manipulation functions.
NTB & getNameToBin()
Get the NTB object. This is a map of maps, wherein the first key represents the grammatical type to l...
std::unordered_map< std::string, std::unordered_map< std::string, unsigned int > > NTB
void printData(const std::string type, const std::string table)
Print the data with given type.
std::string database_filename
CorpusUtils()
Construct a new Load Corpus object. Database name taken from the macro/compiler defined value.
BTN & getBinToName()
Get the BTN object. This is a map of maps, wherein the first key represents the grammatical type to l...
void loadData(const std::string data_type, const std::string table="corpus")
Loads from the database for a given data type (noun, verb, etc)
const std::string get_database_filename()
Get the database filename object.
void clearData()
Clear all loaded data.
DBHelper & getDBHelper()
Return reference to database object.