View Source ExFuzzywuzzy.Algorithms.LongestCommonSubstring (ex_fuzzywuzzy v0.3.0)

Helper module for the calculus of the longest common substring algorithm between two strings

Summary

Types

t()

The data collected applying partial matching algorithm

Functions

Calculates the longest common substring between two strings, returning a tuple containing the matched substring, the length of the substring itself, the starting index of the matches on the left and on the right.

Types

@type t() :: %ExFuzzywuzzy.Algorithms.LongestCommonSubstring{
  left_starting_index: non_neg_integer(),
  length: non_neg_integer(),
  right_starting_index: non_neg_integer(),
  substring: String.t()
}

The data collected applying partial matching algorithm

Functions

@spec lcs(String.t(), String.t()) :: nil | t()

Calculates the longest common substring between two strings, returning a tuple containing the matched substring, the length of the substring itself, the starting index of the matches on the left and on the right.