Module lexicon

Module lexicon 

Source
Expand description

Lexicon: Vocabulary lookup functions

This module includes the compile-time generated lexicon lookup code from build.rs. It provides ~56 lookup functions for classifying words.

Structs§

AdjectiveMetadata
Static adjective metadata from the lexicon database.
CanonicalMapping
Maps a word to its canonical form with polarity.
Lexicon
Lexicon struct for verb lookup with inflection handling
MorphRule
Morphological derivation rule from lexicon.
MorphologicalRule
Morphological rule for derivational morphology.
NounMetadata
Static noun metadata from the lexicon database.
StaticLexicon
Static lexicon implementation using compile-time generated data
VerbEntry
Verb entry returned from irregular verb lookup.
VerbMetadata
Static verb metadata from the lexicon database.

Enums§

Aspect
Grammatical aspect (viewpoint aspect).
Case
Grammatical case (for pronouns).
Definiteness
Article definiteness for noun phrases.
Feature
Lexical features that encode grammatical and semantic properties of words.
Gender
Grammatical gender (for pronouns and agreement).
Number
Grammatical number for nouns and agreement.
Polarity
Polarity for canonical mapping (positive = synonym, negative = antonym).
Sort
Semantic sorts for type checking.
Time
Temporal reference for verb tense.
VerbClass
Vendler’s Lexical Aspect Classes (Aktionsart)
WordAnalysis
Result of smart word analysis for derivational morphology

Traits§

LexiconTrait
Lexicon trait for abstracting over static and dynamic lexicons

Functions§

analyze_word
Smart word analysis with derivational morphology support.
get_canonical_noun
Get the canonical lemma for a noun.
get_canonical_verb
Get canonical verb form and whether it’s lexically negative. Used at parse time to transform “lacks” → (“Have”, true). Returns (canonical_lemma, is_negative).
get_morphological_rules
Get morphological derivation rules from lexicon.
is_adjective
is_adverb
is_agentive_noun
Check if a noun is agentive (derived from a verb with Agent relation).
is_base_verb
is_base_verb_early
is_collective_verb
is_common_noun
is_derivable_noun
Check if a word is a known common noun or derivable from one. This is used for sentence-initial capitalization disambiguation.
is_disambiguation_not_verb
is_distributive_verb
is_ditransitive_verb
is_event_modifier_adjective
is_female_name
is_female_noun
is_gradable_adjective
is_infinitive_verb
is_intensional_predicate
is_irregular_plural
is_male_name
is_male_noun
is_mixed_verb
is_neuter_noun
is_non_intersective
is_not_adverb
is_noun_pattern
is_object_control_verb
is_opaque_verb
is_particle
is_performative
is_preposition
is_proper_name
Check if a word is a proper name (has Feature::Proper in the lexicon). Used to distinguish “Socrates fears death” from “Birds fly” (bare plurals). Names like “Socrates”, “James”, “Chris” end in ‘s’ but aren’t plural nouns.
is_raising_verb
is_scopal_adverb
is_stemming_exception
is_subject_control_verb
is_subsective
is_temporal_adverb
lookup_adjective_db
lookup_agentive_noun
Lookup the base verb for an agentive noun (e.g., dancer -> Dance). This is for backward compatibility with existing code.
lookup_article
lookup_auxiliary
lookup_canonical
Look up canonical form for a word (synonym/antonym normalization). Returns the canonical lemma and polarity (Negative for antonyms).
lookup_irregular_verb
lookup_keyword
lookup_noun_db
lookup_noun_derivation
Lookup the derivation info for a noun (e.g., dancer -> (Dance, Verb, Agent)) Returns (root, pos, relation) if the noun has a derivation.
lookup_phrasal_verb
lookup_presup_trigger
lookup_pronoun
lookup_sort
lookup_unit_dimension
lookup_verb_class
lookup_verb_db
needs_e_ed
needs_e_ing
singularize
word_to_number