# vim:syntax=tcl # create the index record # if this file is found as $db.fsp, it is used by openIsis::save # we use the doc/Inverting controls to set word/field mode # # cds.fst is: # 70 0 MHU,(V70/) # 24 4 MHU,V24 # 69 2 V69 namespace eval test {} ;# create namespace proc test::fsp {{rec rec} {idx ::openIsis::idx}} { foreach {v24 v69 v70} [$rec get {24 {}} {69 {}} {70 {}}] break ;# lassign # method 4: add one for each word of 24 (don't count occ; it's not repeatable) set v [lindex $v24 0] set len [string length $v] $idx add -1 words ;# set word mode for {set i 0} {$i < $len} {set i $j} { set j [string wordend $v $i] set e [expr $j - 1] if {$e > $i} { # ignore single character words or non-words set w [string range $v $i $e] $idx add 24 $w } } # method 2: grep from 69 foreach {- kw} [regexp -all -inline {<([^>]+)>} [lindex $v69 0]] { $idx add 69 $kw } # method 0: add one for each occurence of 70 $idx add -1 fields ;# set field mode foreach f $v70 { regsub -all {<[^=>]*=?([^>]*)>} $f {\1} f; # dump substitutions $idx add 70 $f } return $idx } # must return the name of the FSP as result of source return test::fsp