prefix_distance: Calculate the prefix distance between two strings

View source: R/RcppExports.R

prefix_distanceR Documentation

Calculate the prefix distance between two strings

Description

Computes the prefix distance, which measures the number of character edits required to convert one prefix into another. This includes insertions, deletions, and substitutions.

Usage

prefix_distance(s1, s2, score_cutoff = NULL)

Arguments

s1

A string. The first input string.

s2

A string. The second input string.

score_cutoff

An optional maximum threshold for the distance. Defaults to the largest integer value in R ('.Machine$integer.max').

Value

The prefix distance as an integer.

Examples

prefix_distance("abcdef", "abcxyz")
prefix_distance("abcdef", "abcxyz", score_cutoff = 3)

RapidFuzz documentation built on April 3, 2025, 11:52 p.m.