Levenshtein

module Levenshtein

Overview

Levensthein distance methods.

Defined in:

levenshtein.cr

Class Method Summary

Class Method Detail

def self.distance(string1 : String, string2 : String) : Int32Source

Computes the levenshtein distance of two strings.

require "levenshtein"

Levenshtein.distance("algorithm", "altruistic") # => 6
Levenshtein.distance("hello", "hallo")          # => 1
Levenshtein.distance("こんにちは", "こんちは")           # => 1
Levenshtein.distance("hey", "hey")              # => 0

def self.find(name, tolerance = nil, &block)Source

def self.find(name, all_names, tolerance = nil)Source

© 2012–2017 Manas Technology Solutions.
Licensed under the Apache License, Version 2.0.
https://crystal-lang.org/api/0.22.0/Levenshtein.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部