Struct jp_inflections::Verb [−][src]
Expand description
Represents a Japanese verb
Fields
word: Word
verb_type: VerbType
Implementations
Same as Word::get_reading(&self)
Returns the stem of a word
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.get_stem(WordForm::Long).unwrap().kana, String::from("ならい")); assert_eq!(verb.get_stem(WordForm::Long).unwrap().kanji.unwrap(), String::from("習い")); assert_eq!(verb.get_stem(WordForm::Short).unwrap().kana, String::from("ならわ")); assert_eq!(verb.get_stem(WordForm::Short).unwrap().kanji.unwrap(), String::from("習わ"));
Returns the dictionary form of a word
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.dictionary(WordForm::Long).unwrap().kana, String::from("ならいます")); assert_eq!(verb.dictionary(WordForm::Long).unwrap().kanji.unwrap(), String::from("習います")); assert_eq!(verb.dictionary(WordForm::Short).unwrap().kana, String::from("ならう")); assert_eq!(verb.dictionary(WordForm::Short).unwrap().kanji.unwrap(), String::from("習う"));
Returns the negative form of a verb
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.negative(WordForm::Short).unwrap().kana, String::from("ならわない")); assert_eq!(verb.negative(WordForm::Short).unwrap().kanji.unwrap(), String::from("習わない")); assert_eq!(verb.negative(WordForm::Long).unwrap().kana, String::from("ならいません")); assert_eq!(verb.negative(WordForm::Long).unwrap().kanji.unwrap(), String::from("習いません"));
Returns the verb in its て form.
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.te_form().unwrap().kana, String::from("ならって")); assert_eq!(verb.te_form().unwrap().kanji.unwrap(), String::from("習って"));
Returns the verb in its negative て form.
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.negative_te_form().unwrap().kana, String::from("ならわなくて")); assert_eq!(verb.negative_te_form().unwrap().kanji.unwrap(), String::from("習わなくて"));
Returns the verb in the past form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.past(WordForm::Short).unwrap().kana, String::from("ならった")); assert_eq!(verb.past(WordForm::Short).unwrap().kanji.unwrap(), String::from("習った")); assert_eq!(verb.past(WordForm::Long).unwrap().kana, String::from("ならいました")); assert_eq!(verb.past(WordForm::Long).unwrap().kanji.unwrap(), String::from("習いました"));
Returns the verb in the negative past form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.negative_past(WordForm::Short).unwrap().kana, String::from("ならわなかった")); assert_eq!(verb.negative_past(WordForm::Short).unwrap().kanji.unwrap(), String::from("習わなかった")); assert_eq!(verb.negative_past(WordForm::Long).unwrap().kana, String::from("ならいませんでした")); assert_eq!(verb.negative_past(WordForm::Long).unwrap().kanji.unwrap(), String::from("習いませんでした"));
Returns the verb in the potential form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.potential(WordForm::Short).unwrap().kana, String::from("ならえる")); assert_eq!(verb.potential(WordForm::Short).unwrap().kanji.unwrap(), String::from("習える")); assert_eq!(verb.potential(WordForm::Long).unwrap().kana, String::from("ならえます")); assert_eq!(verb.potential(WordForm::Long).unwrap().kanji.unwrap(), String::from("習えます"));
Returns the verb in the negative potential form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap(); assert_eq!(verb.negative_potential(WordForm::Short).unwrap().kana, String::from("ならえない")); assert_eq!(verb.negative_potential(WordForm::Short).unwrap().kanji.unwrap(), String::from("習えない")); assert_eq!(verb.negative_potential(WordForm::Long).unwrap().kana, String::from("ならえません")); assert_eq!(verb.negative_potential(WordForm::Long).unwrap().kanji.unwrap(), String::from("習えません"));
Returns the verb in the causative form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("たべる", Some("食べる")).into_verb(VerbType::Ichidan).unwrap(); assert_eq!(verb.causative().unwrap().kana, String::from("たべさせる")); assert_eq!(verb.causative().unwrap().kanji.unwrap(), String::from("食べさせる"));
Returns the verb in the negative causative form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("たべる", Some("食べる")).into_verb(VerbType::Ichidan).unwrap(); assert_eq!(verb.negative_causative().unwrap().kana, String::from("たべさせない")); assert_eq!(verb.negative_causative().unwrap().kanji.unwrap(), String::from("食べさせない"));
Returns the verb in the passive form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("たべる", Some("食べる")).into_verb(VerbType::Ichidan).unwrap(); assert_eq!(verb.passive().unwrap().kana, String::from("たべられる")); assert_eq!(verb.passive().unwrap().kanji.unwrap(), String::from("食べられる"));
Returns the verb in the negative passive form
Example
use jp_inflections::{Word, VerbType, WordForm}; let verb = Word::new("たべる", Some("食べる")).into_verb(VerbType::Ichidan).unwrap(); assert_eq!(verb.negative_passive().unwrap().kana, String::from("たべられない")); assert_eq!(verb.negative_passive().unwrap().kanji.unwrap(), String::from("食べられない"));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Verb
impl UnwindSafe for Verb
Blanket Implementations
Mutably borrows from an owned value. Read more