Subversion Repositories wimsdev

Rev

Rev 6468 | Rev 6516 | 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=
6470 bpr 7
 !if $search_and=yes
8
   srch=!items2lines $srch
9
 !endif
33 reyssat 10
 sout=!exec translator $srch
6468 bpr 11
 !if $sout=$srch
12
   sout=$empty
13
 !endif
6470 bpr 14
 !if $search_and=yes
15
   scnt=!linecnt $srch
16
   Sout=!words2items $(sout[1;])
17
   !for s=2 to $scnt
18
     S=!words2items $(sout[$s;])
19
     Sout=!listintersection $Sout and $S
20
   !next
21
    sout=$Sout
22
 !endif
23
 
33 reyssat 24
 sout=!items2words $sout
25
 sout=!words2lines $sout
26
 sout=!translate ? to $ $ in $sout
27
 sout=!sort lines $sout
28
 sout=!nonempty lines $sout
29
 scnt=!linecnt $sout
6465 bpr 30
 
33 reyssat 31
!else
32
 scnt=0
33
!endif
34
# Limit of shown items
35
gotlim=50
36
!distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod
37
 
38
!for i=1 to $scnt
39
 l_=!line $i of $sout
40
 t_=!wordcnt $l_
6463 bpr 41
 !advance gotcnt
33 reyssat 42
 !if $t_=2
43
  !distribute word $l_ into m_,w_
44
  !if $m_=$lastmod or $gotcnt>$gotlim
45
   weight=$[$weight+$w_]
46
  !else
47
   !if $lastmod!=$empty
48
    gotm=$gotm $lastmod
49
    gotw=$gotw $weight
50
    !advance gotcnt
51
   !endif
52
   lastmod=$m_
53
   weight=$w_
54
  !endif
6463 bpr 55
  !else
56
   gotm=$gotm $l_
33 reyssat 57
 !endif
58
!next i
59
!if $lastmod!=$empty
60
 gotm=$gotm $lastmod
61
 gotw=$gotw $weight
62
 !advance gotcnt
63
!endif
64
 
6465 bpr 65
gotm=!words2lines $gotm
33 reyssat 66
translator_switch=leaveline
6463 bpr 67
dictionary=$basedir/title
33 reyssat 68
gott=!exec translator $gotm
6463 bpr 69
dictionary=$basedir/description
33 reyssat 70
gotd=!exec translator $gotm
71
!if $gotcnt>0 and / notin $gotm
6463 bpr 72
 dictionary=$basedir/addr
33 reyssat 73
 gotm=!exec translator $gotm
74
!endif