github.com/glkz/rabinkarp

Rabin-Karp multiple pattern string search


License
MIT
Install
go get github.com/glkz/rabinkarp

Documentation

Rabin-Karp multiple pattern search

A golang implementation of Rabin-Karp algorithm.

Provides searching multiple patterns with an average O(n+m) time complexity (where n is the length of text and m is the combined length of pattern strings).

Installation

$ go get github.com/glkz/rabinkarp

Usage

import "github.com/glkz/rabinkarp"

func main() {
  rabinkarp.Search("the text you want to search in", []string{"the", "keywords"})
  // returns []string{"the"}
}

See GoDoc