similarities method
This method returns a Set<String>
of candidates accepted by the generated Levenshtein's Automaton for the input.
Implementation
Set<String> similarities({
required String input,
required List<String> candidates,
int distance = 1,
Set<String>? customAlphabet,
}) {
final inputAutomaton = LevenshteinAutomaton(
input: input,
distance: distance,
customAlphabet: customAlphabet,
);
return candidates.where(inputAutomaton.evaluate).toSet();
}