extractOne<T> method
ExtractedResult<T>
extractOne<T>(
- String query,
- List<
T> choices, - Applicable func, [
- String getter(
- T obj
Find the single best match above a score in a list of choices
Implementation
ExtractedResult<T> extractOne<T>(
String query, List<T> choices, Applicable func,
[String Function(T obj)? getter]) {
var extracted = extractWithoutOrder(query, choices, func, getter);
return extracted.reduce(
(value, element) => value.score > element.score ? value : element);
}