Rev 15382 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | reyssat | 1 | !if $srch!=$empty |
13631 | bpr | 2 | suffix_dictionary=bases/sys/suffix.$search_lang |
3 | dictionary=$basedir/$search_lang |
||
4 | translator_unknown= |
||
5 | !read search.common |
||
33 | reyssat | 6 | !else |
13631 | bpr | 7 | scnt=0 |
33 | reyssat | 8 | !endif |
9 | |||
10 | # Limit of shown items |
||
7044 | bpr | 11 | gotlim=1000 |
33 | reyssat | 12 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
13 | |||
14 | !for i=1 to $scnt |
||
12821 | bpr | 15 | l_=!line $i of $sout |
16 | t_=!wordcnt $l_ |
||
17 | !if $t_=2 |
||
18 | !distribute word $l_ into m_,w_ |
||
19 | !if $m_=$lastmod or $gotcnt>$gotlim |
||
20 | weight=$[$weight+$w_] |
||
21 | !else |
||
22 | !if $lastmod!=$empty |
||
23 | gotm=$gotm $lastmod |
||
24 | gotw=$gotw $weight |
||
25 | !advance gotcnt |
||
26 | !endif |
||
27 | lastmod=$m_ |
||
28 | weight=$w_ |
||
29 | !endif |
||
33 | reyssat | 30 | !endif |
31 | !next i |
||
32 | !if $lastmod!=$empty |
||
12821 | bpr | 33 | gotm=$gotm $lastmod |
34 | gotw=$gotw $weight |
||
35 | !advance gotcnt |
||
33 | reyssat | 36 | !endif |
37 | |||
38 | translator_switch=leaveline |
||
39 | !if $gotcnt=0 |
||
12821 | bpr | 40 | gottype=popular |
33 | reyssat | 41 | !else |
12821 | bpr | 42 | gottype=search |
43 | gotw=!words2lines $gotw |
||
44 | gotm=!words2lines $gotm |
||
45 | dictionary=$basedir/weight.$search_lang |
||
46 | gotW=!exec translator $gotm |
||
47 | w_= |
||
48 | !for i=1 to $gotcnt |
||
49 | u_=!line $i of $gotw |
||
50 | v_=!line $i of $gotW |
||
51 | w_=!append line $[round(100*($u_+1)/($v_+1)^0.7)] to $w_ |
||
52 | !next i |
||
53 | gotw=!sort reverse numeric lines $w_ |
||
54 | gotm=!line $wims_sort_order of $gotm |
||
55 | gotm=!line 1 to $gotlim2 of $gotm |
||
56 | gotcnt=!linecnt $gotm |
||
33 | reyssat | 57 | !endif |
58 | |||
15442 | bpr | 59 | dictionary=$basedir/title |
33 | reyssat | 60 | gott=!exec translator $gotm |
7040 | bpr | 61 | translator_unknown1=$translator_unknown |
15442 | bpr | 62 | translator_unknown= |
7040 | bpr | 63 | |
15442 | bpr | 64 | dictionary=$basedir/description |
7040 | bpr | 65 | gotd=!exec translator $gotm |
15442 | bpr | 66 | dictionary=$basedir/information |
15382 | bpr | 67 | goti$wims_read_parm=!exec translator $gotm |
7040 | bpr | 68 | |
69 | !! by precaution |
||
70 | translator_unknown=$translator_unknown1 |
||
71 | |||
6961 | bpr | 72 | gotm_=!replace internal $ $ by $\ |
73 | $ in $gotm |
||
74 | |||
33 | reyssat | 75 | !if $gotcnt>0 and / notin $gotm |
15442 | bpr | 76 | dictionary=$basedir/addr |
12821 | bpr | 77 | gotm=!exec translator $gotm |
33 | reyssat | 78 | !endif |