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
impl WordMetadata
Sourcepub fn or(&self, other: &Self) -> Self
pub fn or(&self, other: &Self) -> Self
Produce a copy of self
with the known properties of other
set.
Sourcepub fn enforce_pos_exclusivity(&mut self, pos: &UPOS)
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
.
pub fn is_likely_homograph(&self) -> bool
Sourcepub fn is_proper_noun(&self) -> bool
pub fn is_proper_noun(&self) -> bool
Checks if the word is definitely a noun and more specifically is labeled as (a) proper.
Sourcepub fn is_non_proper_noun(&self) -> bool
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.
Sourcepub fn is_plural_noun(&self) -> bool
pub fn is_plural_noun(&self) -> bool
Checks if the word is definitely a noun and more specifically is labeled as (a) plural.
Sourcepub fn is_non_plural_noun(&self) -> bool
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.
Sourcepub fn is_mass_noun(&self) -> bool
pub fn is_mass_noun(&self) -> bool
Checks if the word is definitely a noun and more specifically is labeled as (a) mass.
Sourcepub fn is_non_mass_noun(&self) -> bool
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.
Sourcepub fn is_possessive_noun(&self) -> bool
pub fn is_possessive_noun(&self) -> bool
Checks if the word is definitely a noun and more specifically is labeled as (a) possessive.
Sourcepub fn is_non_possessive_noun(&self) -> bool
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.
Sourcepub fn is_pronoun(&self) -> bool
pub fn is_pronoun(&self) -> bool
Checks if the word is definitely a pronoun.
Sourcepub fn is_personal_pronoun(&self) -> bool
pub fn is_personal_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) personal.
Sourcepub fn is_non_personal_pronoun(&self) -> bool
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.
Sourcepub fn is_singular_pronoun(&self) -> bool
pub fn is_singular_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) singular.
Sourcepub fn is_non_singular_pronoun(&self) -> bool
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.
Sourcepub fn is_plural_pronoun(&self) -> bool
pub fn is_plural_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) plural.
Sourcepub fn is_non_plural_pronoun(&self) -> bool
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.
Sourcepub fn is_possessive_pronoun(&self) -> bool
pub fn is_possessive_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) possessive.
Sourcepub fn is_non_possessive_pronoun(&self) -> bool
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.
Sourcepub fn is_reflexive_pronoun(&self) -> bool
pub fn is_reflexive_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) reflexive.
Sourcepub fn is_non_reflexive_pronoun(&self) -> bool
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.
Sourcepub fn is_subject_pronoun(&self) -> bool
pub fn is_subject_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) subject.
Sourcepub fn is_non_subject_pronoun(&self) -> bool
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.
Sourcepub fn is_object_pronoun(&self) -> bool
pub fn is_object_pronoun(&self) -> bool
Checks if the word is definitely a pronoun and more specifically is labeled as (a) object.
Sourcepub fn is_non_object_pronoun(&self) -> bool
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.
Sourcepub fn is_determiner(&self) -> bool
pub fn is_determiner(&self) -> bool
Checks if the word is definitely a determiner.
Sourcepub fn is_demonstrative_determiner(&self) -> bool
pub fn is_demonstrative_determiner(&self) -> bool
Checks if the word is definitely a determiner and more specifically is labeled as (a) demonstrative.
Sourcepub fn is_non_demonstrative_determiner(&self) -> bool
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.
Sourcepub fn is_possessive_determiner(&self) -> bool
pub fn is_possessive_determiner(&self) -> bool
Checks if the word is definitely a determiner and more specifically is labeled as (a) possessive.
Sourcepub fn is_non_possessive_determiner(&self) -> bool
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.
Sourcepub fn is_quantifier_determiner(&self) -> bool
pub fn is_quantifier_determiner(&self) -> bool
Checks if the word is definitely a determiner and more specifically is labeled as (a) quantifier.
Sourcepub fn is_non_quantifier_determiner(&self) -> bool
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.
Sourcepub fn is_linking_verb(&self) -> bool
pub fn is_linking_verb(&self) -> bool
Checks if the word is definitely a verb and more specifically is labeled as (a) linking.
Sourcepub fn is_non_linking_verb(&self) -> bool
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.
Sourcepub fn is_auxiliary_verb(&self) -> bool
pub fn is_auxiliary_verb(&self) -> bool
Checks if the word is definitely a verb and more specifically is labeled as (a) auxiliary.
Sourcepub fn is_non_auxiliary_verb(&self) -> bool
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.
Sourcepub fn is_conjunction(&self) -> bool
pub fn is_conjunction(&self) -> bool
Checks if the word is definitely a conjunction.
Sourcepub fn is_adjective(&self) -> bool
pub fn is_adjective(&self) -> bool
Checks if the word is definitely a adjective.
pub fn get_person(&self) -> Option<Person>
pub fn is_first_person_plural_pronoun(&self) -> bool
pub fn is_first_person_singular_pronoun(&self) -> bool
pub fn is_third_person_plural_pronoun(&self) -> bool
pub fn is_third_person_singular_pronoun(&self) -> bool
pub fn is_third_person_pronoun(&self) -> bool
pub fn is_second_person_pronoun(&self) -> bool
pub fn is_verb_lemma(&self) -> bool
pub fn is_verb_past_form(&self) -> bool
pub fn is_verb_progressive_form(&self) -> bool
pub fn is_verb_third_person_singular_present_form(&self) -> bool
pub fn is_singular_noun(&self) -> bool
pub fn is_non_singular_noun(&self) -> bool
pub fn is_countable_noun(&self) -> bool
pub fn is_non_countable_noun(&self) -> bool
pub fn is_mass_noun_only(&self) -> bool
Sourcepub fn is_nominal(&self) -> bool
pub fn is_nominal(&self) -> bool
Checks if the word is definitely nominal.
Sourcepub fn is_singular_nominal(&self) -> bool
pub fn is_singular_nominal(&self) -> bool
Checks if the word is definitely a nominal and more specifically is labeled as (a) singular.
Sourcepub fn is_plural_nominal(&self) -> bool
pub fn is_plural_nominal(&self) -> bool
Checks if the word is definitely a nominal and more specifically is labeled as (a) plural.
Sourcepub fn is_possessive_nominal(&self) -> bool
pub fn is_possessive_nominal(&self) -> bool
Checks if the word is definitely a nominal and more specifically is labeled as (a) possessive.
Sourcepub fn is_non_singular_nominal(&self) -> bool
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.
Sourcepub fn is_non_plural_nominal(&self) -> bool
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.
Sourcepub fn is_non_possessive_nominal(&self) -> bool
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.
pub fn get_degree(&self) -> Option<Degree>
pub fn is_comparative_adjective(&self) -> bool
pub fn is_superlative_adjective(&self) -> bool
pub fn is_quantifier(&self) -> bool
Trait Implementations§
Source§impl Clone for WordMetadata
impl Clone for WordMetadata
Source§fn clone(&self) -> WordMetadata
fn clone(&self) -> WordMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WordMetadata
impl Debug for WordMetadata
Source§impl Default for WordMetadata
impl Default for WordMetadata
Source§fn default() -> WordMetadata
fn default() -> WordMetadata
Source§impl<'de> Deserialize<'de> for WordMetadata
impl<'de> Deserialize<'de> for WordMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for WordMetadata
impl Hash for WordMetadata
Source§impl PartialEq for WordMetadata
impl PartialEq for WordMetadata
Source§impl PartialOrd for WordMetadata
impl PartialOrd for WordMetadata
Source§impl Serialize for WordMetadata
impl Serialize for WordMetadata
impl Eq for WordMetadata
impl StructuralPartialEq for WordMetadata
Auto Trait Implementations§
impl Freeze for WordMetadata
impl RefUnwindSafe for WordMetadata
impl Send for WordMetadata
impl Sync for WordMetadata
impl Unpin for WordMetadata
impl UnwindSafe for WordMetadata
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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