analyze_word

Function analyze_word 

Source
pub fn analyze_word(word: &str) -> Option<WordAnalysis>
Expand description

Smart word analysis with derivational morphology support.

Three-step resolution:

  1. Exact Match - Check if word exists in lexicon (handles irregulars like “mice”)
  2. Plural Derivation - Strip ‘s’/‘es’ and check if stem exists (farmers → farmer)
  3. Morphological Rules - Apply suffix rules for unknown agentive nouns