[−][src]Struct ngram_search::Ngrams
Ngrams index of strings backed by a file.
Implementations
impl Ngrams
[src]
pub fn builder() -> NgramsBuilder
[src]
Return a builder object used to build an index.
pub fn open(path: &Path) -> Result<Ngrams>
[src]
Open an index from a file.
pub fn search(
&mut self,
string: &str,
threshold: f32
) -> Result<Vec<(u32, f32)>>
[src]
&mut self,
string: &str,
threshold: f32
) -> Result<Vec<(u32, f32)>>
Search for a string in the index.
Returns a vector of pairs (string id, score)
sorted by descending
scores.
Auto Trait Implementations
impl RefUnwindSafe for Ngrams
impl Send for Ngrams
impl Sync for Ngrams
impl Unpin for Ngrams
impl UnwindSafe for Ngrams
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,