polish: complete the RGL enough to build an application grammar

Adding Polish to informath (grammars/next) exposed a set of gaps. Unlike
Czech, StructuralPol was already complete; what was missing was a handful
of lins, a way to govern the nominative, and some outright mistakes.

Missing lins, all reached as qualified Grammar.X by the application's
functors and so not shimmable from the application side:

  AdjectivePol  AdvAP
  SentencePol   SSubjS
  IdiomPol      ImpP3
  StructuralPol that_Subj
  MarkupPol     new module (Markup is not part of the RGL build script,
                so it is compiled on demand, as MarkupCze is)
  ParadigmsPol  mkAdv (every other ParadigmsX has it; the application
                interfaces reach it as Paradigms.mkAdv)

ImpP3 has no third-person imperative to use, so it takes the standard
"niech" periphrasis. The copula takes the future ("niech x będzie grupą")
and every other verb the present ("niech x należy do A"): być is the only
Polish verb with a synthetic future, and imienne marks exactly the copular
VPs.

NomPrep: ComplCase had no nominative at all, so "jako", "niż" and
"zdefiniowany jako" -- all of which govern the nominative -- came out
locative ("mniejszy niż liczbie"). mkCompl now maps Nom to a new NomPrep,
and the dep tables of the pronouns, nounPN, mkPN and the structural NPs
cover it. LexiconNounPol is marked DO NOT EDIT, but paris_PN and john_PN
inline their own dep tables and so had to be extended too.

Two corrections:

  VerbPol.CompCN used the nominative for a predicative noun, giving
  "x jest grupa"; Polish uses the instrumental, as CompNP right below it
  already does.

  ExtendPol.ExistsNP inherited ExistNP from ExtendFunctor, giving
  "jest macierz". Polish distinguishes the two: "there exists" is istnieć,
  which is what mathematical prose uses.

ParadigmsPol.guess_paradigm_basic never matched -ość, the productive
feminine abstract suffix, so sprzeczność took a masculine declension
(*sprzeczności/a, *sprzecznościowi) despite being tagged feminine. It now
routes to the kość paradigm.

Also documents, without changing, why the 2-string mkN throws its genitive
away: guess_paradigm's 2-string table is unsound (its first branch matches
every noun in -a, and its branches disagree about whether mkNTable* takes
the nominative or the bare stem), so passing sggen to it turns
"liczba"/"liczby" into *liczbaa. The 1-string guesser is the sound path
until that table is repaired.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
aarneranta
2026-07-16 19:22:24 +02:00
co-authored by Claude Opus 4.8
parent 11f73acc28
commit 8c4cd58bd1
13 changed files with 108 additions and 12 deletions
+15
View File
@@ -26,10 +26,14 @@
mkA2 : A -> Str -> ComplCase -> A2 ;
mkAdv : Str -> Adv ; -- an adverb from a string
--.
-- Definitions hidden from the public API
mkAdv s = lin Adv {s = s} ;
ComplCase = ResPol.ComplCase ;
genPrep = GenPrep ;
genNoPrep = GenNoPrep ;
@@ -41,6 +45,7 @@
{ nom = (tab form)!SF Sg Nom;
voc = (tab form)!SF Sg VocP;
dep = let forms = (tab form) in table {
NomPrep =>forms!SF Sg Nom;
GenPrep|GenNoPrep=>forms!SF Sg Gen;
AccPrep|AccNoPrep=>forms!SF Sg Acc;
DatPrep|DatNoPrep=>forms!SF Sg Dat;
@@ -101,6 +106,13 @@
let ntable : SubstForm => Str = guess_paradigm_basic sgnom
in NM.mkN ntable gender ;
-- 2 string
-- NB: sggen is deliberately NOT passed to guess_paradigm. The 2-string
-- guess_paradigm table is unsound: its first branch <_ + "a", _ + "">
-- matches every noun in -a (the suffix "" matches anything), and its
-- branches disagree about whether mkNTable* takes the nominative
-- (mkNTable0021 does Predef.tk 1) or the bare stem (mkNTable0308 does
-- not). Routing sggen there turns "liczba"/"liczby" into "liczbaa".
-- Until that table is repaired, the 1-string guesser is the sound path.
mkNGender : Str -> Str -> Gender -> N = \sgnom,sggen,gender ->
let ntable : SubstForm => Str = guess_paradigm sgnom
in NM.mkN ntable gender ;
@@ -373,6 +385,9 @@
_ + "ń" => NM.mkNTable0142 sgnom ; -- Alternatives: mkNTable0268,mkNTable0290,mkNTable0297,mkNTable0468,mkNTable0592,mkNTable0612,mkNTable0674,mkNTable0676,mkNTable0775,mkNTable0815,mkNTable0935,mkNTable1004
_ + "ł" => NM.mkNTable0151 sgnom ; -- Alternatives: mkNTable0192,mkNTable0280,mkNTable0533,mkNTable0601
_ + "ę" => NM.mkNTable0379 sgnom ; -- Alternatives: mkNTable0604
-- -ość is the productive feminine abstract-noun suffix (sprzeczność,
-- własność, równość); it always takes the kość declension.
_ + "ość" => NM.mkNTable0475 sgnom ;
_ + "ć" => NM.mkNTable0069 sgnom ; -- Alternatives: mkNTable0475,mkNTable0567,mkNTable0573,mkNTable0649,mkNTable0734,mkNTable0792,mkNTable0793,mkNTable0794,mkNTable0814,mkNTable0838,mkNTable0922,mkNTable0923,mkNTable1014
_ + "ź" => NM.mkNTable0316 sgnom ; -- Alternatives: mkNTable0633,mkNTable0661,mkNTable0722,mkNTable0732,mkNTable0771
_ + "y" => NM.mkNTable0012 sgnom ; -- Alternatives: mkNTable0050,mkNTable0058,mkNTable0123,mkNTable0203,mkNTable0635,mkNTable0665,mkNTable0777,mkNTable0886,mkNTable1020