summaryrefslogtreecommitdiffstats
path: root/src/searchindex.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2009-12-22 16:03:24 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2009-12-22 16:03:24 (GMT)
commitf4fab829c8e9b4bf54c60fd85805eb008c3838ab (patch)
treeed7891ebf8c1dbed877ba72eecb07d5da29b4978 /src/searchindex.cpp
parent4a482aae6c3ab0a02ce39a33fa14410ebaec6bc4 (diff)
downloadDoxygen-f4fab829c8e9b4bf54c60fd85805eb008c3838ab.zip
Doxygen-f4fab829c8e9b4bf54c60fd85805eb008c3838ab.tar.gz
Doxygen-f4fab829c8e9b4bf54c60fd85805eb008c3838ab.tar.bz2
Release-1.6.1-20091222
Diffstat (limited to 'src/searchindex.cpp')
-rw-r--r--src/searchindex.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/searchindex.cpp b/src/searchindex.cpp
index 378316f..654aa16 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -18,8 +18,10 @@
#include "qtbc.h"
#include "searchindex.h"
#include "config.h"
+#include "util.h"
#include <qfile.h>
#include <ctype.h>
+#include <qregexp.h>
// file format: (all multi-byte values are stored in big endian format)
@@ -100,10 +102,10 @@ static int charsToIndex(const char *word)
return c1*256+c2;
}
-void SearchIndex::addWord(const char *word,bool hiPriority)
+void SearchIndex::addWord(const char *word,bool hiPriority,bool recurse)
{
+ static QRegExp nextPart("[_a-z:][A-Z]");
//printf("SearchIndex::addWord(%s,%d)\n",word,hiPriority);
- //QString wStr=QString(word).lower();
QString wStr(word);
if (wStr.isEmpty()) return;
wStr=wStr.lower();
@@ -118,6 +120,24 @@ void SearchIndex::addWord(const char *word,bool hiPriority)
m_words.insert(wStr,w);
}
w->addUrlIndex(m_urlIndex,hiPriority);
+ int i;
+ bool found=FALSE;
+ if (!recurse) // the first time we check if we can strip the prefix
+ {
+ i=getPrefixIndex(word);
+ if (i>0)
+ {
+ addWord(word+i,hiPriority,TRUE);
+ found=TRUE;
+ }
+ }
+ if (!found) // no prefix stripped
+ {
+ if ((i=nextPart.match(word))>=1)
+ {
+ addWord(word+i+1,hiPriority,TRUE);
+ }
+ }
}