edits.cr alternatives and similar shards
Based on the "Algorithms and Data structures" category.
Alternatively, view edits.cr 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. -
crystal-linked-list
Simple linked list implementation in Crystal -
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. -
haversine
Crystal implementation of the Haversine formula to calculate distances between two points given their latitudes and longitudes -
delimiter_tree
A crystal-lang tree structure that is built using a delimiter. -
csuuid
This is a small UUID library that implements a chronologically sortable UUID. -
murmur3
Crystal implementation of Murmur3 hash algorithm used by Cassandra -
ternary_search_tree
A Crystal implementation of a Ternary Search Tree -
secure-remote-password
Crystal implementation of the Secure Remote Password protocol (SRP-6a) -
s2_cells
maps latitude and longitude to S2 Cells https://s2geometry.io/
Collect and Analyze Billions of Data Points in Real Time
Do you think we are missing an alternative of edits.cr or a related project?
README
edits
A collection of edit distance algorithms in Crystal.
Includes Levenshtein, Restricted Edit (Optimal Alignment) and Damerau-Levenshtein distances, and Jaro and Jaro-Winkler similarity.
Installation
Add this to your application's shard.yml
:
dependencies:
edits:
github: tcrouch/edits.cr
Usage
require "edits"
Levenshtein
Edit distance, taking into account deletion, addition and substitution.
Edits::Levenshtein.distance "raked", "bakers"
# => 3
Edits::Levenshtein.distance "iota", "atom"
# => 4
Edits::Levenshtein.distance "acer", "earn"
# => 4
# Max distance
Edits::Levenshtein.distance "iota", "atom", 2
# => 2
Edits::Levenshtein.most_similar "atom", ["atlas", "tram", "rota", "racer"]
# => "atlas"
Restricted Edit (Optimal Alignment)
Edit distance, accounting for deletion, addition, substitution and transposition (two adjacent characters are swapped). This variant is restricted by the condition that no sub-string is edited more than once.
Edits::RestrictedEdit.distance "raked", "bakers"
# => 3
Edits::RestrictedEdit.distance "iota", "atom"
# => 3
Edits::RestrictedEdit.distance "acer", "earn"
# => 4
# Max distance
Edits::RestrictedEdit.distance "iota", "atom", 2
# => 2
Edits::RestrictedEdit.most_similar "atom", ["iota", "tome", "mown", "tame"]
# => "tome"
Damerau-Levenshtein
Edit distance, accounting for deletions, additions, substitution and transposition (two adjacent characters are swapped).
Edits::DamerauLevenshtein.distance "raked", "bakers"
# => 3
Edits::DamerauLevenshtein.distance "iota", "atom"
# => 3
Edits::DamerauLevenshtein.distance "acer", "earn"
# => 3
Jaro & Jaro-Winkler
Edits::Jaro.similarity "information", "informant"
# => 0.90235690235690236
Edits::Jaro.distance "information", "informant"
# => 0.097643097643097643
Edits::JaroWinkler.similarity "information", "informant"
# => 0.94141414141414137
Edits::JaroWinkler.distance "information", "informant"
# => 0.05858585858585863
Contributing
- Fork it
- 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
- [tcrouch] Tom Crouch - creator, maintainer