Fix homograph lemma-disambiguation bugs found via ls.nom diffing, add regression harness - #11
Open
whothefluff wants to merge 2 commits into
Open
Conversation
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).
This reverts commit e5f83b5. It also introduces some fixes after manually checking every entry restored in the commit against a physical copy of the L&S. Generally, if the dictionary has an entry for a lemma, we direct to it (except for participles, because they create duplicates). Comparatives with entries are also ignored, even if they have entry in the L&S, if the test file found a match against the positive form. For derived adverbs that have a meaning that has diverged from the adjective, we maintain both alternatives. Proper nouns accept plural unless explicitely listed as singular only in the L&S. Entries in nom.smithgeo that caused collisions in the test file and don't exist in the L&S are commented out.
whothefluff
force-pushed
the
fix-latin-lemmas-ls_nom_regressions
branch
from
August 10, 2026 18:18
24f3368 to
8b2710e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR lands in two commits:
Adds a lemma-assertion test harness to run_tests.sh (run_assert_test), independent of any content changes.
The actual stemsrc fixes this harness exists to lock in, plus tests/latin_assertions_ls_nom.txt.
Background: comparing ls.nom 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 second of an ongoing series. Expect (some day) similar PRs as more of these turn up while auditing vbs.cmp 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. The test file has some overlap with the first PR of the series because I found more problems. (Sorry-not-sorry for the huge commit, someone edited the file for the worse some years ago).
There are thousands of more broken entries that some year I might fix (doubtful), that can be easily found by running this command, in case a curious reader is feeling adventurous: