Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSqlite search.
#7
It's by far from being perfect

Function Function21
Code:
Copy      Help
out
str SearchWord="Rock"
int Hit
str s=
;Rock and Roll
;Jazz
;Funk
;Folk
;Electronica
;Rap
;Country
;Indie
;Hip Hop
double HighestPercent
ARRAY(str) arr = s
for(int'i 0 arr.len)
,double dHit=0
,int iSearchWord = len(SearchWord)
,for(_i 0 iSearchWord 1)
,,_s.get(SearchWord _i 1)
,,double Hit1=findrx(arr[i] _s 0 4)>-1
,,dHit=dHit+Hit1
,double Percentage=dHit/iSearchWord
,if Percentage>=HighestPercent
,,HighestPercent=Percentage
,,int Index=i
out arr[Index]

It's a basic idea...any other suggestions?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)