mirror of https://github.com/kiwix/libkiwix.git
Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix
This commit is contained in:
commit
55927937dd
|
@ -24,13 +24,16 @@ namespace kiwix {
|
||||||
/* Count word */
|
/* Count word */
|
||||||
unsigned int Indexer::countWords(const string &text) {
|
unsigned int Indexer::countWords(const string &text) {
|
||||||
unsigned int numWords = 1;
|
unsigned int numWords = 1;
|
||||||
for(unsigned int i=0; i<text.size();) {
|
unsigned int length = text.size();
|
||||||
while(i<text.size() && text[i] != ' ') {
|
|
||||||
|
for(unsigned int i=0; i<length;) {
|
||||||
|
while(i<length && text[i] != ' ') {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
numWords++;
|
numWords++;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return numWords;
|
return numWords;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -427,6 +427,10 @@ namespace kiwix {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Manager::setBookIndex(const string id, const string path) {
|
||||||
|
return this->setBookIndex(id, path, XAPIAN);
|
||||||
|
}
|
||||||
|
|
||||||
bool Manager::setBookPath(const string id, const string path) {
|
bool Manager::setBookPath(const string id, const string path) {
|
||||||
std::vector<kiwix::Book>::iterator itr;
|
std::vector<kiwix::Book>::iterator itr;
|
||||||
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {
|
||||||
|
|
|
@ -54,6 +54,7 @@ namespace kiwix {
|
||||||
bool setCurrentBookId(const string id);
|
bool setCurrentBookId(const string id);
|
||||||
string getCurrentBookId();
|
string getCurrentBookId();
|
||||||
bool setBookIndex(const string id, const string path, const supportedIndexType type);
|
bool setBookIndex(const string id, const string path, const supportedIndexType type);
|
||||||
|
bool setBookIndex(const string id, const string path);
|
||||||
bool setBookPath(const string id, const string path);
|
bool setBookPath(const string id, const string path);
|
||||||
string addBookFromPathAndGetId(const string pathToOpen, const string pathToSave = "", const string url = "",
|
string addBookFromPathAndGetId(const string pathToOpen, const string pathToSave = "", const string url = "",
|
||||||
const bool checkMetaData = false);
|
const bool checkMetaData = false);
|
||||||
|
|
Loading…
Reference in New Issue