std/levenshtein
import std/levenshtein to use it. Source: src/std/levenshtein.iyi at v0.18.0.
Provides edit distance calculation and fuzzy string matching.
Levenshteinmodule, reopened
module ::Levenshtein
# Computes the Levenshtein distance between two strings.
def self.distance(string1 : String, string2 : String) : Int32
def self.find(name : String, tolerance : Int32 | ::Nil = nil, &block : (Finder -> Nil)) : String | ::Nil
def self.find(name : String, all_names, tolerance : Int32 | ::Nil = nil) : String | ::Nil
# Optimal string alignment: Levenshtein plus an adjacent transposition as
# one edit. `cuont` for `count` is two edits by `distance` and one here.
def self.osa_distance(string1 : String, string2 : String) : Int32
endLevenshtein::Entrystruct, reopened
struct ::Levenshtein::Entry
def distance : Int32
def initialize(value : String, distance : Int32)
def value : String
endLevenshtein::Finderclass, reopened
class ::Levenshtein::Finder
def best_match : String | ::Nil
def self.find(name : String, tolerance : Int32 | ::Nil = nil, &block : (Finder -> Nil)) : String | ::Nil
def self.find(name : String, all_names, tolerance : Int32 | ::Nil = nil) : String | ::Nil
def initialize(target : String, tolerance : Int32 | ::Nil = nil)
def target : String
def test(name : String, value : String = name) : Nil
def tolerance : Int32
end
Levenshtein distance methods for iyi.