lev_weighted_token_sort_ratio: Weighted version of lev_token_sort_ratio()

View source: R/weighted.R

lev_weighted_token_sort_ratioR Documentation

Weighted version of lev_token_sort_ratio()

Description

This function tokenises inputs, sorts tokens and computes similarities for each pair of tokens. Similarity scores are weighted based on the weights argument, and a total similarity score is returned in the same manner as lev_weighted_token_ratio().

Usage

lev_weighted_token_sort_ratio(a, b, weights = list(), ...)

Arguments

a, b

The input strings

weights

List of token weights. For example, weights = list(foo = 0.9, bar = 0.1). Any tokens omitted from weights will be given a weight of 1.

...

Additional arguments to be passed to stringdist::stringdistmatrix() or stringdist::stringsimmatrix().

Value

Float

See Also

lev_token_sort_ratio()

Other weighted token functions: lev_weighted_token_ratio(), lev_weighted_token_set_ratio()


levitate documentation built on Oct. 1, 2023, 1:08 a.m.