module Fzy

Extended Modules

Defined in:

fzy.cr

Constant Summary

VERSION = "0.3.0"

Instance Method Summary

Instance Method Detail

def search(needle : String, haystack : PreparedHaystack) : Array(Match) #

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

[View source]
def search(needle : String, haystack : Array(String)) : Array(Match) #

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.


[View source]