Skip to content

Fix homograph lemma-disambiguation bugs found via nom.latin.bas diffing, add regression harness - #8

Open
whothefluff wants to merge 2 commits into
Alatius:masterfrom
whothefluff:fix-latin-lemmas-nom_lat_bas_regressions
Open

Fix homograph lemma-disambiguation bugs found via nom.latin.bas diffing, add regression harness#8
whothefluff wants to merge 2 commits into
Alatius:masterfrom
whothefluff:fix-latin-lemmas-nom_lat_bas_regressions

Conversation

@whothefluff

Copy link
Copy Markdown

This PR lands in two commits:

  1. Adds a lemma-assertion test harness to run_tests.sh (run_assert_test), independent of any content changes.
  2. The actual stemsrc fixes this harness exists to lock in, plus tests/latin_assertions_nom_lat_bas.txt.

Background: comparing nom.latin.bas across a few forks surfaced a recurring bug class -- lemmas compiled without the #N sense number our L&S-matching code needs, so two distinct dictionary entries sharing a spelling (canis/Canis, dis/Dis, ...) collapse into one ambiguous lemma once case is folded. Full list of what's fixed is in the second commit message; the assertion file is the living, checkable record of it.

This is the first of an ongoing series. Expect (some day) similar PRs as more of these turn up while auditing ls.nom and the other stemsrc files. See tests/README_ASSERTIONS.md (added here) for how the assertion files are organized and why they're named by investigation, not by source-file coverage.

Add run_assert_test(), which checks that a surface form resolves
(via -Ll) to an exact set of expected lemmas.

Assertions live in tests/latin_assertions*.txt: form, tab, one or
more expected lemmas, with optional "(...)" commentary stripped
before comparison. Multiple lines for the same form are unioned
into one expected set. The harness globs for any matching file,
so adding a new assertion file needs no code change here.

This is orthogonal to the existing baseline-diff tests: it checks
lemma disambiguation (which L&S sense a form resolves to), not
full morphological output, and has no --update mode (expected
values are hand-written against the L&S dictionary, not captured from
a prior run).
Several homograph lemmas compiled without the #N that downstream
code needs to match against a specific L&S entry, so distinct
senses collapsed into one ambiguous lemma after case-folding
(canis "dog" vs Canis "river", dis "rich" vs Dis "Pluto", etc.).
Adds #N to: an, assiduus, canis/Canis, casus/Casus, celer/Celer,
celsus/Celsus, dido/Dido, dis/Dis, fides, Hortensius, in, laus/Laus,
lupus/Lupus, magnus/Magnus, niger/Niger, pax/Pax, polus/Polus,
princeps/Princeps, quies, quinque, rex/Rex, secus, sed, tigris/Tigris.

Also:
- adds coeo and dido (verbs), previously entirely absent, so their
  participle/noun derivatives resolve to a verb origin
- fixes wrong declension codes: pecus#1 (or_oris -> us_oris),
  Niger#2/Alatius#3 (was 3rd-decl er_ris on both; Alatius#2 is 2nd-decl er_ri),
  quies (custom es_eLtis/eLs_etis -> long vowel in the stem + s_tis)
- fixes dis#1's hidden default-comparative collision (s_tis_adj
  needs no_comp since ior_ius_comp already supplies ditior)
- adds vowel-length marks surfaced along the way: canis#1, niger#1,
  dis#3, super#1, secus#2's comparative stem

Adds tests/latin_assertions_nom_lat_bas.txt asserting the above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant