jaro_winkler

Crystal implementation of Jaro-Winkler distance algorithm which supports UTF-8 string

JaroWinkler

Crystal implementation of Jaro-Winkler distance algorithm which supports UTF-8 string. Translated from ruby: https://github.com/tonytonyjan/jaro_winkler

Installation

Add this to your application's shard.yml:

dependencies:
  jaro_winkler:
    github: kostya/jaro_winkler

Usage

require "jaro_winkler"

p JaroWinkler.new.distance "MARTHA", "MARHTA"
# => 0.961111
p JaroWinkler.new(ignore_case: true).distance "MARTHA", "marhta"
# => 0.961111
p JaroWinkler.new(weight: 0.2).distance "MARTHA", "MARHTA"
# => 0.977778
p JaroWinkler.new(adj_table: true).distance "month15", "m0nth1S"
# => 0.854286

Benchmark

Ruby C Ext: 2.44s
Crystal: 2.95s
Ruby Pure: 60.52s
Repository

jaro_winkler

Owner
Statistic
  • 5
  • 0
  • 0
  • 2
  • 0
  • about 5 years ago
  • February 9, 2016
License

MIT License

Links
Synced at

Thu, 21 Nov 2024 20:16:16 GMT

Languages