Struct rsmorphy::container::dict::Dictionary
[−]
[src]
pub struct Dictionary { pub word_lower: Word, pub para_id: u16, pub idx: u16, }
Fields
word_lower: Word
para_id: u16
idx: u16
Methods
impl Dictionary
[src]
fn iter_lexeme<'s: 'i, 'm: 'i, 'i>(
&'s self,
morph: &'m MorphAnalyzer
) -> impl Iterator<Item = Lex> + 'i
&'s self,
morph: &'m MorphAnalyzer
) -> impl Iterator<Item = Lex> + 'i
Trait Implementations
impl Debug for Dictionary
[src]
impl Clone for Dictionary
[src]
fn clone(&self) -> Dictionary
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Dictionary
[src]
fn eq(&self, __arg_0: &Dictionary) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Dictionary) -> bool
This method tests for !=
.
impl Source for Dictionary
[src]
fn score(&self) -> Score
fn is_lemma(&self) -> bool
fn is_known(&self) -> bool
fn get_word(&self) -> Cow<str>
fn get_normal_form(&self, morph: &MorphAnalyzer) -> Cow<str>
fn get_tag<'m>(&self, morph: &'m MorphAnalyzer) -> &'m OpencorporaTagReg
fn try_get_para_id(&self) -> Option<u16>
fn write_word<W: Write>(&self, f: &mut W) -> Result
fn write_normal_form<W: Write>(
&self,
f: &mut W,
morph: &MorphAnalyzer
) -> Result
&self,
f: &mut W,
morph: &MorphAnalyzer
) -> Result
fn get_lexeme(&self, morph: &MorphAnalyzer) -> Vec<Lex>
fn get_lemma(&self, morph: &MorphAnalyzer) -> Lex
impl MorphySerde for Dictionary
[src]
fn encode<W: Write>(&self, f: &mut W) -> Result
fn decode(s: &str) -> Result<(&str, Self), DecodeError>
use rsmorphy::container::Dictionary; use rsmorphy::container::Word; use rsmorphy::container::abc::*; assert_eq!( Dictionary::decode(r"d:сталь,d"), Ok(("", Dictionary { word_lower: Word { word: "сталь".into(), is_known: true }, para_id: 0xd, idx: 0 })) ); assert_eq!( Dictionary::decode(r"d:стали,d,1"), Ok(("", Dictionary { word_lower: Word { word: "стали".into(), is_known: true }, para_id: 0xd, idx: 1 })) ); assert_eq!( Dictionary::decode(r"f:бутявкает,2cb,9"), Ok(("", Dictionary { word_lower: Word { word: "бутявкает".into(), is_known: false }, para_id: 0x2cb, idx: 9 })) ); assert_eq!( Dictionary::decode(r"d:стали"), Err(DecodeError::UnexpectedEnd) );