simstring_rust 0.3.4

A native Rust implementation of the SimString algorithm
Documentation
mod hashdb;

use crate::extractors::FeatureExtractor;
use lasso::{Rodeo, Spur};
use rustc_hash::FxHashSet;
use std::sync::{Arc, Mutex};

pub type StringId = usize;

pub trait Database: Send + Sync {
    fn insert(&mut self, text: String);
    fn clear(&mut self);
    fn lookup_strings(&self, size: usize, feature: Spur) -> Option<&FxHashSet<StringId>>;
    fn get_string(&self, id: StringId) -> Option<&str>;
    fn get_features(&self, id: StringId) -> Option<&Vec<Spur>>;
    fn feature_extractor(&self) -> &dyn FeatureExtractor;
    fn max_feature_len(&self) -> usize;
    fn interner(&self) -> Arc<Mutex<Rodeo>>;
    fn total_strings(&self) -> usize;
}

pub use hashdb::HashDb;