pub struct Compound {
pub parts: Vec<Part>,
}Expand description
1つ以上の要素からなる名詞。単数形と複数形を持つ。
最後の要素だけが文脈の数に従い、それ以外は単数形になる。
Fields§
§parts: Vec<Part>Implementations§
Source§impl Compound
impl Compound
pub fn noun(name: impl Into<String>) -> Self
pub fn literal(text: impl Into<String>) -> Self
Sourcepub fn as_single_noun(&self) -> Option<&str>
pub fn as_single_noun(&self) -> Option<&str>
単一の名詞ならその名前。
pub fn singular(&self, dict: &Dict, separator: &str) -> String
pub fn plural(&self, dict: &Dict, separator: &str) -> String
Sourcepub fn as_written(&self, separator: &str) -> String
pub fn as_written(&self, separator: &str) -> String
屈折させず、書かれたまま連結する。
Trait Implementations§
impl Eq for Compound
impl StructuralPartialEq for Compound
Auto Trait Implementations§
impl Freeze for Compound
impl RefUnwindSafe for Compound
impl Send for Compound
impl Sync for Compound
impl Unpin for Compound
impl UnsafeUnpin for Compound
impl UnwindSafe for Compound
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.