Crate libdivsufsort_rs

Source
Expand description

§libdivsufsort-rs

libdivsufsort-rs is rust wrapper of libdivsufsort
Including all APIs of both 32- and 64-bit version.

  • More details are in included in original C codes of libdivsufsort
  • I referred to pzip-bwt crate, which is more simpler version for wrapping around bwt function of libdivsufsort

Functions§

bw_transform
“Constructs the burrows-wheeler transformed string of a given string and suffix array.”
Input: Vector of bytes & its suffix array
A input vector is transformed to burrows wheeler transformed string
Output: Primary index(usually $ sign) of burrows wheeler transformed string
bw_transform64
64-bit version of bw_transform
divbwt
“Constructs the burrows-wheeler transformed string of a given string.”
Input: Vector of bytes
A input vector is transformed to burrows wheeler transformed string
Output: Primary index(usually $ sign) of burrows wheeler transformed string
divbwt64
64-bit version of divbwt
divsufsort
“Constructs the suffix array of a given string.”
Input: Vector of bytes
Output: Suffix array
divsufsort64
64-bit version of divsufsort
divsufsort64_version
64-bit version of divsufsort_version
divsufsort_version
“Returns the version of the divsufsort library.”
inverse_bw_transform
“Inverse BW-transforms a given BWTed string.”
Input: Vector of bytes(burrows wheeler transformed) & its primary index
A input vector is transformed to original string
Output: If no error occured, get Some value of unit. Otherwise, None.
inverse_bw_transform64
64-bit version of inverse_bw_transform
sa_search
“Search for the pattern P in the string T.”
Input: Vector of bytes & its suffix array and vector of pattern string.
Output: tuple of index of suffix array for matched pattern and pattern count
Even with multiple counts, only one index is output.
sa_search64
64-bit version of sa_search
sa_simplesearch
“Search for the character c in the string T.”
Input: Vector of bytes & its suffix array and i32 encoded character.
example of i32 encoding:
sa_simplesearch64
64-bit version of sa_simplesearch
sufcheck
“Checks the correctness of a given suffix array.”
Input: Vector of bytes & its suffix array & verbose option
If verbose is true, additional information is printed to stdout.
Output: If no error occured, get Some value of unit. Otherwise, None.
sufcheck64
64-bit version of sufcheck