Skip to content

we-miks/ac_automaton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ac automaton

This package implements ac automaton algorithm for fast matching many patterns in string.

example

A simple use case:

package main

import (
"fmt"
"github.com/we-miks/ac_automaton"
)

func main() {
    patterns := []string{"i", "is", "his", "her", "hers", "she"}
    ac := ac_automaton.NewACAutomaton()
    for _, pattern := range patterns {
        ac.Insert(pattern)
    }
    ac.Build()
    s := "uthersheis"
    res := ac.FindMatches(s)
    fmt.Println(res)
}

Releases

No releases published

Packages

No packages published

Languages