taismassaro / aho-corasick

An example implementation of the Aho-Corasick algorithm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aho-Corasick

An example implementation of the algorithm to search for patterns in a string.

const patterns = ["cat", "car", "cargo", "dog", "door"];

const trie = buildTrie(patterns);

searchTrie(trie, "The cat chased the dog through the door with its car");

// [ "cat", "dog", "car" ]

About

An example implementation of the Aho-Corasick algorithm

License:MIT License


Languages

Language:TypeScript 100.0%