01-08-2009, 07:51 AM
It's by far from being perfect
Function Function21
It's a basic idea...any other suggestions?
Function Function21
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?