lev_token_set_ratio | R Documentation |
Compare stings based on shared tokens.
lev_token_set_ratio(a, b, pairwise = TRUE, useNames = TRUE, ...)
a, b |
The input strings |
pairwise |
Boolean. If |
useNames |
Boolean. Use input vectors as row and column names? |
... |
Additional arguments to be passed to |
A numeric scalar, vector or matrix depending on the length of the inputs.
Similar to lev_token_sort_ratio()
this function breaks the input down into tokens. It then
identifies any common tokens between strings and creates three new strings:
x <- {common_tokens} y <- {common_tokens}{remaining_unique_tokens_from_string_a} z <- {common_tokens}{remaining_unique_tokens_from_string_b}
and performs three pairwise lev_ratio()
calculations between them (x
vs y
, y
vs z
and
x
vs z
). The highest of those three ratios is returned.
lev_token_sort_ratio()
x <- "the quick brown fox jumps over the lazy dog"
y <- "my lazy dog was jumped over by a quick brown fox"
lev_ratio(x, y)
lev_token_sort_ratio(x, y)
lev_token_set_ratio(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.