mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-27 14:21:18 -04:00
+ first work to improve suggestion system
This commit is contained in:
parent
caae80611c
commit
049031850d
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user