getMostFrequentFacts method

List<SemanticFact> getMostFrequentFacts(
  1. int n
)

Returns the n most frequently seen facts.

Implementation

List<SemanticFact> getMostFrequentFacts(int n) {
  final all = _byId.values.toList()
    ..sort((a, b) => b.occurrences.compareTo(a.occurrences));
  return all.take(n).toList();
}