Struct simple_trie::Trie[][src]

pub struct Trie {
    pub nodes: Vec<Node>,
    pub synonym_dict: Vec<Vec<String>>,
}

Fields

nodes: Vec<Node>synonym_dict: Vec<Vec<String>>

Implementations

impl Trie[src]

pub fn new() -> Trie[src]

pub fn insert(&mut self, string: &str, val: Option<u32>)[src]

pub fn insert_synonym(&mut self, string: &str, synonyms: Vec<String>)[src]

pub fn search(&self, string: &str) -> Option<u32>[src]

pub fn get_all_tokens(&self, input: &str) -> Vec<Token>[src]

function that gets the highest scoring (sum of values) combination of tokens

Auto Trait Implementations

impl RefUnwindSafe for Trie

impl Send for Trie

impl Sync for Trie

impl Unpin for Trie

impl UnwindSafe for Trie

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.