Naive Burrows-Wheeler transform implementation
A very simple implementation of the Burrows-Wheeler transform. This is mainly made as a demonstration of ndarray-string and ndarray-sort.
var bwt = require"burrows-wheeler"//Execute a forward transformvar y = bwt1 "banana"console.logy//Inverse transformvar z = bwt-1 yconsole.logz
npm install burrows-wheeler
Applies the Burrows-Wheeler transform to string.
directionif set to 1 does a forward transform, else if set to -1 does an inverse transform
stringis the string to transform
Returns The forward/inverse Burrows-Wheeler transform of string
(c) 2013 Mikola Lysenko. MIT License