Levenshtein::Finder

class Levenshtein::Finder

Overview

Finds the closest string to a given string amongst many strings.

finder = Levenshtein::Finder.new "hallo"
finder.test "hay"
finder.test "hall"
finder.test "hallo world"

finder.best_match # => "hall"

Defined in:

levenshtein.cr

Class Method Summary

Instance Method Summary

Class Method Detail

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

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

def self.new(target : String, tolerance : Int? = nil)Source

Instance Method Detail

def best_matchSource

def test(name : String, value : String = name)Source

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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部