| Crates.io | sa-ord |
| lib.rs | sa-ord |
| version | 0.0.1 |
| created_at | 2022-09-18 16:40:23.009324+00 |
| updated_at | 2022-09-18 16:40:23.009324+00 |
| description | Pure Rust implementation of the Suffix Array by Induced Sorting algorithm. |
| homepage | https://github.com/NatPRoach/sa_ord |
| repository | https://github.com/NatPRoach/sa_ord |
| max_upload_size | |
| id | 668701 |
| size | 26,508 |
Pure Rust implementation of the SA-IS suffix array algorithm
for slices of types that impl Ord + Hash + Clone + Debug
The last character of the slice must be the smallest character in the text in order for the algorithm to work properly. This can be achieved by adding a terminator character.
Usage:
use sa_ord::sais
let paper_example = "mmiissiissiippii$".as_bytes();
assert_eq!(
sais(paper_example).unwrap(),
[16, 15, 14, 10, 6, 2, 11, 7, 3, 1, 0, 13, 12, 9, 5, 8, 4].to_vec()
);