fzy

A Crystal port of awesome Fzy project fuzzy finder algorithm fzy fuzzy-search
0.2.0 released
hugopl/fzy
45 1 1
Hugo Parente Lima

fzy.cr

Build Status

A Crystal port of awesome Fzy fuzzy finder algorithm.

Installation

  1. Add the dependency to your shard.yml:
dependencies:
  fzy:
    github: hugopl/fzy
  1. Run shards install

Usage

require "fzy"

matches = Fzy.search("hey", %w(Hey Halley Whatever))
matches.each do |match|
  puts "value: #{matcht.value}"
  puts "score: #{match.score}"
  puts "  pos: #{match.positions.inspect}"
end

Should print

value: Hey
score: Infinity
  pos: [0, 1, 2]
value: Halley
score: 1.87
  pos: [0, 4, 5]

Contributing

  1. Fork it (https://github.com/hugopl/fzy/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

fzy:
  github: hugopl/fzy
  version: ~> 0.2.0
License MIT
Crystal 0.32.1

Authors

Dependencies 1

Development Dependencies 0

Dependents 0

Last synced .
search fire star recently