Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

aho-corasick

hsujian2080.1.3

Aho–Corasick string matching algorithm

aho-corasick, trie, match

readme

About Build Status

aho-corasick - Aho–Corasick string matching algorithm

Installation

$ npm install hsujian/aho-corasick

Example (coffee)


  ac = new AhoCorasick()

  ac.add word, word:word for word in ['say', 'she', 'shr', 'he', 'her']

  ac.build_fail()

  actual = {}

  ac.search 'yasherhs', (found_word)->
    actual[found_word] ?= 0
    actual[found_word]++