aho_corasick 1.0.0 aho_corasick: ^1.0.0 copied to clipboard
A starting point for Dart libraries or applications.
example/aho_corasick_example.dart
import 'package:aho_corasick/aho_corasick.dart';
main() {
final aho = AhoCorasick.fromWordList(['abc', 'bcd', 'bcde']);
final results = aho.matches('search in abcd');
print(results
.map((match) => 'found ${match.word} at ${match.startIndex}')
.join('\n'));
final longest = aho.firstMatch('bcde', longest: true);
print(longest.word);
}