Nicolas Patry 001b169024 Initial commit.
2020-06-06 10:13:54 +02:00
2020-06-06 10:13:54 +02:00
2020-06-06 10:13:54 +02:00
2020-06-06 10:13:54 +02:00
2020-06-06 10:13:54 +02:00
2020-06-06 10:13:54 +02:00
2020-06-06 09:47:07 +02:00
2020-06-06 10:13:54 +02:00
2020-06-06 10:13:54 +02:00

esaxx-rs

Small wrapper around sentencepiece's esaxx suffix array C++ library. Usage

let string = "abracadabra".to_string();
let chars: Vec<_> = string.chars().collect();
let n = chars.len();
let mut sa = vec![0; n];
let mut l = vec![0; n];
let mut r = vec![0; n];
let mut d = vec![0; n];
let mut node_num = 0;

let alphabet_size = 0x110000; // All UCS4 range.
unsafe {
    esaxx_int32(
        chars.as_ptr() as *mut u32,
        sa.as_mut_ptr(),
        l.as_mut_ptr(),
        r.as_mut_ptr(),
        d.as_mut_ptr(),
        n.try_into().unwrap(),
        alphabet_size,
        &mut node_num,
    );
}

Current version: 0.1.0

License: Apache

Description
No description provided
Readme Apache-2.0 236 KiB
Languages
C++ 52.6%
Rust 47.4%