Skip to content

hrz123/goAcAutoMachine

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

goAcAutoMachine

Build Status GoDoc

Go 实现多模式字符串匹配的 AC 自动机

Install

go get "github.com/zheng-ji/goAcAutoMachine"

Example

package main

import (
    "fmt"
    "github.com/zheng-ji/goAcAutoMachine"
)

func main() {
    ac := goAcAutoMachine.NewAcAutoMachine()
    ac.AddPattern("红领巾")
    ac.AddPattern("祖国")
    ac.AddPattern("花朵")
    ac.Build()

    content := "我是红领巾,祖国未来的花朵"
    results := ac.Query(content)
    for _, result := range results {
        fmt.Println(result)
    }
}

License

Copyright (c) 2019 by zheng-ji released under MIT License.

About

Go 实现的 AC 自动机

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%