mlr3misc (version 0.15.0)

did_you_mean: Suggest Alternatives

Description

Helps to suggest alternatives from a list of strings, based on the string similarity in utils::adist().

Usage

did_you_mean(str, candidates)

Value

(character(1)). Either a phrase suggesting one or more candidates from candidates, or an empty string if no close match is found.

Arguments

str

(character(1))
String.

candidates

(character())
Candidate strings.

Examples

Run this code
did_you_mean("yep", c("yes", "no"))

Run the code above in your browser using DataLab