Struct jp_inflections::Word [−][src]
pub struct Word {
pub kana: String,
pub kanji: Option<String>,
pub inflections: Vec<Inflection>,
}
Expand description
Represents a japanese word
Fields
kana: String
kanji: Option<String>
inflections: Vec<Inflection>
Implementations
Creates a new Word
value of a kana and optionally kanji word. Requires both words to be
in the dictionary form
Returns a verb from the word. Requires the word to be a verb in the dictionary form
Example
use jp_inflections::{Word, VerbType};
assert!(Word::new("ならう", Some("習う")).into_verb(VerbType::Godan).is_ok());
Returns true if self
has the passed readings. If kanji is none, but the word has a
kanji reading the output represents only a kana match
Returns true if the words readings end with the passed strings. If the kanji is none, but the word has a kanji reading the output represents only a kana match
Returns the kanji reading if possible, otherwise the kana reading gets returned
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Word
impl UnwindSafe for Word
Blanket Implementations
Mutably borrows from an owned value. Read more