Simple Aho-Corasick algorhythm implementaiton for TypeScript.
npm i @monyone/aho-corasick
import { AhoCorasick } from '@monyone/aho-corasick';
const ahocorasick = new AhoCorasick(keywords);
const hasAnyKeyword: boolean = ahocorasick.hasKeywordInText(text);
import { AhoCorasick } from '@monyone/aho-corasick';
const ahocorasick = new AhoCorasick(keywords);
const match: { begin: number, end: number, keyword: string}[] = ahocorasick.matchInText(text);
import { DynamicAhoCorasick } from '@monyone/aho-corasick';
const ahocorasick = new DynamicAhoCorasick(keywords);
ahocorasick.add('test')
ahocorasick.delete('test')
const match: { begin: number, end: number, keyword: string}[] = ahocorasick.matchInText(text);