+ first work to improve suggestion system

This commit is contained in:
kelson42 2012-11-07 09:23:11 +00:00
parent caae80611c
commit 049031850d

View File

@ -19,17 +19,25 @@
#include <getopt.h> #include <getopt.h>
#include <unistd.h> #include <unistd.h>
#include <string>
#include <map>
#include <tree.h>
#include <kiwix/reader.h> #include <kiwix/reader.h>
void usage() { void usage() {
cout << "Usage: kiwix-read ZIM_FILE_PATH" << endl; cout << "Usage: kiwix-read --suggest=<PATTERN> ZIM_FILE_PATH" << endl;
exit(1); exit(1);
} }
void updateSuggestionTree(tree<pair<string, unsigned>> &suggestionTree, string suggestion) {
return;
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
/* Init the variables */ /* Init the variables */
const char *filePath = NULL; const char *filePath = NULL;
const char *suggestion = NULL;
int option_index = 0; int option_index = 0;
int c = 0; int c = 0;
@ -78,9 +86,15 @@ int main(int argc, char **argv) {
string contentType; string contentType;
unsigned int contentLength = 0; unsigned int contentLength = 0;
/*
if (reader->getContentByUrl(mainPageUrl, content, contentLength, contentType)) { if (reader->getContentByUrl(mainPageUrl, content, contentLength, contentType)) {
cout << content << endl; cout << content << endl;
} }
*/
tree<pair<string, unsigned>> tree;
updateSuggestionTree(tree, string(suggestion));
delete reader; delete reader;
} else { } else {
cerr << "Unable instanciate the Kiwix reader." << endl; cerr << "Unable instanciate the Kiwix reader." << endl;