A FM-index using Wavelet Tree's to store the Burrows–Wheeler transform. A Prefix Tree using BitVector and a Sampled Suffix Array, for storing the offsets.
The Prefix Tree can be shared across FM-indexs to reduce storage needs.
index, err := NewFMIndex("The quick brown fox jumps over the lazy dog", WithCompression(2))
count := index.Count("jumps")
fmt.Println(count) // 1
matches := index.Locate("jumps")
fmt.Println(matches) // []int{20}
text := index.Extract(matches[0], 5)
fmt.Println(text) // "jumps"