fuzzy 0.2.3 copy "fuzzy: ^0.2.3" to clipboard
fuzzy: ^0.2.3 copied to clipboard

outdated

Fuzzy search in Dart. Basically a code conversion, subset of Fuse.js.

example/main.dart

import 'package:fuzzy/fuzzy.dart';

void main() {
  final bookList = [
    'Old Man\'s War',
    'The Lock Artist',
    'HTML5',
    'Right Ho Jeeves',
    'The Code of the Wooster',
    'Thank You Jeeves',
    'The DaVinci Code',
    'Angels & Demons',
    'The Silmarillion',
    'Syrup',
    'The Lost Symbol',
    'The Book of Lies',
    'Lamb',
    'Fool',
    'Incompetence',
    'Fat',
    'Colony',
    'Backwards, Red Dwarf',
    'The Grand Design',
    'The Book of Samson',
    'The Preservationist',
    'Fallen',
    'Monster 1959',
  ];
  final fuse = Fuzzy(
    bookList,
    options: FuzzyOptions(
      findAllMatches: true,
      tokenize: true,
      threshold: 0.5,
    ),
  );

  final result = fuse.search('book');

  print(
      'A score of 0 indicates a perfect match, while a score of 1 indicates a complete mismatch.');

  result.forEach((r) {
    print('\nScore: ${r.score}\nTitle: ${r.item}');
  });
}
97
likes
0
pub points
95%
popularity

Publisher

verified publisherborges.dev

Fuzzy search in Dart. Basically a code conversion, subset of Fuse.js.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

latinize, meta

More

Packages that depend on fuzzy