Subversion Repositories wimsdev

Rev

Rev 6461 | Rev 6463 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !!##sheet
  2. basedir=bases/sheet/index
  3. !if $srch!=$empty
  4.  suffix_dictionary=
  5.  dictionary=$basedir/$search_lang
  6.  translator_unknown=
  7.  sout=!exec translator $srch
  8.  sout=!items2words $sout
  9.  sout=!words2lines $sout
  10.  sout=!translate ? to $ $ in $sout
  11.  sout=!sort lines $sout
  12.  sout=!nonempty lines $sout
  13.  scnt=!linecnt $sout
  14. !else
  15.  scnt=0
  16. !endif
  17.  
  18. # Limit of shown items
  19. gotlim=50
  20. !distribute item 0,0,, into weight,gotcnt,gotm,gotw,lastmod
  21.  
  22. !for i=1 to $scnt
  23.  l_=!line $i of $sout
  24.  t_=!wordcnt $l_
  25.  !if $t_=2
  26.   !distribute word $l_ into m_,w_
  27.   !if $m_=$lastmod or $gotcnt>$gotlim
  28.    weight=$[$weight+$w_]
  29.   !else
  30.    !if $lastmod!=$empty
  31.     gotm=$gotm $lastmod
  32.     gotw=$gotw $weight
  33.     !advance gotcnt
  34.    !endif
  35.    lastmod=$m_
  36.    weight=$w_
  37.   !endif
  38.  !endif
  39. !next i
  40. !if $lastmod!=$empty
  41.  gotm=$gotm $lastmod
  42.  gotw=$gotw $weight
  43.  !advance gotcnt
  44. !endif
  45.  
  46. 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.$search_lang
  66. gott=!exec translator $gotm
  67. dictionary=$basedir/description.$search_lang
  68. gotd=!exec translator $gotm
  69. !if $gotcnt>0 and / notin $gotm
  70.  dictionary=$basedir/addr.$search_lang
  71.  gotm=!exec translator $gotm
  72. !endif
  73.  
  74.