Subversion Repositories wimsdev

Rev

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

  1. !!##class
  2. basedir=bases/class
  3. !if $srch!=$empty
  4.  suffix_dictionary=
  5.  dictionary=$basedir/$search_lang
  6.  translator_unknown=
  7.  !if $search_and=yes
  8.    srch=!items2lines $srch
  9.  !endif
  10.  sout=!exec translator $srch
  11.  !if $sout=$srch
  12.    sout=$empty
  13.  !endif
  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.  
  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
  30.  
  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_
  41.  !advance gotcnt
  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
  55.   !else
  56.    gotm=$gotm $l_
  57.  !endif
  58. !next i
  59. !if $lastmod!=$empty
  60.  gotm=$gotm $lastmod
  61.  gotw=$gotw $weight
  62.  !advance gotcnt
  63. !endif
  64.  
  65. gotm=!words2lines $gotm
  66. translator_switch=leaveline
  67. dictionary=$basedir/title
  68. gott=!exec translator $gotm
  69. dictionary=$basedir/description
  70. gotd=!exec translator $gotm
  71. !if $gotcnt>0 and / notin $gotm
  72.  dictionary=$basedir/addr
  73.  gotm=!exec translator $gotm
  74. !endif
  75.