[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdesdk/kbabel/kbabeldict/modules/dbsearchengine2
From: Andrea Rizzi <rizzi () kde ! org>
Date: 2003-09-06 14:33:19
[Download RAW message or body]
CVS commit by andrea:
bug in simple() fixed
M +17 -11 algorithms.cpp 1.8
M +16 -5 database.cpp 1.14
--- kdesdk/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp #1.7:1.8
@@ -116,4 +116,6 @@ DataBaseInterface::ResultList ChunkByChu
int finalscore=0;
int i=0;
+ QMap<QString,bool> translationUsed;
+
//Loop on all chunk
for(AbstractChunk *it=chunks.first();it && !di->stopNow(); it=chunks.next())
@@ -138,7 +140,11 @@ DataBaseInterface::ResultList ChunkByChu
//Loop on results
+ translationUsed.clear();
for(ResultList::iterator it1=r.begin();it1!=r.end() &&!di->stopNow(); \
it1++) {
QString chunkTranslation= (*it1).result();
+ if(!translationUsed.contains(chunkTranslation))
+ {
+ translationUsed[chunkTranslation]=true;
kdDebug(0) << "a translation is: " << chunkTranslation << endl;
for(QStringList::iterator \
it2=translations.begin();it2!=translations.end() && !di->stopNow() ; it2++) @@ -149,4 \
+155,5 @@ DataBaseInterface::ResultList ChunkByChu }
}
+ }
translations=tmpTranslations;
@@ -292,5 +299,4 @@ DataBaseInterface::ResultList FuzzyChunk
{
il.insert(countpos[count],ref);
-
for(unsigned int i = nchunks;i>=count;i--)
if(countpos[i]==countpos[count])
@@ -306,5 +312,5 @@ DataBaseInterface::ResultList FuzzyChunk
for(unsigned int wf=nchunks;wf>0;wf-- ){
- for(QValueList<unsigned int>::iterator \
it=countpos[wf];it!=countpos[wf-1];it++) + for(QValueList<unsigned \
int>::iterator it=countpos[wf];it!=countpos[wf-1] ;it++) { //loop on entries with \
same number of word found DataBaseInterface::MainEntry e;
--- kdesdk/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp #1.13:1.14
@@ -497,21 +497,32 @@ QString DataBaseInterface::simple(QStrin
c=res[i];
if(c.isLetterOrNumber())
+ {
r+=c;
+ wasSpace=false;
+ }
else
{
if(!wasSpace && c.isSpace())
+ {
r+=' ';
+ wasSpace=true;
+ }
else
{
if(c=='-' || c=='\'' || c=='_')
+ {
r+=' ';
+ wasSpace=true;
+ }
else
{
- if(c=='%')
+ if(c=='%'){
r+=c;
+ wasSpace=false;
}
}
}
- wasSpace=c.isSpace();
+ }
+ // wasSpace=c.isSpace();
}
if(r[len-1].isSpace())
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic