aho_corasick 2.0.0 copy "aho_corasick: ^2.0.0" to clipboard
aho_corasick: ^2.0.0 copied to clipboard

Pattern Matching implementation of aho_corasick using a state machine to find all matches in a text for a large number of words.

example/aho_corasick_example.dart

import 'package:aho_corasick/aho_corasick.dart';

void 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 ?? 'no match found');
}
4
likes
130
pub points
53%
popularity

Publisher

unverified uploader

Pattern Matching implementation of aho_corasick using a state machine to find all matches in a text for a large number of words.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

More

Packages that depend on aho_corasick