Struct WordMetadata

Source
pub struct WordMetadata {
Show 14 fields pub noun: Option<NounData>, pub pronoun: Option<PronounData>, pub verb: Option<VerbData>, pub adjective: Option<AdjectiveData>, pub adverb: Option<AdverbData>, pub conjunction: Option<ConjunctionData>, pub swear: Option<bool>, pub dialects: DialectFlags, pub determiner: Option<DeterminerData>, pub preposition: bool, pub common: bool, pub derived_from: Option<WordId>, pub np_member: Option<bool>, pub pos_tag: Option<UPOS>,
}

Fields§

§noun: Option<NounData>§pronoun: Option<PronounData>§verb: Option<VerbData>§adjective: Option<AdjectiveData>§adverb: Option<AdverbData>§conjunction: Option<ConjunctionData>§swear: Option<bool>§dialects: DialectFlags

The dialects this word belongs to. If no dialects are defined, it can be assumed that the word is valid in all dialects of English.

§determiner: Option<DeterminerData>

Whether the word is a determiner.

§preposition: bool

Whether the word is a preposition.

§common: bool

Whether the word is considered especially common.

§derived_from: Option<WordId>§np_member: Option<bool>

Generated by a chunker

§pos_tag: Option<UPOS>

Generated by a POS tagger

Implementations§

Source§

impl WordMetadata

Source

pub fn or(&self, other: &Self) -> Self

Produce a copy of self with the known properties of other set.

Source

pub fn enforce_pos_exclusivity(&mut self, pos: &UPOS)

Given a UPOS tag, discard any metadata that would disagree with the given POS tag. For example, if the metadata suggests a word could either be a noun or an adjective, and we provide a UPOS::NOUN, this function will remove the adjective data.

Additionally, if the metadata does not currently declare the potential of the word to be the specific POS, it becomes so. That means if we provide a UPOS::ADJ to the function for a metadata whose Self::adjective = None, it will become Some.

Source

pub fn is_likely_homograph(&self) -> bool

Source

pub fn is_noun(&self) -> bool

Checks if the word is definitely a noun.

Source

pub fn is_proper_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as (a) proper.

Source

pub fn is_non_proper_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as not (a) proper.

Source

pub fn is_plural_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as (a) plural.

Source

pub fn is_non_plural_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as not (a) plural.

Source

pub fn is_mass_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as (a) mass.

Source

pub fn is_non_mass_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as not (a) mass.

Source

pub fn is_possessive_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as (a) possessive.

Source

pub fn is_non_possessive_noun(&self) -> bool

Checks if the word is definitely a noun and more specifically is labeled as not (a) possessive.

Source

pub fn is_pronoun(&self) -> bool

Checks if the word is definitely a pronoun.

Source

pub fn is_personal_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) personal.

Source

pub fn is_non_personal_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) personal.

Source

pub fn is_singular_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) singular.

Source

pub fn is_non_singular_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) singular.

Source

pub fn is_plural_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) plural.

Source

pub fn is_non_plural_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) plural.

Source

pub fn is_possessive_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) possessive.

Source

pub fn is_non_possessive_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) possessive.

Source

pub fn is_reflexive_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) reflexive.

Source

pub fn is_non_reflexive_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) reflexive.

Source

pub fn is_subject_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) subject.

Source

pub fn is_non_subject_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) subject.

Source

pub fn is_object_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as (a) object.

Source

pub fn is_non_object_pronoun(&self) -> bool

Checks if the word is definitely a pronoun and more specifically is labeled as not (a) object.

Source

pub fn is_determiner(&self) -> bool

Checks if the word is definitely a determiner.

Source

pub fn is_demonstrative_determiner(&self) -> bool

Checks if the word is definitely a determiner and more specifically is labeled as (a) demonstrative.

Source

pub fn is_non_demonstrative_determiner(&self) -> bool

Checks if the word is definitely a determiner and more specifically is labeled as not (a) demonstrative.

Source

pub fn is_possessive_determiner(&self) -> bool

Checks if the word is definitely a determiner and more specifically is labeled as (a) possessive.

Source

pub fn is_non_possessive_determiner(&self) -> bool

Checks if the word is definitely a determiner and more specifically is labeled as not (a) possessive.

Source

pub fn is_quantifier_determiner(&self) -> bool

Checks if the word is definitely a determiner and more specifically is labeled as (a) quantifier.

Source

pub fn is_non_quantifier_determiner(&self) -> bool

Checks if the word is definitely a determiner and more specifically is labeled as not (a) quantifier.

Source

pub fn is_verb(&self) -> bool

Checks if the word is definitely a verb.

Source

pub fn is_linking_verb(&self) -> bool

Checks if the word is definitely a verb and more specifically is labeled as (a) linking.

Source

pub fn is_non_linking_verb(&self) -> bool

Checks if the word is definitely a verb and more specifically is labeled as not (a) linking.

Source

pub fn is_auxiliary_verb(&self) -> bool

Checks if the word is definitely a verb and more specifically is labeled as (a) auxiliary.

Source

pub fn is_non_auxiliary_verb(&self) -> bool

Checks if the word is definitely a verb and more specifically is labeled as not (a) auxiliary.

Source

pub fn is_conjunction(&self) -> bool

Checks if the word is definitely a conjunction.

Source

pub fn is_adjective(&self) -> bool

Checks if the word is definitely a adjective.

Source

pub fn is_adverb(&self) -> bool

Checks if the word is definitely a adverb.

Source

pub fn is_first_person_plural_pronoun(&self) -> bool

Source

pub fn is_first_person_singular_pronoun(&self) -> bool

Source

pub fn is_third_person_plural_pronoun(&self) -> bool

Source

pub fn is_third_person_singular_pronoun(&self) -> bool

Source

pub fn is_third_person_pronoun(&self) -> bool

Source

pub fn is_second_person_pronoun(&self) -> bool

Source

pub fn is_verb_lemma(&self) -> bool

Source

pub fn is_verb_past_form(&self) -> bool

Source

pub fn is_verb_progressive_form(&self) -> bool

Source

pub fn is_verb_third_person_singular_present_form(&self) -> bool

Source

pub fn is_singular_noun(&self) -> bool

Source

pub fn is_non_singular_noun(&self) -> bool

Source

pub fn is_countable_noun(&self) -> bool

Source

pub fn is_non_countable_noun(&self) -> bool

Source

pub fn is_mass_noun_only(&self) -> bool

Source

pub fn is_nominal(&self) -> bool

Checks if the word is definitely nominal.

Source

pub fn is_singular_nominal(&self) -> bool

Checks if the word is definitely a nominal and more specifically is labeled as (a) singular.

Source

pub fn is_plural_nominal(&self) -> bool

Checks if the word is definitely a nominal and more specifically is labeled as (a) plural.

Source

pub fn is_possessive_nominal(&self) -> bool

Checks if the word is definitely a nominal and more specifically is labeled as (a) possessive.

Source

pub fn is_non_singular_nominal(&self) -> bool

Checks if the word is definitely a nominal and more specifically is labeled as not (a) singular.

Source

pub fn is_non_plural_nominal(&self) -> bool

Checks if the word is definitely a nominal and more specifically is labeled as not (a) plural.

Source

pub fn is_non_possessive_nominal(&self) -> bool

Checks if the word is definitely a nominal and more specifically is labeled as not (a) possessive.

Source

pub fn is_quantifier(&self) -> bool

Source

pub fn is_swear(&self) -> bool

Checks whether a word is definitely a swear.

Source

pub fn append(&mut self, other: &Self) -> &mut Self

Same thing as Self::or, except in-place rather than a clone.

Trait Implementations§

Source§

impl Clone for WordMetadata

Source§

fn clone(&self) -> WordMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WordMetadata

Source§

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

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

impl Default for WordMetadata

Source§

fn default() -> WordMetadata

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for WordMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Hash for WordMetadata

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 WordMetadata

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for WordMetadata

Source§

fn partial_cmp(&self, other: &WordMetadata) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Serialize for WordMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for WordMetadata

Source§

impl StructuralPartialEq for WordMetadata

Auto Trait Implementations§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

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