10 releases

0.1.0 Jun 14, 2024
0.0.9 Jun 13, 2024
0.0.6 Apr 16, 2024
0.0.5 Mar 27, 2024
0.0.2 Sep 27, 2023

#50 in Database implementations

Download history 14/week @ 2024-03-09 2/week @ 2024-03-16 80/week @ 2024-03-23 41/week @ 2024-03-30 8/week @ 2024-04-06 127/week @ 2024-04-13 6/week @ 2024-04-20 1/week @ 2024-05-18 404/week @ 2024-06-08 99/week @ 2024-06-15 1/week @ 2024-06-22

504 downloads per month

MIT license

40KB
1K SLoC

furze

finite state transducers (fst) writen in rust, refer to the Lucene fst implementation. The FST stores all terms in bytes and reuses the prefix and suffix of term Index to make it small enough to fit into memory, reducing storage space, commonly used in search engines, speech recognition and natural language search.

Example:

use furze::Builder;
use furze::FST;
fn main() {
    let mut b = Builder::new(vec![]);
    b.add("cat".as_bytes(), 5);
    b.add("dog".as_bytes(), 10);
    b.add("deep".as_bytes(), 15);
    b.add("logs".as_bytes(), 2);
    b.finish();

    let mut d = FST::load(b.get().to_vec());
    let res = d.find("logs".as_bytes());
    match res {
        Ok(v) => {
            println!("out:{}", v);
        }
        Err(e) => {
            println!("error:{:?}", e);
        }
    }
}

terminal:

out:2

Dependencies

~0.4–0.9MB
~20K SLoC