sa

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

README


BWT construction by inducing SA


var text []byte
// fill data in buffer text
...

// transform text to BWT, cnt is length of original text
cnt, bwt, _ := BWT(text)

Please note, this implementation is different from others in following:

  1. sentinel starts from the beginning of the text, ie, LMS is actually RMS.
  2. only supports UTF-8 encoded text input
  3. Multi strings use byte value (1) as divider

References

This implementation has referenced the following papers and code

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aux

type Aux struct {
	// Len length
	Len uint

	// Eob End of Bucket
	Eob [][]uint

	// Dist distribution
	Dist []uint

	// Hist histogram
	Hist []uint

	// dictionary, [0] -> 0, [1] -> 1, [2] -> can be any char
	Dict []byte
}

Aux Auxiliary for merge

func BWT

func BWT(t []byte) (int, []byte, *Aux)

BWT transforms t into BWT, returns the length of BWT, BWT and auxiliary data structure can be used to merge BWTs

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL