index/suffixarray
Package suffixarray
Overview
Package suffixarray implements substring search in logarithmic time using an in-memory suffix array.
Example use:
// create index for some data index := suffixarray.New(data) // lookup byte slice s offsets1 := index.Lookup(s, -1) // the list of all indices where s occurs in data offsets2 := index.Lookup(s, 3) // the list of at most 3 indices where s occurs in data