Rev 6465 | Rev 6470 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6463 | bpr | 1 | !!##class |
2 | basedir=bases/class |
||
33 | reyssat | 3 | !if $srch!=$empty |
4 | suffix_dictionary= |
||
6462 | bpr | 5 | dictionary=$basedir/$search_lang |
33 | reyssat | 6 | translator_unknown= |
7 | sout=!exec translator $srch |
||
6468 | bpr | 8 | !if $sout=$srch |
9 | sout=$empty |
||
10 | !endif |
||
33 | reyssat | 11 | sout=!items2words $sout |
12 | sout=!words2lines $sout |
||
13 | sout=!translate ? to $ $ in $sout |
||
14 | sout=!sort lines $sout |
||
15 | sout=!nonempty lines $sout |
||
16 | scnt=!linecnt $sout |
||
6465 | bpr | 17 | |
33 | reyssat | 18 | !else |
19 | scnt=0 |
||
20 | !endif |
||
21 | # Limit of shown items |
||
22 | gotlim=50 |
||
23 | !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod |
||
24 | |||
25 | !for i=1 to $scnt |
||
26 | l_=!line $i of $sout |
||
27 | t_=!wordcnt $l_ |
||
6463 | bpr | 28 | !advance gotcnt |
33 | reyssat | 29 | !if $t_=2 |
30 | !distribute word $l_ into m_,w_ |
||
31 | !if $m_=$lastmod or $gotcnt>$gotlim |
||
32 | weight=$[$weight+$w_] |
||
33 | !else |
||
34 | !if $lastmod!=$empty |
||
35 | gotm=$gotm $lastmod |
||
36 | gotw=$gotw $weight |
||
37 | !advance gotcnt |
||
38 | !endif |
||
39 | lastmod=$m_ |
||
40 | weight=$w_ |
||
41 | !endif |
||
6463 | bpr | 42 | !else |
43 | gotm=$gotm $l_ |
||
33 | reyssat | 44 | !endif |
45 | !next i |
||
46 | !if $lastmod!=$empty |
||
47 | gotm=$gotm $lastmod |
||
48 | gotw=$gotw $weight |
||
49 | !advance gotcnt |
||
50 | !endif |
||
51 | |||
6465 | bpr | 52 | gotm=!words2lines $gotm |
33 | reyssat | 53 | translator_switch=leaveline |
6463 | bpr | 54 | dictionary=$basedir/title |
33 | reyssat | 55 | gott=!exec translator $gotm |
6463 | bpr | 56 | dictionary=$basedir/description |
33 | reyssat | 57 | gotd=!exec translator $gotm |
58 | !if $gotcnt>0 and / notin $gotm |
||
6463 | bpr | 59 | dictionary=$basedir/addr |
33 | reyssat | 60 | gotm=!exec translator $gotm |
61 | !endif |