Rev 7044 | Rev 13631 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7044 | Rev 12821 | ||
---|---|---|---|
Line 12... | Line 12... | ||
12 | # Limit of shown items |
12 | # Limit of shown items |
13 | gotlim=1000 |
13 | gotlim=1000 |
14 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
14 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
15 | 15 | ||
16 | !for i=1 to $scnt |
16 | !for i=1 to $scnt |
17 | l_=!line $i of $sout |
17 | l_=!line $i of $sout |
18 | t_=!wordcnt $l_ |
18 | t_=!wordcnt $l_ |
19 | !if $t_=2 |
19 | !if $t_=2 |
20 | !distribute word $l_ into m_,w_ |
20 | !distribute word $l_ into m_,w_ |
21 | !if $m_=$lastmod or $gotcnt>$gotlim |
21 | !if $m_=$lastmod or $gotcnt>$gotlim |
22 | weight=$[$weight+$w_] |
22 | weight=$[$weight+$w_] |
23 | !else |
23 | !else |
24 | !if $lastmod!=$empty |
24 | !if $lastmod!=$empty |
25 | gotm=$gotm $lastmod |
25 | gotm=$gotm $lastmod |
26 | gotw=$gotw $weight |
26 | gotw=$gotw $weight |
27 | !advance gotcnt |
27 | !advance gotcnt |
28 | !endif |
28 | !endif |
29 | lastmod=$m_ |
29 | lastmod=$m_ |
30 | weight=$w_ |
30 | weight=$w_ |
- | 31 | !endif |
|
31 | !endif |
32 | !endif |
32 | !endif |
- | |
33 | !next i |
33 | !next i |
34 | !if $lastmod!=$empty |
34 | !if $lastmod!=$empty |
35 | gotm=$gotm $lastmod |
35 | gotm=$gotm $lastmod |
36 | gotw=$gotw $weight |
36 | gotw=$gotw $weight |
37 | !advance gotcnt |
37 | !advance gotcnt |
38 | !endif |
38 | !endif |
39 | 39 | ||
40 | translator_switch=leaveline |
40 | translator_switch=leaveline |
41 | !if $gotcnt=0 |
41 | !if $gotcnt=0 |
42 | gottype=popular |
42 | gottype=popular |
43 | !else |
43 | !else |
44 | gottype=search |
44 | gottype=search |
45 | gotw=!words2lines $gotw |
45 | gotw=!words2lines $gotw |
46 | gotm=!words2lines $gotm |
46 | gotm=!words2lines $gotm |
47 | dictionary=$basedir/weight.$search_lang |
47 | dictionary=$basedir/weight.$search_lang |
48 | gotW=!exec translator $gotm |
48 | gotW=!exec translator $gotm |
49 | w_= |
49 | w_= |
50 | !for i=1 to $gotcnt |
50 | !for i=1 to $gotcnt |
51 | u_=!line $i of $gotw |
51 | u_=!line $i of $gotw |
52 | v_=!line $i of $gotW |
52 | v_=!line $i of $gotW |
53 | w_=!append line $[round(100*($u_+1)/($v_+1)^0.7)] to $w_ |
53 | w_=!append line $[round(100*($u_+1)/($v_+1)^0.7)] to $w_ |
54 | !next i |
54 | !next i |
55 | gotw=!sort reverse numeric lines $w_ |
55 | gotw=!sort reverse numeric lines $w_ |
56 | gotm=!line $wims_sort_order of $gotm |
56 | gotm=!line $wims_sort_order of $gotm |
57 | gotm=!line 1 to $gotlim2 of $gotm |
57 | gotm=!line 1 to $gotlim2 of $gotm |
58 | gotcnt=!linecnt $gotm |
58 | gotcnt=!linecnt $gotm |
59 | !endif |
59 | !endif |
60 | 60 | ||
61 | dictionary=$basedir/title.$search_lang |
61 | dictionary=$basedir/title.$search_lang |
62 | gott=!exec translator $gotm |
62 | gott=!exec translator $gotm |
63 | translator_unknown1=$translator_unknown |
63 | translator_unknown1=$translator_unknown |
Line 73... | Line 73... | ||
73 | 73 | ||
74 | gotm_=!replace internal $ $ by $\ |
74 | gotm_=!replace internal $ $ by $\ |
75 | $ in $gotm |
75 | $ in $gotm |
76 | 76 | ||
77 | !if $gotcnt>0 and / notin $gotm |
77 | !if $gotcnt>0 and / notin $gotm |
78 | dictionary=$basedir/addr.$search_lang |
78 | dictionary=$basedir/addr.$search_lang |
79 | gotm=!exec translator $gotm |
79 | gotm=!exec translator $gotm |
80 | !endif |
80 | !endif |