extractOne<T> function

ExtractedResult<T> extractOne<T>({
  1. required String query,
  2. required List<T> choices,
  3. int cutoff = 0,
  4. Applicable ratio = const WeightedRatio(),
  5. String getter(
    1. T obj
    )?,
})

Find the single best match above the cutoff in a list of choices. getter is optional for String types, but MUST NOT be null for any other types

Implementation

ExtractedResult<T> extractOne<T>({
  required String query,
  required List<T> choices,
  int cutoff = 0,
  Applicable ratio = const WeightedRatio(),
  String Function(T obj)? getter,
}) {
  var extractor = Extractor(cutoff);
  return extractor.extractOne(query, choices, ratio, getter);
}