Struct jp_inflections::Verb[][src]

pub struct Verb {
    pub word: Word,
    pub verb_type: VerbType,
}
Expand description

Represents a Japanese verb

Fields

word: Wordverb_type: VerbType

Implementations

Returns a new verb

Same as Word::get_reading(&self)

Returns true if self is in dictionary form

Example

use jp_inflections::{Word, VerbType};

let verb = Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).unwrap();
assert!(verb.is_dict_form());

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.