Rev 6462 | Rev 6465 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6462 | Rev 6463 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | !! |
1 | !!##class |
2 | basedir=bases/ |
2 | basedir=bases/class |
3 | !if $srch!=$empty |
3 | !if $srch!=$empty |
4 | suffix_dictionary= |
4 | suffix_dictionary= |
5 | dictionary=$basedir/$search_lang |
5 | dictionary=$basedir/$search_lang |
6 | translator_unknown= |
6 | translator_unknown= |
7 | sout=!exec translator $srch |
7 | sout=!exec translator $srch |
Line 20... | Line 20... | ||
20 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
20 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
21 | 21 | ||
22 | !for i=1 to $scnt |
22 | !for i=1 to $scnt |
23 | l_=!line $i of $sout |
23 | l_=!line $i of $sout |
24 | t_=!wordcnt $l_ |
24 | t_=!wordcnt $l_ |
- | 25 | !advance gotcnt |
|
25 | !if $t_=2 |
26 | !if $t_=2 |
26 | !distribute word $l_ into m_,w_ |
27 | !distribute word $l_ into m_,w_ |
27 | !if $m_=$lastmod or $gotcnt>$gotlim |
28 | !if $m_=$lastmod or $gotcnt>$gotlim |
28 | weight=$[$weight+$w_] |
29 | weight=$[$weight+$w_] |
29 | !else |
30 | !else |
Line 33... | Line 34... | ||
33 | !advance gotcnt |
34 | !advance gotcnt |
34 | !endif |
35 | !endif |
35 | lastmod=$m_ |
36 | lastmod=$m_ |
36 | weight=$w_ |
37 | weight=$w_ |
37 | !endif |
38 | !endif |
- | 39 | !else |
|
- | 40 | gotm=$gotm $l_ |
|
38 | !endif |
41 | !endif |
39 | !next i |
42 | !next i |
40 | !if $lastmod!=$empty |
43 | !if $lastmod!=$empty |
41 | gotm=$gotm $lastmod |
44 | gotm=$gotm $lastmod |
42 | gotw=$gotw $weight |
45 | gotw=$gotw $weight |
43 | !advance gotcnt |
46 | !advance gotcnt |
44 | !endif |
47 | !endif |
45 | 48 | ||
46 | translator_switch=leaveline |
49 | translator_switch=leaveline |
47 | !if $gotcnt=0 |
- | |
48 | gottype=popular |
- | |
49 | !else |
- | |
50 | gottype=search |
- | |
51 | gotw=!words2lines $gotw |
- | |
52 | gotm=!words2lines $gotm |
- | |
53 | dictionary=$basedir/weight.$search_lang |
- | |
54 | gotW=!exec translator $gotm |
- | |
55 | w_= |
- | |
56 | !for i=1 to $gotcnt |
- | |
57 | u_=!line $i of $gotw |
- | |
58 | v_=!line $i of $gotW |
- | |
59 | w_=!append line $[round(100*($u_+1)/($v_+1)^0.7)] to $w_ |
- | |
60 | !next i |
- | |
61 | gotw=!sort reverse numeric lines $w_ |
- | |
62 | gotm=!line $wims_sort_order of $gotm |
- | |
63 | !endif |
- | |
64 | - | ||
65 | dictionary=$basedir/title |
50 | dictionary=$basedir/title |
66 | gott=!exec translator $gotm |
51 | gott=!exec translator $gotm |
67 | dictionary=$basedir/description |
52 | dictionary=$basedir/description |
68 | gotd=!exec translator $gotm |
53 | gotd=!exec translator $gotm |
69 | !if $gotcnt>0 and / notin $gotm |
54 | !if $gotcnt>0 and / notin $gotm |
70 | dictionary=$basedir/addr |
55 | dictionary=$basedir/addr |
71 | gotm=!exec translator $gotm |
56 | gotm=!exec translator $gotm |
72 | !endif |
57 | !endif |
73 | 58 |