fuzzyset-0.2.1: Fuzzy set for approximate string matching
Safe HaskellNone
LanguageHaskell2010

Data.FuzzySet.Util

Synopsis

Documentation

normalized :: Text -> Text Source #

Normalize the input by

  • removing non-word characters, except for spaces and commas; and
  • converting alphabetic characters to lowercase.

substr Source #

Arguments

:: Int

Length of the substring

-> Int

The character offset m

-> Text

The input string

-> Text

A substring of length n

Return n characters starting from offset m in the input string.

enclosedIn :: Text -> Char -> Text Source #

Insert a character at the beginning and end of the given string.

norm :: (Integral a, Floating b) => [a] -> b Source #

Returns the euclidean norm, or magnitude, of the input list interpreted as a vector.

That is,

\( \quad \sqrt{ \sum_{i=0}^n a_i^2 } \)

for the input

\( \quad \langle a_0, a_1, \dots, a_n \rangle \)

where \( a_i \) is the element at position i in the input list.

distance :: Text -> Text -> Double Source #

Return the normalized Levenshtein distance between the two strings. See https://en.wikipedia.org/wiki/Levenshtein_distance.