extractTop<T> method
List<ExtractedResult<T> >
extractTop<T>(
- String query,
- List<
T> choices, - Applicable func,
- int limit, [
- String getter(
- T obj
Creates a sorted list of ExtractedResult which contain the top limit
most similar choices using k-top heap sort
Implementation
List<ExtractedResult<T>> extractTop<T>(
String query, List<T> choices, Applicable func, int limit,
[String Function(T obj)? getter]) {
var best = extractWithoutOrder(query, choices, func, getter);
var results = _findTopKHeap(best, limit);
return results.reversed.toList();
}