Popularity
6.6
Declining
Activity
0.0
Stable
42
4
1
Programming language: Crystal
License: MIT License
Tags:
Algorithms And Data Structures
Latest version: v0.5.0
fzy alternatives and similar shards
Based on the "Algorithms and Data structures" category.
Alternatively, view fzy alternatives based on common mentions on social networks and blogs.
-
crystalline
A collection of containers & algorithms for the Crystal programming language -
graphlb
graphlb is a crystal library which contains all the graph Data-Structures and Algorithms implemented in crystal-lang. -
markov
⛓ A Crystal library for building Markov Chains and running Markov Processes. -
kd_tree
Crystal implementation of "K-Dimensional Tree" and "N-Nearest Neighbors" -
Goban
A fast and efficient QR/Micro QR/rMQR Code implementation in Crystal lang -
text
A collection of phonetic algorithms for Crystal. Including; Porter-Stemmer, Soundex, Metaphone, Double Metaphone & White Similarity -
splay_tree_map
This is a Crystal implementation of a Splay Tree; which is a type of binary search tree that is semi-balanced and that tends to self-optimize so that the most accessed items are the fastest to retrieve. -
delimiter_tree
A crystal-lang tree structure that is built using a delimiter. -
haversine
Crystal implementation of the Haversine formula to calculate distances between two points given their latitudes and longitudes -
csuuid
This is a small UUID library that implements a chronologically sortable UUID. -
edits.cr
Edit distance algorithms inc. Jaro, Damerau-Levenshtein, and Optimal Alignment -
ternary_search_tree
A Crystal implementation of a Ternary Search Tree -
secure-remote-password
Crystal implementation of the Secure Remote Password protocol (SRP-6a)
Free Global Payroll designed for tech teams
Building a great tech team takes more than a paycheck. Zero payroll costs, get AI-driven insights to retain best talent, and delight them with amazing local benefits. 100% free and compliant.
Promo
try.revelo.com
Do you think we are missing an alternative of fzy or a related project?
README
fzy.cr
A Crystal port of awesome Fzy fuzzy finder algorithm.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
fzy:
github: hugopl/fzy
- Run
shards install
Usage
require "fzy"
matches = Fzy.search("hey", %w(Hey Whatever Halley))
matches.each do |match|
puts "value: #{match.value}"
puts "score: #{match.score}"
puts " pos: #{match.positions.inspect}"
puts "index: #{match.index}"
end
Should print
value: Hey
score: Infinity
pos: [0, 1, 2]
index: 0
value: Halley
score: 1.87
pos: [0, 4, 5]
index: 2
If you need to do many searches on the same set of data you can speed up things by using a prepared haystack.
require "fzy"
haystack = %w(Hey Halley Whatever)
prepared_haystack = PreparedHaystack.new(haystack)
matches = Fzy.search("hey", prepared_haystack)
matches.each do |match|
puts "value: #{match.value}"
puts "score: #{match.score}"
puts " pos: #{match.positions.inspect}"
end
# Reusing the prepared haystack makes the search faster.
matches = Fzy.search("ho let's go!", prepared_haystack)
Contributing
- Fork it (https://github.com/hugopl/fzy/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Hugo Parente Lima - creator and maintainer