word-match-helper
v2.1.0
Published
Aho-Corasick based word-matching class. Match & filter words.
Downloads
7
Maintainers
Readme
word-match-helper
Aho–Corasick based word checking. Match words fast.
Installation
npm install word-match-helper
development & test
npm run build
npm run dev
npm run test # basic cases
Basic Usage
import { WordMatcher } from 'word-match-helper';
const wordChecker = new WordMatcher({
targets: ['her', 'he', 'hers'],
});
// excepted matched result: ['her', 'he', 'hers']
wordChecker.search('ushers');
// add additional word list
wordChecker.addWord(['she'])
// excepted matched result: ['her', 'he', 'hers', she]
wordChecker.search('ushers');