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