diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-04-10 18:36:52 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2005-04-10 18:36:52 (GMT) |
commit | 76e39987363c93fdd3f2d99ffdb9f87743d6af7c (patch) | |
tree | a604824ba5bbf13dd607ebd57c1a426a0d225d58 /src/searchindex.cpp | |
parent | c8be4837b6a2a96cc3e57aa941645b9dc017e8b2 (diff) | |
download | Doxygen-76e39987363c93fdd3f2d99ffdb9f87743d6af7c.zip Doxygen-76e39987363c93fdd3f2d99ffdb9f87743d6af7c.tar.gz Doxygen-76e39987363c93fdd3f2d99ffdb9f87743d6af7c.tar.bz2 |
Release-1.4.2-20050410
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r-- | src/searchindex.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 752d4a9..5bf510f 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -19,6 +19,7 @@ #include "searchindex.h" #include "config.h" #include <qfile.h> +#include <ctype.h> // file format: (all multi-byte values are stored in big endian format) @@ -75,15 +76,24 @@ void SearchIndex::setCurrentDoc(const char *name,const char *baseName,const char m_urls.insert(m_urlIndex,new URL(name,url)); } - static int charsToIndex(const char *word) { if (word==0) return -1; - uint c1=word[0]; - if (c1==0) return -1; - uint c2=word[1]; - if (c2==0) return -1; - return c1*256+c2; + + register ushort h=0; + const char *k = word; + ushort mask=0xfc00; + while ( *k ) + { + h = (h&mask)^(h<<6)^(*k++); + } + + //uint c1=word[0]; + //if (c1==0) return -1; + //uint c2=word[1]; + //if (c2==0) return -1; + //return c1*256+c2; + return h; } void SearchIndex::addWord(const char *word,bool hiPriority) @@ -91,6 +101,7 @@ void SearchIndex::addWord(const char *word,bool hiPriority) //printf("SearchIndex::addWord(%s,%d)\n",word,hiPriority); //QString wStr=QString(word).lower(); QString wStr(word); + wStr=wStr.lower(); if (wStr.isEmpty()) return; IndexWord *w = m_words[wStr]; if (w==0) |