woozy_search 2.0.3 copy "woozy_search: ^2.0.3" to clipboard
woozy_search: ^2.0.3 copied to clipboard

A super simple and lightweight client-side fuzzy-search library based on Levenshtein distance.

example/example.dart

import 'package:woozy_search/woozy_search.dart';

void woozySearch(woozy, query) {
  final output = woozy.search(query);
  print("Search for: '$query':");
  output.forEach((element) => print(' - $element'));
  print('---\n');
}

void basicUsage() {
  final woozy = Woozy();
  woozy.addEntries(['basketball', 'badminton', 'skating']);
  woozySearch(woozy, 'badmi');
}

void withAssociatedValues() {
  final woozy = Woozy();
  woozy.addEntry('John Doe', value: '+1 210-269-0117');
  woozy.addEntry('Nate Humphrey', value: '+1 (416) 527-4927');
  woozy.addEntry('Serena Waldorf', value: '+ 1 914-514-7901');
  woozySearch(woozy, 'humphray');
}

void withSearchOutputLimit() {
  final woozy = Woozy(limit: 2);
  woozy.setEntries(List.filled(100, 'foo'));
  woozySearch(woozy, 'f');
}

void withCaseSensitive() {
  final woozy = Woozy(caseSensitive: true);
  woozy.setEntries(['FOO', 'boo']);
  woozySearch(woozy, 'foo');
}

void main() {
  basicUsage();

  withAssociatedValues();

  withSearchOutputLimit();

  withCaseSensitive();
}
24
likes
150
points
1.93k
downloads

Publisher

unverified uploader

Weekly Downloads

A super simple and lightweight client-side fuzzy-search library based on Levenshtein distance.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

collection

More

Packages that depend on woozy_search