Skip to content

String metrics and phonetic algorithms for Crystal

License

Notifications You must be signed in to change notification settings

mlobl/string-metrics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string-metrics

Build Status

String metric algorithms for Crystal:

Installation

Add this to your application's shard.yml:

dependencies:
  string-metrics:
    github: mlobl/string-metrics

Usage

require "string-metrics"

StringMetrics.damerau_levenshtein("char", "hcar") == 1
StringMetrics.hamming("Micro", "Macro") == 1
StringMetrics.jaro("MARTHA", "MARHTA").round(2) == 0.94
StringMetrics.jaro_winkler("MARTHA", "MARHTA").round(2) == 0.96
StringMetrics.levenshtein("Car", "Char") == 1

Contributing

  1. Fork it ( https://github.com/mlobl/string-metrics/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

  • mlobl Meyer Lobl - creator, maintainer