Skip to content

rossmerr/fm-index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FM-index

Go Go Report Card Read the Docs

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))

Operation

Count

count := index.Count("jumps")
fmt.Println(count) // 1

Locate

matches := index.Locate("jumps")
fmt.Println(matches) // []int{20}

Extract

text := index.Extract(matches[0], 5)
fmt.Println(text) // "jumps"