gargantext-0.0.4.9.5: Search, map, share
Copyright(c) CNRS 2017 - present
LicenseAGPL + CECILL v3
Maintainerteam@gargantext.org
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Gargantext.Core.Text.Metrics.CharByChar

Description

Mainly reexport functions in Data.Text.Metrics

Synopsis

Documentation

levenshtein :: Text -> Text -> Int Source #

This module provide metrics to compare Text starting as an API rexporting main functions of the great lib text-metrics of Mark Karpov

Levenshtein Distance In information theory, Linguistics and computer science, the Levenshtein distance is a string metric for measuring the difference between two sequences. See: https://en.wikipedia.org/wiki/Levenshtein_distance

levenshteinNorm :: Text -> Text -> Ratio Int Source #

Return normalized Levenshtein distance between two Text values. Result is a non-negative rational number (represented as Ratio Natural), where 0 signifies no similarity between the strings, while 1 means exact match.

damerauLevenshtein :: Text -> Text -> Int Source #

Return Damerau-Levenshtein distance between two Text values. The function works like levenshtein, but the collection of allowed operations also includes transposition of two adjacent characters. See also: https://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance

overlap :: Text -> Text -> Ratio Int Source #

Return overlap coefficient for two Text values. Returned value is in the range from 0 (no similarity) to 1 (exact match). Return 1 if both Text values are empty.

See also: https://en.wikipedia.org/wiki/Overlap_coefficient.

jaccard :: Text -> Text -> Ratio Int Source #

Jaccard distance measures dissimilarity between sample sets

hamming :: Text -> Text -> Maybe Int Source #

Hamming Distance In information theory, the Hamming distance between two strings of equal length is the number of positions at which the corresponding symbols are different. In other words, it measures the minimum number of substitutions required to change one string into the other See: https://en.wikipedia.org/wiki/Hamming_distance