[][src]Struct ngram_search::Ngrams

pub struct Ngrams { /* fields omitted */ }

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.