Skip to main content

Group

Enum Group 

Source
#[non_exhaustive]
pub enum Group { Distance, Source, Target, Left, Right, Children, Gap, AfterHead, Agree, }
Expand description

A group of features of a decision.

The name of a feature starts as CaboCha writes it; the examples are for 彼 / は as the source.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Distance

The number of bunsetsu from the source to the target, in three classes: DIST:1, DIST:2-5, DIST:6-.

§

Source

The source: the surface, the levels of the part of speech and the conjugation form of its head (SHS:彼, SHP0:名詞), its function word (SFS:は), its first and its last morpheme (SLS:, SRS:); its punctuation (SPUNC:、), its brackets (SOB:「, SOB:1, SCB:」, SCB:1), each of its particles (SCASE:は), and whether it is the first or the last bunsetsu of the sentence (SBOS:1, SEOS:1).

§

Target

The target: what Group::Source has, with D in front (DHS:読ん).

§

Left

The bunsetsu before the source: the surface of its function word (LF:).

§

Right

The bunsetsu after the target: the surfaces of its first morpheme, its head and its function word (RL:, RH:, RF:).

§

Children

The bunsetsu already attached to the source (a:) and to the target (A:), each by its function word: the surface of a word of Schema::lexicalized, or else the conjugation form, or else the part of speech. These are the only features that depend on the decisions made before.

§

Gap

The bunsetsu between the source and the target: their punctuation (GPUNC:、), their brackets (GOB:「, GCB:」), the function word of each when it is a particle (GCASE:を), and whether brackets open or close in between: GNB:1 for neither, GOB:1, GCB:1, GBB:1 for both.

§

AfterHead

The morpheme after the head of the source (SNS:, SNP0:, SNF:) and of the target (DNS:): its surface, the levels of its part of speech and its conjugation form. CaboCha has no such feature. Its head is the last word of a bunsetsu that is not a function word; the head of a Schema can be the content word before it (利用 in 利用 / し / た, 読む in 読む / こと / を), and the word that follows says what the bunsetsu is as a whole.

§

Agree

Whether the heads of the source and of the target agree: the same surface (AGS:1), and the same part of speech down to a level (AGP0:1 when the first level is the same, AGP1:1 when the first two are, and so on). A hint of coordination: 東京 and 京都 agree to the last level, 友人 and 京都 at the first only. J.DepP has the first feature, CaboCha neither. Not in the default set (#1528).

Implementations§

Source§

impl Group

Source

pub fn name(self) -> &'static str

The name of the group: distance, source, target, left, right, children, gap, after or agree.

§Returns

The name.

Source

pub fn from_name(name: &str) -> Option<Self>

The group with a name.

§Arguments
§Returns

The group, or None for another name.

Trait Implementations§

Source§

impl Clone for Group

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Group

Source§

impl Debug for Group

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Group

Source§

impl Hash for Group

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Group

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Group

Auto Trait Implementations§

§

impl Forget for Group

§

impl Freeze for Group

§

impl Move for Group

§

impl RefUnwindSafe for Group

§

impl Send for Group

§

impl Sync for Group

§

impl Unpin for Group

§

impl UnsafeUnpin for Group

§

impl UnwindSafe for Group

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.