[][src]Trait rust2vec::vocab::Vocab

pub trait Vocab: Clone {
    fn idx(&self, word: &str) -> Option<WordIndex>;
fn len(&self) -> usize;
fn words(&self) -> &[String]; }

Embedding vocabularies.

Required methods

fn idx(&self, word: &str) -> Option<WordIndex>

Get the index of a token.

fn len(&self) -> usize

Get the vocabulary size.

fn words(&self) -> &[String]

Get the words in the vocabulary.

Loading content...

Implementors

impl Vocab for VocabWrap[src]

fn len(&self) -> usize[src]

Get the vocabulary size.

fn words(&self) -> &[String][src]

Get the words in the vocabulary.

impl Vocab for SimpleVocab[src]

impl Vocab for SubwordVocab[src]

Loading content...