fix(grammar): handle hard-c endings in regular conjugation

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-02 09:30:20 +00:00
parent 0f62be1abd
commit 04692a185c
2 changed files with 8 additions and 0 deletions

View file

@ -380,6 +380,9 @@ func applyRegularPastTense(verb string) string {
return verb[:len(verb)-1] + "ied"
}
}
if core.HasSuffix(verb, "c") {
return verb + "ked"
}
if len(verb) >= 2 && shouldDoubleConsonant(verb) {
return verb + string(verb[len(verb)-1]) + "ed"
}
@ -437,6 +440,9 @@ func applyRegularGerund(verb string) string {
return verb[:len(verb)-1] + "ing"
}
}
if core.HasSuffix(verb, "c") {
return verb + "king"
}
if shouldDoubleConsonant(verb) {
return verb + string(verb[len(verb)-1]) + "ing"
}

View file

@ -104,6 +104,7 @@ func TestPastTense(t *testing.T) {
{"push", "pushed"},
{"pull", "pulled"},
{"start", "started"},
{"panic", "panicked"},
{"copy", "copied"},
{"apply", "applied"},
@ -170,6 +171,7 @@ func TestGerund(t *testing.T) {
{"push", "pushing"},
{"pull", "pulling"},
{"start", "starting"},
{"panic", "panicking"},
{"die", "dying"},
// Edge cases