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§
- Adjective
Metadata - Static adjective metadata from the lexicon database.
- Canonical
Mapping - Maps a word to its canonical form with polarity.
- Lexicon
- Lexicon struct for verb lookup with inflection handling
- Morph
Rule - Morphological derivation rule from lexicon.
- Morphological
Rule - Morphological rule for derivational morphology.
- Noun
Metadata - Static noun metadata from the lexicon database.
- Static
Lexicon - Static lexicon implementation using compile-time generated data
- Verb
Entry - Verb entry returned from irregular verb lookup.
- Verb
Metadata - 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.
- Verb
Class - Vendler’s Lexical Aspect Classes (Aktionsart)
- Word
Analysis - Result of smart word analysis for derivational morphology
Traits§
- Lexicon
Trait - 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