diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-08-10 06:08:18 +0000 |
commit | 0813b39aed2cf4c84157a22c4c9594336d93d412 (patch) | |
tree | 0f6157f9c9ecc6ed26cb98f058219a8021d3f4a6 /kbabel/kbabeldict/modules/dbsearchengine2/database.cpp | |
parent | 35dc58791106d7a1864264063df5f3ee3f1f0f15 (diff) | |
download | tdesdk-0813b39aed2cf4c84157a22c4c9594336d93d412.tar.gz tdesdk-0813b39aed2cf4c84157a22c4c9594336d93d412.zip |
rename the following methods:
tqfind find
tqreplace replace
tqcontains contains
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine2/database.cpp')
-rw-r--r-- | kbabel/kbabeldict/modules/dbsearchengine2/database.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp index e5250274..1fe02198 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp @@ -282,7 +282,7 @@ bool DataBaseInterface::addEntry(TQString original,TQString translated,InputInfo TQStringList wt=words(*otIt); for(TQStringList::iterator it = wt.begin(); it!=wt.end(); ++it) { - if(correlationDiff.tqcontains(*it)) + if(correlationDiff.contains(*it)) correlationDiff[*it]--; else correlationDiff[*it]=-1; @@ -299,7 +299,7 @@ bool DataBaseInterface::addEntry(TQString original,TQString translated,InputInfo TQStringList wt=words(*otIt); for(TQStringList::iterator it = wt.begin(); it!=wt.end(); ++it) { - if(correlationDiff.tqcontains(*it)) + if(correlationDiff.contains(*it)) correlationDiff[*it]++; else correlationDiff[*it]=1; @@ -408,7 +408,7 @@ TQMap<TQString,float> DataBaseInterface::correlation(TQString word,SearchFilter MainEntry e=get(k->getString(),filter); TQStringList trad=e.second.getTranslations(); - nocck=words(k->getString()).tqcontains(sword); + nocck=words(k->getString()).contains(sword); for( TQStringList::iterator it2=trad.begin();it2!=trad.end();++it2) { @@ -465,7 +465,7 @@ TQStringList DataBaseInterface::words(TQString s) int pos; do { - pos=str.tqfind(TQRegExp("\\s")); + pos=str.find(TQRegExp("\\s")); // if(!simple(str.left(pos)).isEmpty()) // list.append(simple(str.left(pos))); if(!str.left(pos).isEmpty()) @@ -484,13 +484,13 @@ TQString DataBaseInterface::simple(TQString str,bool ck) else res=str.lower(); //lowercase //FIXME: uncoment the foll. line (check speed) - res=res.tqreplace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags + res=res.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags //Try to get rid of regexps. - // res=res.tqreplace(TQRegExp("(('|-|_|\\s|[^\\w%])+)")," "); //strip non-word char - // res=res.tqreplace(TQRegExp("(('|-|_)+)")," "); //strip non-word char - // res=res.tqreplace(TQRegExp("[^\\w\\s%]"),""); //strip non-word char + // res=res.replace(TQRegExp("(('|-|_|\\s|[^\\w%])+)")," "); //strip non-word char + // res=res.replace(TQRegExp("(('|-|_)+)")," "); //strip non-word char + // res=res.replace(TQRegExp("[^\\w\\s%]"),""); //strip non-word char TQString r; TQChar c; @@ -607,16 +607,16 @@ TQString DataBaseInterface::format(TQString _s,TQString t) //FIXME use regexp TQString s=_s; - TQString noTagT=t.tqreplace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); - TQChar first=noTagT[noTagT.tqfind(TQRegExp("\\w"))]; + TQString noTagT=t.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); + TQChar first=noTagT[noTagT.find(TQRegExp("\\w"))]; bool firstCapital=isUpper(first); /* -bool dotsAtEnd=(t.tqfind("...")+3==t.length()); -bool gtgtAtEnd=(t.tqfind(">>")+2==t.length()); -bool ltltAtEnd=(t.tqfind("<<")==t.length()-2); +bool dotsAtEnd=(t.find("...")+3==t.length()); +bool gtgtAtEnd=(t.find(">>")+2==t.length()); +bool ltltAtEnd=(t.find("<<")==t.length()-2); -bool columnAtEnd=(t.tqfind(":")+1==t.length()); +bool columnAtEnd=(t.find(":")+1==t.length()); */ bool allupper=(t.upper()==t); @@ -643,13 +643,13 @@ if(columnAtEnd) if(allupper) s=s.upper(); - int pos=t.tqfind(TQRegExp("&")); + int pos=t.find(TQRegExp("&")); if(pos>=0) { - TQChar accel=t[t.tqfind(TQRegExp("&"))+1]; + TQChar accel=t[t.find(TQRegExp("&"))+1]; if(accel!='&') { - pos=s.tqfind(accel,false); + pos=s.find(accel,false); if(pos<0) pos=0; s.insert(pos,"&"); @@ -685,8 +685,8 @@ TQString DataBaseInterface::formatRegExp(TQString _s, TQString t, TQString tre,T //kdDebug(0) << "phRegExp: " << phRegExp << endl; //kdDebug(0) << "cap[" << i << "]: "<< *capit<< endl; - stringReplace = stringReplace.tqreplace(TQRegExp(phRegExp),*capit); - stringSearch = stringSearch.tqreplace(TQRegExp(phRegExp),*capit); + stringReplace = stringReplace.replace(TQRegExp(phRegExp),*capit); + stringSearch = stringSearch.replace(TQRegExp(phRegExp),*capit); i++; } @@ -694,7 +694,7 @@ TQString DataBaseInterface::formatRegExp(TQString _s, TQString t, TQString tre,T // kdDebug(0) << "stringReplace " << stringReplace << endl; TQRegExp stringSearchRegExp = TQRegExp(stringSearch); // kdDebug(0) << "before: "<<s<<endl; - s = s.tqreplace(stringSearchRegExp,stringReplace); + s = s.replace(stringSearchRegExp,stringReplace); // kdDebug(0) << "after: "<<s<<endl; } |