Find the best lev_ratio()
between substrings.
lev_partial_ratio(a, b, pairwise = TRUE, useNames = TRUE, ...)
The input strings
Boolean. If TRUE
, only the pairwise distances between a
and b
will be
computed, rather than the combinations of all elements.
Boolean. Use input vectors as row and column names?
Additional arguments to be passed to stringdist::stringdistmatrix()
or
stringdist::stringsimmatrix()
.
A numeric scalar, vector or matrix depending on the length of the inputs.
If string a
has length len_a
and is shorter than string b
, this function finds the highest
lev_ratio()
of all the len_a
-long substrings of b
(and vice versa).
lev_ratio("Bruce Springsteen", "Bruce Springsteen and the E Street Band")
#> [1] 0.4358974
# Here the two "Bruce Springsteen" strings will match perfectly.
lev_partial_ratio("Bruce Springsteen", "Bruce Springsteen and the E Street Band")
#> [1] 1