Repository navigation
Fix Polish agreement for men's plural nouns - #502
Merged
Merged
Conversation
The agreement check read a soft-stem adjective ("nastoletni", "ostatni")
only as the masculine singular. This form is also the men's plural, so
the check flagged correct phrases such as "nastoletni synowie" and
"ostatni goście".
For a men's plural noun, the check also gave the "-e" form as the fix
("nowe synowie"). It now gives the men's form ("nowi synowie").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The agreement check accepted "nastoletnie synowie", because the "-e"
plural agrees with any plural noun. It now flags "-e" before a men's
nominative plural and gives the men's form ("nastoletni synowie").
The lexicon merges the tags of nouns with the same spelling, so the
men's tag of "praktyk", "powód" or "metr" also marks "praktyki",
"powody" and "metry". The new menOnlyPlural helper is true only when
every noun that reads the word as a nominative plural names men and the
word has a men's-plural shape. On the Polish n-gram bigrams it flags
none of the frequent correct pairs ("najlepsze praktyki",
"ważne powody").
The subject-verb check now uses the same helper. Before, it changed
"Kolejne metry były trudne" to "byli".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dictionary flag "s" adds "-y" to a stem ("dom" -> "domy"), and the
lexicon generator read every such form as a nominative plural. After a
"-rz" stem the "-y" form is the genitive plural ("żołnierzy",
"harcerzy", "talerzy"); the nominative is "-rze".
Thus the agreement check flagged "Widziałem polskich żołnierzy." and
offered "polskie żołnierzy".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"lutego" and "lutym" are forms of the month (February) and of the adjective "luty" (fierce). The agreement check read them as the adjective, so "15 lutego uczniowie wrócili" got the fix "lute uczniowie". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The agreement check skipped every adjective form that another word also
spells ("nowe", "dobre"), so "nowe studenci" and "dobre lekarze" were
not flagged. It now checks these forms in one case only: "-e" before a
noun that menOnlyPlural reads as a men's plural. It also flags
"różne ludzie": with no preposition, the locative reading of "ludzie"
("o ludzie") cannot be.
The predicate-adjective check used the merged men's tag of its subject:
- "Praktyki były trudni" was skipped, because "praktyki" looked like
men's. It now gives "trudne".
- "Powody byli ważne" gave "ważni", but the verb is the error. A
masculine subject now counts as men's only with a men's-plural shape.
The real detector, run on 3,335 frequent bigrams that end in a men's
plural, gives no new findings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Zadania były trudne uczniowie narzekali" has a missing comma: the adjective ends the clause of "były" and "uczniowie" opens the next. The agreement check read "trudne uczniowie" as one phrase and offered "trudni uczniowie". A pair after a copula (or "się", optionally with a degree word) is now skipped when a verb follows the noun. "To są nowe studenci" has no verb after the noun and is still flagged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Widzę czyste talerzy" was not flagged: the agreement check skips a noun
with a genitive reading, because some adjectives govern the genitive
("pełne wody"). A new check reads "verb + adjective + noun" when the
noun has only genitive readings. The verb lists that already exist
tell which word to change:
- an accusative verb (NEGATED_VERBS): the noun, "czyste talerze";
for a man's noun the adjective, "brudnych żołnierzy";
- a partitive verb ("kupić", "jeść", "pić", "brać", "chcieć"): both;
- a genitive verb (GENITIVE_VERBS) or a negated one: the adjective,
"czystych talerzy".
Adjectives that govern the genitive (pełny, pozbawiony, warty, …) and
ambiguous adjective forms ("nowe", "dane") are not checked. On 16,771
n-gram sequences of real text the check gives no findings.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"dla podopiecznych trenera" ("for the coach's wards") was flagged with
the fix "podopiecznego trenera". After a preposition, an adjective used
as a noun and its genitive attribute look like a pair that does not
agree. The dictionary does not mark these adjectives as nouns, so a
list now names the common ones: people ("podopieczny", "znajomy",
"bliski", "oskarżony", "przełożony") and terms ("dany", "średni",
"pochodny"). With such an adjective, a noun with a genitive reading
after it is no clash.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dictionary lists "rano" only as a noun and declines the loans "wideo", "show" and "kakao" like native nouns. Thus the lexicon read "wideo" only as a nominative or accusative, and the agreement check flagged correct text: - "o szóstej rano" (no fix); - "na poniższym wideo" -> "poniższe wideo"; - "w polskim show" (no fix). "rano" is now also a non-noun, and the three loans read in every case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Wszystko zostało przedstawione krok po kroku" was flagged with the fix "przedstawiony krok". "krok po kroku", "dzień po dniu" and "słowo po słowie" are adverbial phrases, so the noun is not the adjective's. A pair is now skipped when "po" and a form of the same noun follow it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Uciekli z ogarniętej wojną Ukrainy" was flagged with the fix "ogarniętą wojną". After "z", the participle "ogarniętej" is genitive and "wojną" is the instrumental of its agent, not its noun. A passive participle before an instrumental-only noun is now no clash. Co-Authored-By: Claude Opus 5.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.
What changed
polishCaseAgreement, adjective + noun (adjectiveClashinagreement.ts)virileAdjective.polishCaseAgreement, subject + verb and predicate (subjects.ts)pluralSubjects: a noun is a men's subject only whenmenOnlyPluralis true. Before, "Kolejne metry były trudne" got "byli".predicateAdjectives: "Praktyki były trudni" is now flagged ("trudne"). "Powody byli ważne" no longer gets "ważni", because the verb is the error there.New
menOnlyPlural(word)inlexicon.tsmenOnlyPluralis true only when every noun that reads the word as a nominative plural names men, and the word has a men's-plural shape (-owie,-cy,-rzy,-dzy,-e, or-inot after k/g).Run-on predicate (
runOninagreement.ts)New check: adjective before a genitive-only object (
genitiveObjectAdjectives)NEGATED_VERBS): the noun, "Widzę czyste talerzy" → "czyste talerze"; for a man's noun the adjective, "brudne żołnierzy" → "brudnych żołnierzy";GENITIVE_VERBS) or a negated verb: the adjective, "Szukam czyste talerzy" → "czystych talerzy".Older bugs found on the way (separate commits)
masterflagged "Widziałem polskich żołnierzy." and offered "polskie żołnierzy".False alarms found by a scan of real text (separate commits)
NOMINAL_ADJECTIVES) names the common ones: podopieczny, znajomy, bliski, oskarżony, przełożony, dany, średni, pochodny, …Before and after
masterHow I checked the false-alarm risk
On the bigrams of the shipped Polish n-gram data (HPLT), the "-e adjective + men's noun" pairs that each test flags:
menOnlyPlural(all readings + shape)I ran the real detector on all 3,335 frequent bigrams that end in a men's plural, on
master, the PR before this round, and this PR. The ambiguous-adjective, locative and predicate changes add no findings. The lexicon and "lutego" fixes take the count from 34 to 9. The 9 that remain come from the test frame, or they are real errors ("kolejny uczniowie").I ran the real detector on the 16,771 n-gram sequences (3 and 4 words) that have an adjective before a genitive noun. The new check gives no findings. The 2 findings there are older and also on
master.I ran the real detector on all 37,784 n-gram sequences that have an adjective before a noun. Before the scan fixes, it gave 60 agreement findings. After them, the remaining findings are n-gram artifacts (lowercased names such as "europie", cut-off phrases such as "krok."), real typos ("z cała pewnością", "za wszelka cenę") or colloquial "tą" for "tę".
Notes for the reviewer
tests/grammar/ReviewPolishAgreement.test.ts.bun run check,bun run test,bun run test:e2eandcheck:e2e:coveragepass.🤖 Generated with Claude Code