Merge branch 'master' of ssh://git.code.sf.net/p/kiwix/kiwix

This commit is contained in:
Julian Harty 2014-09-11 16:05:27 +01:00
commit 55927937dd
3 changed files with 10 additions and 2 deletions

View File

@ -24,13 +24,16 @@ namespace kiwix {
/* Count word */
unsigned int Indexer::countWords(const string &text) {
unsigned int numWords = 1;
for(unsigned int i=0; i<text.size();) {
while(i<text.size() && text[i] != ' ') {
unsigned int length = text.size();
for(unsigned int i=0; i<length;) {
while(i<length && text[i] != ' ') {
i++;
}
numWords++;
i++;
}
return numWords;
}

View File

@ -427,6 +427,10 @@ namespace kiwix {
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) {
std::vector<kiwix::Book>::iterator itr;
for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) {

View File

@ -54,6 +54,7 @@ namespace kiwix {
bool setCurrentBookId(const string id);
string getCurrentBookId();
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);
string addBookFromPathAndGetId(const string pathToOpen, const string pathToSave = "", const string url = "",
const bool checkMetaData = false);