Skip to contents

Creates comparison levels based on the Damerau-Levenshtein distance, which extends cl_levenshtein() by also counting transpositions of two adjacent characters as a single edit.

Usage

cl_damerau_levenshtein(..., term_frequency = FALSE)

Arguments

...

Integer distance thresholds, ordered from strictest to most lenient.

term_frequency

Logical. If TRUE, adjust match weights by value frequency at the highest comparison level. Defaults to FALSE.

Value

A comparison-level object for use in il_compare().

Examples

il_spec() |>
  il_compare(name, cl_damerau_levenshtein(1))
#> Linkage Specification
#>   Comparisons (1):
#>     name : damerau_levenshtein
#>   Blocking rules: (none)