pub struct DictWordMetadata {Show 15 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 orth_info: OrthFlags,
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>,
}Expand description
This represents a “lexeme” or “headword” which is case-folded but affix-expanded. So not only lemmata but also inflected forms are stored here, with “horn” and “horns” each having their own lexeme, but “Ivy” and “ivy” sharing the same lexeme.
Fields§
§noun: Option<NounData>§pronoun: Option<PronounData>§verb: Option<VerbData>§adjective: Option<AdjectiveData>§adverb: Option<AdverbData>§conjunction: Option<ConjunctionData>§swear: Option<bool>§dialects: DialectFlagsThe dialects this word belongs to. If no dialects are defined, it can be assumed that the word is valid in all dialects of English.
orth_info: OrthFlagsOrthographic information: letter case, spaces, hyphens, etc.
determiner: Option<DeterminerData>Whether the word is a determiner.
preposition: boolWhether the word is a preposition.
common: boolWhether 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 DictWordMetadata
impl DictWordMetadata
Sourcepub fn infer_pos_tag(&self) -> Option<UPOS>
pub fn infer_pos_tag(&self) -> Option<UPOS>
If there is only one possible interpretation of the metadata, infer its UPOS tag.
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.
Sourcepub fn is_manner_adverb(&self) -> bool
pub fn is_manner_adverb(&self) -> bool
Checks if the word is definitely a adverb and more specifically is labeled as (a) manner.
Sourcepub fn is_non_manner_adverb(&self) -> bool
pub fn is_non_manner_adverb(&self) -> bool
Checks if the word is definitely a adverb and more specifically is labeled as not (a) manner.
Sourcepub fn is_frequency_adverb(&self) -> bool
pub fn is_frequency_adverb(&self) -> bool
Checks if the word is definitely a adverb and more specifically is labeled as (a) frequency.
Sourcepub fn is_non_frequency_adverb(&self) -> bool
pub fn is_non_frequency_adverb(&self) -> bool
Checks if the word is definitely a adverb and more specifically is labeled as not (a) frequency.
Sourcepub fn is_degree_adverb(&self) -> bool
pub fn is_degree_adverb(&self) -> bool
Checks if the word is definitely a adverb and more specifically is labeled as (a) degree.
Sourcepub fn is_non_degree_adverb(&self) -> bool
pub fn is_non_degree_adverb(&self) -> bool
Checks if the word is definitely a adverb and more specifically is labeled as not (a) degree.
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_simple_past_form(&self) -> bool
pub fn is_verb_past_participle_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_positive_adjective(&self) -> bool
pub fn is_quantifier(&self) -> bool
Sourcepub fn is_lowercase(&self) -> bool
pub fn is_lowercase(&self) -> bool
Does the metadata for this word cover an all-lowercase variant? (e.g., “hello”)
This returns true if all letters in the word are lowercase. Words containing non-letter characters (like numbers or symbols) are only considered if all letter characters are lowercase.
Sourcepub fn is_titlecase(&self) -> bool
pub fn is_titlecase(&self) -> bool
Does the metadata for this word cover a titlecase variant? (e.g., “Hello”)
This returns true if the word is in titlecase form, which means:
- The first letter is uppercase
- All other letters are lowercase
- The word is at least 2 characters long
Examples: “Hello”, “World”
Note: Words with internal capital letters (like “McDonald”) or apostrophes (like “O’Reilly”) are not considered titlecase - they are classified as UPPER_CAMEL instead.
Sourcepub fn is_allcaps(&self) -> bool
pub fn is_allcaps(&self) -> bool
Does the metadata for this word cover an all-uppercase variant? (e.g., “HELLO”)
This returns true if all letters in the word are uppercase. Words containing non-letter characters (like numbers or symbols) are only considered if all letter characters are uppercase.
Examples: “HELLO”, “NASA”, “I”
Sourcepub fn is_lower_camel(&self) -> bool
pub fn is_lower_camel(&self) -> bool
Does the metadata for this word cover a lower camel case variant? (e.g., “helloWorld”)
This returns true if the word is in lower camel case, which means:
- The first letter is lowercase
- There is at least one uppercase letter after the first character
- The word must be at least 2 characters long
Examples: “helloWorld”, “getHTTPResponse”, “eBay”
Note: Single words that are all lowercase will return false. Words starting with an uppercase letter will return false (those would be UpperCamel).
Sourcepub fn is_upper_camel(&self) -> bool
pub fn is_upper_camel(&self) -> bool
Does the metadata for this word cover an upper camel case / pascal case variant? (e.g., “HelloWorld”)
This returns true if the word is in upper camel case (also known as Pascal case), which means:
- The first letter is uppercase
- There is at least one other uppercase letter after the first character
- There is at least one lowercase letter after the first uppercase letter
- The word must be at least 3 characters long
Examples:
- “HelloWorld” (standard Pascal case)
- “McDonald” (name with internal caps)
- “O’Reilly” (name with apostrophe and internal caps)
- “HttpRequest” (initialism followed by word)
Note: Single words that are titlecase (like “Hello”) will return false. Words that are all uppercase (like “NASA”) will also return false.
Sourcepub fn is_apostrophized(&self) -> bool
pub fn is_apostrophized(&self) -> bool
Does the metadata for this word cover an apostrophized variant? (e.g., “doesn’t”)
pub fn is_roman_numerals(&self) -> bool
Trait Implementations§
Source§impl Clone for DictWordMetadata
impl Clone for DictWordMetadata
Source§fn clone(&self) -> DictWordMetadata
fn clone(&self) -> DictWordMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DictWordMetadata
impl Debug for DictWordMetadata
Source§impl Default for DictWordMetadata
impl Default for DictWordMetadata
Source§fn default() -> DictWordMetadata
fn default() -> DictWordMetadata
Source§impl<'de> Deserialize<'de> for DictWordMetadata
impl<'de> Deserialize<'de> for DictWordMetadata
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 DictWordMetadata
impl Hash for DictWordMetadata
Source§impl PartialEq for DictWordMetadata
impl PartialEq for DictWordMetadata
Source§impl PartialOrd for DictWordMetadata
impl PartialOrd for DictWordMetadata
Source§impl Serialize for DictWordMetadata
impl Serialize for DictWordMetadata
impl Eq for DictWordMetadata
impl StructuralPartialEq for DictWordMetadata
Auto Trait Implementations§
impl Freeze for DictWordMetadata
impl RefUnwindSafe for DictWordMetadata
impl Send for DictWordMetadata
impl Sync for DictWordMetadata
impl Unpin for DictWordMetadata
impl UnwindSafe for DictWordMetadata
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<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