Sha256: 6f911b9d93db862c954be90a792e2c1580b3db1e88913e07598e3ffb6fbebb65
Contents?: true
Size: 787 Bytes
Versions: 24
Compression:
Stored size: 787 Bytes
Contents
module Picky class Try attr_reader :text, :specific def initialize text, index = nil, category = nil @text = text @specific = Picky::Indexes @specific = @specific[index.intern] if index @specific = @specific[category.intern] if category end def saved specific.tokenizer.tokenize(text.dup).first end def searched Picky::Tokenizer.searching.tokenize(text.dup).first end def output <<-OUTPUT \"#{text}\" is saved in the #{specific.identifier} index as #{saved} \"#{text}\" as a search will be tokenized as #{searched} (category qualifiers, e.g. title: are removed if they do not exist as a qualifier, so 'toitle:bla' -> 'bla') OUTPUT end def to_stdout puts output end end end
Version data entries
24 entries across 24 versions & 1 rubygems