Skip to content

Latest commit

 

History

History
20 lines (12 loc) · 482 Bytes

README.md

File metadata and controls

20 lines (12 loc) · 482 Bytes

Scala implementation of Aho-Corasick algorithm

This is a simple implementation of Aho-Corasick algorithm written in purely scala, which is byte-oriented. The best feature is that it supports adding the property of word.

Usage

// create AC automaton
val ac = new Automaton
// "user defined" is the property of words
ac.addWords("user defined", "he", "she", "his", "hers")
ac.setFailTransitions()

// search pattern string
val results = ac.search("ushers")