Fix seven parse coverage gaps; add error rule for non-agreeing postposed adjectives - #68
Merged
Merged
Conversation
- Phrases.conf: the "vera* bent á" ambiguous phrase forced 'á' to be
an adverb, making the impersonal passive "er bent á" + Nl unparseable;
now fs/ao ("Í skýrslunni er bent á kostina")
- bintokenizer: non-inflecting (foreign) person names, with identical
forms in nf/þf/þgf, now also get an ef interpretation, so they work
as genitive qualifiers ("Samtök Paul Watson"); inflecting Icelandic
names are unaffected
- Grammar: allow a SamanburðurNl ("sem" + Nl_nf role complement)
inside subject-gap relative clauses ("...sem starfar sem
sérfræðingur hjá Eflingu")
- Grammar: allow an oblique subject with a perfect infinitive in the
complement of segja/telja/álíta ("segir Spáni hafa mistekist að...",
"segir mig hafa dreymt vel")
- Grammar: support the postposed order genitive-Nl + "vegna"
("sýningarinnar vegna", "mín vegna") as a prepositional phrase;
previously only misparsed as an adjective
- Grammar: allow a personal pronoun followed by an agreeing adjective
phrase as a noun phrase ("með hann fremstan í fararbroddi")
Each fix has a regression test in test_parse.py, mostly with exact
flat-tree assertions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New VillaLoEftirNlMeðAndlagi rule in the $if(include_errors) section, used by GreynirCorrect: matches a postposed adjective (typically a past participle) with a case-governed complement that does not agree with its head noun phrase in case, e.g. 'móðurfélag fleiri félaga tengdum rekstri Morgunblaðsins' where 'tengdum' should be 'tengdra'. The corresponding annotation handler is in GreynirCorrect PR #69 (already merged; the handler is inert until this rule ships). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
An uninflected neuter nominative numeral used as a designation
('lögreglustöð tvö', 'stofa fimm', 'hlið átta') had no grammar
production; digit forms only parsed via a spurious genitive reading.
Added a NúmerTala alternative to the Númer slot in NlKjarni, with a
score penalty so that agreeing numerals ('mennina þrjá') are still
preferred wherever agreement is possible.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Seven parse coverage fixes, each motivated by a real-world sentence that failed to parse, plus one new error-grammar rule for GreynirCorrect.
Parse fixes (each with a regression test)
[ambiguous_phrases]rule"vera* bent á" so so aostripped the preposition meaning of "á", so "Í skýrslunni er bent á kostina" could not parse. Nowso so fs/ao, matching sibling rules like"tala* við" so fs/ao.SamanburðurNl?added toEinSetningÁnF, enabling "...sem starfar sem sérfræðingur hjá Eflingu".SagnarBotnalternatives mirroring the finiteSetningAukafallpatterns, enabling "segir Spáni hafa mistekist að..." (mm route) and "segir mig hafa dreymt vel" (subj route).FsVegnaEftirNl → Nl_ef 'vegna:fs'_efinFsMeðFallstjórn, enabling "sýningarinnar vegna", "mín vegna". Previously such phrases only "parsed" via a bogus adjective reading of "vegna".Pfn LoEftirNlalternative inNlStak_p3, enabling "með hann fremstan í fararbroddi".NúmerTalaalternative inNúmer, enabling an uninflected neuter nominative numeral as a designation after a noun: "í umdæmi lögreglustöðvar tvö", "stofa fimm". Score-penalized so agreeing numerals ("mennina þrjá") are still preferred wherever agreement is possible.Error grammar rule (separate commit)
VillaLoEftirNlMeðAndlagiin the$if(include_errors)section: flags a postposed adjective with a case-governed complement that does not agree with its head NP in case ("móðurfélag fleiri félaga tengdum rekstri" → "tengdra"). The annotation handler and a guarded test are already merged in GreynirCorrect (mideind/GreynirCorrect#69); the handler is inert until this rule ships in a reynir release.Test plan
ruff check src/reynirandmypy src/reynirboth clean.test_adjective_agreement.Known issue (not addressed here)
A separate reducer-level attachment issue was diagnosed with the same source sentence as fix 7: in "...í umdæmi lögreglustöðvar tvö, sem sér um Hafnarfjörð og Garðabæ", the um-PP attaches to the main clause instead of inside the relative clause when the main verb is e.g. "eiga"/"lesa" (correct for "gerast"/"verða"/"búa"/"gefa"). The correct derivation exists in the forest and receives the verb-preposition bonus; a structural score difference > 40 points overrides it. Needs reducer score tracing; to be investigated separately.
🤖 Generated with Claude Code