bytes-metrics-0.1.0.0: Calculate string metrics on Bytes efficiently
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Bytes.Metrics

Synopsis

Documentation

levenshteinWithTolerance :: Int -> Bytes -> Bytes -> Maybe Int Source #

Determine Levenshtein distance between two strings, as long as their distance is within (inclusive) the given tolerance. Computes in O(t*min(n,m)) time and O(min(t,n,m)) space, where n,m are lengths of the input strings and t is the tolerance.

isWithinLevenshtein :: Int -> Bytes -> Bytes -> Bool Source #

Determine if two Bytes are within a given Levenshtein distance of each other (inclusive). Computes in O(t*min(n,m)) time and O(min(t,n,m)) space, where n,m are lengths of the input strings and t is the tolerance.