module Indexable

quick and dirty “Full text” indexer for fastsearch. works fine for small amounts of data

Public Instance Methods

each_word() { |w| ... } click to toggle source
# File lib/yasysdui/index.rb, line 8
def each_word
        each_sentence{|sen|
                sen.split(%r{[[:space:]]+|[[:punct:]]+}).each{|w| yield w }
        }
end
each_wordstart() { |wstart| ... } click to toggle source
# File lib/yasysdui/index.rb, line 14
def each_wordstart
        each_word{|w| 
                wstart = ''
                w.downcase.each_char{|c|
                        wstart << c
                        yield wstart 
                }
        }     
end