Subversion Repositories wimsdev

Rev

Rev 2670 | Rev 6462 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6461 bpr 1
!!##sheet
33 reyssat 2
!if $srch!=$empty
3
 suffix_dictionary=
2670 bpr 4
 dictionary=bases/sheet/index/$search_lang
33 reyssat 5
 translator_unknown=
6
 sout=!exec translator $srch
7
 sout=!items2words $sout
8
 sout=!words2lines $sout
9
 sout=!translate ? to $ $ in $sout
10
 sout=!sort lines $sout
11
 sout=!nonempty lines $sout
12
 scnt=!linecnt $sout
13
!else
14
 scnt=0
15
!endif
16
 
17
# Limit of shown items
18
gotlim=50
19
!distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod
20
 
21
!for i=1 to $scnt
22
 l_=!line $i of $sout
23
 t_=!wordcnt $l_
24
 !if $t_=2
25
  !distribute word $l_ into m_,w_
26
  !if $m_=$lastmod or $gotcnt>$gotlim
27
   weight=$[$weight+$w_]
28
  !else
29
   !if $lastmod!=$empty
30
    gotm=$gotm $lastmod
31
    gotw=$gotw $weight
32
    !advance gotcnt
33
   !endif
34
   lastmod=$m_
35
   weight=$w_
36
  !endif
37
 !endif
38
!next i
39
!if $lastmod!=$empty
40
 gotm=$gotm $lastmod
41
 gotw=$gotw $weight
42
 !advance gotcnt
43
!endif
44
 
45
translator_switch=leaveline
46
!if $gotcnt=0
47
 gottype=popular
48
!else
49
 gottype=search
50
 gotw=!words2lines $gotw
51
 gotm=!words2lines $gotm
2670 bpr 52
 dictionary=bases/sheet/index/weight.$search_lang
33 reyssat 53
 gotW=!exec translator $gotm
54
 w_=
55
 !for i=1 to $gotcnt
56
  u_=!line $i of $gotw
57
  v_=!line $i of $gotW
58
  w_=!append line $[round(100*($u_+1)/($v_+1)^0.7)] to $w_
59
 !next i
60
 gotw=!sort reverse numeric lines $w_
61
 gotm=!line $wims_sort_order of $gotm
62
!endif
63
 
2670 bpr 64
dictionary=bases/sheet/index/title.$search_lang
33 reyssat 65
gott=!exec translator $gotm
2670 bpr 66
dictionary=bases/sheet/index/description.$search_lang
33 reyssat 67
gotd=!exec translator $gotm
68
!if $gotcnt>0 and / notin $gotm
2670 bpr 69
 dictionary=bases/sheet/index/addr.$search_lang
33 reyssat 70
 gotm=!exec translator $gotm
71
!endif
72