Subversion Repositories wimsdev

Rev

Rev 13631 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13631 Rev 15382
Line 1... Line 1...
1
!!##sheet
1
!!##sheet
2
basedir=bases/sheet/index
2
basedir=bases/sheet/index
3
!if $srch!=$empty
-
 
4
  suffix_dictionary=bases/sys/suffix.$search_lang
-
 
5
  dictionary=$basedir/$search_lang
-
 
6
  translator_unknown=
-
 
7
  !read search.common
3
!changeto search.SG S
8
!else
-
 
9
  scnt=0
-
 
10
!endif
-
 
11
 
-
 
12
# Limit of shown items
-
 
13
gotlim=1000
-
 
14
!distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod
-
 
15
 
-
 
16
!for i=1 to $scnt
-
 
17
  l_=!line $i of $sout
-
 
18
  t_=!wordcnt $l_
-
 
19
  !if $t_=2
-
 
20
    !distribute word $l_ into m_,w_
-
 
21
    !if $m_=$lastmod or $gotcnt>$gotlim
-
 
22
      weight=$[$weight+$w_]
-
 
23
    !else
-
 
24
      !if $lastmod!=$empty
-
 
25
        gotm=$gotm $lastmod
-
 
26
        gotw=$gotw $weight
-
 
27
        !advance gotcnt
-
 
28
      !endif
-
 
29
      lastmod=$m_
-
 
30
      weight=$w_
-
 
31
    !endif
-
 
32
  !endif
-
 
33
!next i
-
 
34
!if $lastmod!=$empty
-
 
35
  gotm=$gotm $lastmod
-
 
36
  gotw=$gotw $weight
-
 
37
  !advance gotcnt
-
 
38
!endif
-
 
39
 
-
 
40
translator_switch=leaveline
-
 
41
!if $gotcnt=0
-
 
42
  gottype=popular
-
 
43
!else
-
 
44
  gottype=search
-
 
45
  gotw=!words2lines $gotw
-
 
46
  gotm=!words2lines $gotm
-
 
47
  dictionary=$basedir/weight.$search_lang
-
 
48
  gotW=!exec translator $gotm
-
 
49
  w_=
-
 
50
  !for i=1 to $gotcnt
-
 
51
    u_=!line $i of $gotw
-
 
52
    v_=!line $i of $gotW
-
 
53
    w_=!append line $[round(100*($u_+1)/($v_+1)^0.7)] to $w_
-
 
54
  !next i
-
 
55
  gotw=!sort reverse numeric lines $w_
-
 
56
  gotm=!line $wims_sort_order of $gotm
-
 
57
  gotm=!line 1 to $gotlim2 of $gotm
-
 
58
  gotcnt=!linecnt $gotm
-
 
59
!endif
-
 
60
 
-
 
61
dictionary=$basedir/title.$search_lang
-
 
62
gott=!exec translator $gotm
-
 
63
translator_unknown1=$translator_unknown
-
 
64
translator_unknown=leave
-
 
65
 
-
 
66
dictionary=$basedir/description.$search_lang
-
 
67
gotd=!exec translator $gotm
-
 
68
dictionary=$basedir/information.$search_lang
-
 
69
gotiS=!exec translator $gotm
-
 
70
 
-
 
71
!! by precaution
-
 
72
translator_unknown=$translator_unknown1
-
 
73
 
-
 
74
gotm_=!replace internal $ $ by $\
-
 
75
$ in $gotm
-
 
76
 
-
 
77
!if $gotcnt>0 and / notin $gotm
-
 
78
  dictionary=$basedir/addr.$search_lang
-
 
79
  gotm=!exec translator $gotm
-
 
80
!endif
-