libsais-rs 0.1.0

Rust translation of libsais for suffix array construction and related transforms
Documentation
  • Coverage
  • 0%
    0 out of 313 items documented0 out of 279 items with examples
  • Size
  • Source code size: 2.13 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 3.66 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 28s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • henriksson-lab/libsais-rs
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mahogny
libsais-rs-0.1.0 has been yanked.

libsais-rs

libsais-rs is a Rust translation of IlyaGrebnov/libsais for suffix array construction and related transforms.

This crate currently tracks upstream libsais version 2.10.4. The Rust code is intended to stay behaviorally close to upstream, but this remains an early translation and should be treated as experimental until it has seen broader validation.

Status

  • Intended for users who want a Rust-native library interface to libsais
  • Translation project, not an official upstream release
  • Bug reports should go to this repository, not the original libsais project

Usage

[dependencies]
libsais-rs = "0.1.0"
use libsais_rs::{libsais, SaSint};

fn main() {
    let text = b"banana";
    let mut sa = vec![0 as SaSint; text.len()];

    let rc = libsais(text, &mut sa, 0, None);
    assert_eq!(rc, 0, "libsais failed with status {rc}");

    println!("{sa:?}");
}

Notes:

  • sa.len() must be at least text.len() + fs
  • fs is extra scratch space made available at the tail of sa
  • freq, when used, must have length at least 256

Development

Run tests with:

cargo test

Run the local Rust-vs-C benchmark example with:

cargo run --release --example bench_vs_c

Upstream Sources

The repository vendors the upstream C sources under libsais/ for reference and parity testing.

Upstream project:

License

Apache License 2.0.