suffix-array-rust 0.1.0

A simple library that can be used to perform suffix array operations
Documentation
  • Coverage
  • 0%
    0 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 9.18 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.06 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • petar-dambovaliev/suffix-array-rust
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • petar-dambovaliev

Suffix Array

This package provides common functionality associated with suffix arrays. It uses the LCP array addition as well.

    let s = String::from("azaza");
    let sa = array::new(s.as_str());
    let subs = sa.distinct_sub();
    
    
    let s = String::from("azaza");
    let sa = array::new(s.as_str());
    assert_eq!(9, sa.distinct_sub_count());
    
    let s = String::from("azaza");
    let sa = array::new(s.as_str());
    assert_eq!(15, sa.sub_count());
    
    let s = String::from("abracadabra");
    let sa = array::new(s.as_str());
    let lrs = sa.longest_repeated_substr();

    assert_eq!(1, lrs.len());
    assert_eq!("abra", str::from_utf8(&lrs[0]).unwrap());