present_3s

Function present_3s 

Source
pub fn present_3s(verb: &VerbEntry) -> String
Expand description

Computes the third-person singular present tense form of a verb.

Returns the irregular form if one is defined in the verb’s forms map under the "present3s" key. Otherwise, applies English conjugation rules:

  • Sibilants and -o (-s, -x, -ch, -sh, -o) → append -es (“go” → “goes”)
  • Consonant + y → replace y with -ies (“fly” → “flies”)
  • Vowel + y (-ay, -ey, -oy, -uy) → append -s (“play” → “plays”)
  • Default → append -s (“run” → “runs”)

§Arguments

  • verb - The verb entry containing the lemma and optional irregular forms.

§Examples

use logicaffeine_lexicon::runtime::{VerbEntry, present_3s};
use std::collections::HashMap;

let run = VerbEntry {
    lemma: "run".to_string(),
    class: "Activity".to_string(),
    forms: HashMap::new(),
    features: vec![],
};
assert_eq!(present_3s(&run), "runs");

let go = VerbEntry {
    lemma: "go".to_string(),
    class: "Activity".to_string(),
    forms: [("present3s".to_string(), "goes".to_string())].into(),
    features: vec![],
};
assert_eq!(present_3s(&go), "goes");