Rev 7044 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7044 | Rev 12821 | ||
---|---|---|---|
Line 15... | Line 15... | ||
15 | srch=!singlespace $srch |
15 | srch=!singlespace $srch |
16 | srch=!replace internal ,$ $ by , in $srch |
16 | srch=!replace internal ,$ $ by , in $srch |
17 | srch=!replace internal $ $, by , in $srch |
17 | srch=!replace internal $ $, by , in $srch |
18 | 18 | ||
19 | !if $srch!=$empty |
19 | !if $srch!=$empty |
20 | suffix_dictionary= |
20 | suffix_dictionary= |
21 | dictionary=$search_package2/$s_cat.$search_lang |
21 | dictionary=$search_package2/$s_cat.$search_lang |
22 | translator_unknown= |
22 | translator_unknown= |
23 | !read search.common |
23 | !read search.common |
24 | !else |
24 | !else |
25 | scnt=0 |
25 | scnt=0 |
26 | !endif |
26 | !endif |
27 | 27 | ||
28 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
28 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
29 | 29 | ||
30 | !for i=1 to $scnt |
30 | !for i=1 to $scnt |
31 | l_=!line $i of $sout |
31 | l_=!line $i of $sout |
32 | t_=!wordcnt $l_ |
32 | t_=!wordcnt $l_ |
33 | !if $t_=2 |
33 | !if $t_=2 |
34 | !distribute word $l_ into m_,w_ |
34 | !distribute word $l_ into m_,w_ |
35 | !if $m_=$lastmod |
35 | !if $m_=$lastmod |
36 | weight=$[$weight+$w_] |
36 | weight=$[$weight+$w_] |
37 | !else |
37 | !else |
38 | !if $lastmod!=$empty |
38 | !if $lastmod!=$empty |
39 | gotm=$gotm $lastmod |
39 | gotm=$gotm $lastmod |
40 | gotw=$gotw $weight |
40 | gotw=$gotw $weight |
41 | !advance gotcnt |
41 | !advance gotcnt |
42 | !if $gotcnt>=$gotlim |
42 | !if $gotcnt>=$gotlim |
43 | !goto bailout |
43 | !goto bailout |
- | 44 | !endif |
|
- | 45 | !endif |
|
- | 46 | lastmod=$m_ |
|
- | 47 | weight=$w_ |
|
44 | !endif |
48 | !endif |
45 | !endif |
- | |
46 | lastmod=$m_ |
- | |
47 | weight=$w_ |
- | |
48 | !endif |
49 | !endif |
49 | !endif |
- | |
50 | !next i |
50 | !next i |
51 | :bailout |
51 | :bailout |
52 | !if $lastmod!=$empty and $gotcnt<$gotlim |
52 | !if $lastmod!=$empty and $gotcnt<$gotlim |
53 | gotm=$gotm $lastmod |
53 | gotm=$gotm $lastmod |
54 | gotw=$gotw $weight |
54 | gotw=$gotw $weight |
55 | !advance gotcnt |
55 | !advance gotcnt |
56 | !endif |
56 | !endif |
57 | 57 | ||
58 | !if $gotcnt>0 |
58 | !if $gotcnt>0 |
59 | translator_switch=leavelines |
59 | translator_switch=leavelines |
60 | translator_unknown=200 |
60 | translator_unknown=200 |
61 | gotw=!words2lines $gotw |
61 | gotw=!words2lines $gotw |
62 | gotm=!words2lines $gotm |
62 | gotm=!words2lines $gotm |
63 | dictionary=$search_package2/weight.$search_lang |
63 | dictionary=$search_package2/weight.$search_lang |
64 | gotW=!exec translator $gotm |
64 | gotW=!exec translator $gotm |
65 | dictionary=$search_package2/popular.1 |
65 | dictionary=$search_package2/popular.1 |
66 | gotp=!exec translator $gotm |
66 | gotp=!exec translator $gotm |
67 | w_= |
67 | w_= |
68 | !for i=1 to $gotcnt |
68 | !for i=1 to $gotcnt |
69 | u_=!line $i of $gotw |
69 | u_=!line $i of $gotw |
70 | v_=!line $i of $gotW |
70 | v_=!line $i of $gotW |
71 | p_=!line $i of $gotp |
71 | p_=!line $i of $gotp |
72 | !bound p_ between integer 0 and 1000000 default 0 |
72 | !bound p_ between integer 0 and 1000000 default 0 |
73 | w_=!append line $[round(100*($u_+1)*($p_+10)^0.4/($v_+1)^0.7)] to $w_ |
73 | w_=!append line $[round(100*($u_+1)*($p_+10)^0.4/($v_+1)^0.7)] to $w_ |
74 | !next i |
74 | !next i |
75 | gotw=!sort reverse numeric lines $w_ |
75 | gotw=!sort reverse numeric lines $w_ |
76 | gotm=!line $wims_sort_order of $gotm |
76 | gotm=!line $wims_sort_order of $gotm |
77 | gotm=!line 1 to $gotlim2 of $gotm |
77 | gotm=!line 1 to $gotlim2 of $gotm |
78 | gotcnt=!linecnt $gotm |
78 | gotcnt=!linecnt $gotm |
79 | !endif |
79 | !endif |