module Fzy
Extended Modules
Defined in:
fzy.crfzy/match.cr
fzy/prepared_haystack.cr
Constant Summary
-
VERSION =
"0.5.0"
Instance Method Summary
-
#search(needle : String, haystack : PreparedHaystack) : Array(Match)
Search a needle in a haystack and returns an array of matches.
-
#search(needle : String, haystack : Array(String)) : Array(Match)
Search a needle in a haystack and returns an array of matches.
Instance Method Detail
Search a needle in a haystack and returns an array of matches.
results = Fzy.search("hey", %w(Hey Halley Whatever))
results.each do |result|
puts "value: #{result.value}"
puts "score: #{result.score}"
puts " pos: #{result.positions.inspect}"
end
Search a needle in a haystack and returns an array of matches.
Consider using #search(String,PreparedHaystack)
if you want to repeat this call with
different needles but the same haystack.