From 91237f753c80ff433d3b99978e1712c81b392510 Mon Sep 17 00:00:00 2001 From: Inari Listenmaa Date: Mon, 14 Aug 2023 15:43:27 +0300 Subject: [PATCH 1/8] (May) don't use API due to problem with path --- src/malay/ConstructionMay.gf | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/malay/ConstructionMay.gf b/src/malay/ConstructionMay.gf index 0da606684..eda790f8f 100644 --- a/src/malay/ConstructionMay.gf +++ b/src/malay/ConstructionMay.gf @@ -1,4 +1,4 @@ -concrete ConstructionMay of Construction = CatMay ** open ParadigmsMay, (L=LexiconMay), SyntaxMay in { +concrete ConstructionMay of Construction = CatMay ** open ParadigmsMay, (L=LexiconMay), (G=GrammarMay) in { lincat Timeunit = N ; @@ -9,18 +9,13 @@ lincat lin - has_age_VP card = mkVP umur_V2 (mkNP L.year_N) ; + has_age_VP card = G.ComplSlash (G.SlashV2a umur_V2) (G.DetCN (G.DetQuant G.IndefArt (G.NumCard card)) (G.UseN L.year_N)) ; oper umur_V2 : V2 = mkV2 (mkV "umur") noPrep ; {- - timeunitAdv n time = - let n_card : Card = n ; - n_hours_NP : NP = mkNP n_card time ; - in SyntaxMay.mkAdv for_Prep n_hours_NP | mkAdv (n_hours_NP.s ! R.npNom) ; - weekdayPunctualAdv w = ; -- on Sunday weekdayHabitualAdv w = ; -- on Sundays weekdayNextAdv w = -- next Sunday From 9c5b87e1c82821e41f720f21980c3e7356760a40 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Tue, 15 Aug 2023 11:29:25 +0300 Subject: [PATCH 2/8] Lav: comma in please_Voc like in VocNP --- src/latvian/StructuralLav.gf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/latvian/StructuralLav.gf b/src/latvian/StructuralLav.gf index 61f96dfd3..577ff1eff 100644 --- a/src/latvian/StructuralLav.gf +++ b/src/latvian/StructuralLav.gf @@ -266,7 +266,7 @@ lin can8know_VV = mkVV (mkV "varēt" third_conjugation) ; must_VV = mkVV (mkV "vajadzēt" third_conjugation Dat) ; - please_Voc = ss "lūdzu" ; + please_Voc = ss ", lūdzu" ; oper From 9444848069eb84d5484f82dc6021c2b79eb63688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 15 Aug 2023 20:24:51 +0800 Subject: [PATCH 3/8] Create github actions for building rgl --- .github/workflows/test.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..bcfc74a53 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: Check that the RGL can successfully build + +on: + push + +jobs: + build: + runs-on: ubuntu-20.04 + env: + GF_VERSION: 3.11 + DEST: gf-rgl + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Download GF + uses: dsaltares/fetch-gh-release-asset@1.1.1 + with: + repo: 'GrammaticalFramework/gf-core' + version: 'tags/${{ env.GF_VERSION }}' + file: 'gf-${{ env.GF_VERSION }}-ubuntu-20.04.deb' + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install GF + run: | + sudo dpkg -i gf-${GF_VERSION}-ubuntu-20.04.deb' + + - name: Build RGL + run: | + mkdir -p ${DEST} + bash Setup.sh --dest=${DEST} --gf=gf --verbose From e2b6af2ca4a4bab9dca0eb1d3a92a9397aef8deb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Tue, 15 Aug 2023 20:26:05 +0800 Subject: [PATCH 4/8] Fix typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bcfc74a53..b48c6dbc3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,7 +24,7 @@ jobs: - name: Install GF run: | - sudo dpkg -i gf-${GF_VERSION}-ubuntu-20.04.deb' + sudo dpkg -i gf-${GF_VERSION}-ubuntu-20.04.deb - name: Build RGL run: | From 7d483b1539fc1a990509f18fbb464e13331eec96 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Tue, 15 Aug 2023 22:15:38 +0300 Subject: [PATCH 5/8] uses of Finnish infinitive forms in syntax --- src/finnish/infinitives/Infinitive.gf | 19 +++++++ src/finnish/infinitives/InfinitiveFin.gf | 65 ++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/finnish/infinitives/Infinitive.gf create mode 100644 src/finnish/infinitives/InfinitiveFin.gf diff --git a/src/finnish/infinitives/Infinitive.gf b/src/finnish/infinitives/Infinitive.gf new file mode 100644 index 000000000..902890746 --- /dev/null +++ b/src/finnish/infinitives/Infinitive.gf @@ -0,0 +1,19 @@ +abstract Infinitive = + + Grammar, + Lexicon + ** { + +fun + PresPartPassSubjVP : VP -> VP ; -- (minun) on mentävä + PresPartPassObjVP : VPSlash -> VP ; -- (oluesta) on pidettävä + + PastPartPassAdv : NP -> VP -> Adv ; -- junan mentyä + AgentPartAP : NP -> VPSlash -> AP ; -- koiran syömä + + Inf2InessAdv : NP -> VP -> Adv ; -- junan mennessä + Inf2InessPassAdv : NP -> VPSlash -> Adv ; -- junaa odotettaessa + + + +} \ No newline at end of file diff --git a/src/finnish/infinitives/InfinitiveFin.gf b/src/finnish/infinitives/InfinitiveFin.gf new file mode 100644 index 000000000..e5241ed83 --- /dev/null +++ b/src/finnish/infinitives/InfinitiveFin.gf @@ -0,0 +1,65 @@ +--# -path=..:alltenses + +concrete InfinitiveFin of Infinitive = + GrammarFin, + LexiconFin + ** open + ResFin, + StemFin, + Prelude + in { + +lin + PresPartPassSubjVP vp = vp ** { + s = vpVerbOlla ** {sc = SCGen} ; + s2 = \\b,p,a => vp.s.s ! PresPartPass (AN (NCase Sg Nom)) ++ vp.s2 ! b ! p ! a ; + } ; + + PresPartPassObjVP vpslash = vpslash ** { + s = vpVerbOlla ** {sc = npform2subjcase vpslash.c2.c} ; + s2 = \\b,p,a => vpslash.c2.s.p2 ++ vpslash.s.s ! PresPartPass (AN (NCase Sg Nom)) ++ vpslash.s2 ! b ! p ! a ; + } ; + + PastPartPassAdv np vp = { + s = np.s ! NPCase Gen ++ + vp.s.s ! PastPartPass (AN (NCase Sg Part)) ++ + vp.s2 ! True ! Pos ! np.a ++ + vp.adv ! Pos ++ + vp.ext + } ; + + AgentPartAP np vp = { + s = \\_, nf => + np.s ! NPCase Gen ++ + vp.s2 ! True ! Pos ! np.a ++ + vp.adv ! Pos ++ + vp.c2.s.p2 ++ + vp.s.s ! AgentPart (AN nf) ++ + vp.ext ; + hasPrefix = False ; + p = [] + } ; + + Inf2InessAdv np vp = { + s = np.s ! NPCase Gen ++ + infVP SCNom Pos np.a vp Inf2Iness + } ; + + Inf2InessPassAdv np vps = { + s = np.s ! NPCase Part ++ + infVP SCNom Pos np.a Inf2InessPass + } ; + + + +-- {s = vp.s.s ! Inf Inf1Long} ; +-- {s = vp.s.s ! Inf Inf2Instr} ; + +-- {s = vp.s.s ! Inf Inf2InessPass} ; +-- {s = vp.s.s ! Inf Inf2Adess} ; +-- {s = vp.s.s ! Inf InfPresPart} ; + + + + +} \ No newline at end of file From a9408305df37f52195209d97bf2fa75782c0c479 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Tue, 15 Aug 2023 22:16:20 +0300 Subject: [PATCH 6/8] added SCAcc in Finnish and fixed the subject form in passives --- src/finnish/ResFin.gf | 6 ++++-- src/finnish/StemFin.gf | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/finnish/ResFin.gf b/src/finnish/ResFin.gf index 8a39b06ed..b236f7aec 100644 --- a/src/finnish/ResFin.gf +++ b/src/finnish/ResFin.gf @@ -30,7 +30,7 @@ resource ResFin = ParamX ** open Prelude in { --- These cases are possible for subjects. - SubjCase = SCNom | SCGen | SCPart | SCIness | SCElat | SCAdess | SCAblat ; + SubjCase = SCNom | SCGen | SCPart | SCIness | SCElat | SCAdess | SCAblat | SCAcc ; oper appSubjCase : SubjCase -> ResFin.NP -> Str = \sc,np -> np.s ! subjcase2npform sc ; @@ -42,7 +42,8 @@ oper SCIness => NPCase Iness ; SCElat => NPCase Elat ; SCAdess => NPCase Adess ; - SCAblat => NPCase Ablat + SCAblat => NPCase Ablat ; + SCAcc => NPAcc } ; npform2subjcase : NPForm -> SubjCase = \sc -> case sc of { @@ -52,6 +53,7 @@ oper NPCase Elat => SCElat ; NPCase Adess => SCAdess ; NPCase Ablat => SCAblat ; + NPAcc => SCAcc ; _ => SCNom } ; diff --git a/src/finnish/StemFin.gf b/src/finnish/StemFin.gf index f0de1ec12..00eb3558e 100644 --- a/src/finnish/StemFin.gf +++ b/src/finnish/StemFin.gf @@ -378,7 +378,8 @@ oper s = \\t,a,b => let agrfin = case vp.sc of { - SCNom => ; + SCNom => ; + SCAcc => ; _ => -- minun täytyy, minulla on } ; verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ; From 31b025bdf1233c75d3ed85742e9decee4b893607 Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Wed, 16 Aug 2023 11:32:11 +0300 Subject: [PATCH 7/8] completed infinitive and participle structures of Finnish --- src/finnish/infinitives/Infinitive.gf | 45 +++++++- src/finnish/infinitives/InfinitiveFin.gf | 140 +++++++++++++++++++++-- 2 files changed, 172 insertions(+), 13 deletions(-) diff --git a/src/finnish/infinitives/Infinitive.gf b/src/finnish/infinitives/Infinitive.gf index 902890746..ec1aa285d 100644 --- a/src/finnish/infinitives/Infinitive.gf +++ b/src/finnish/infinitives/Infinitive.gf @@ -1,6 +1,6 @@ abstract Infinitive = - Grammar, + Grammar - [VPSlashPrep], ---- to avoid certain spurious ambiguities, to be fixed Lexicon ** { @@ -9,11 +9,50 @@ fun PresPartPassObjVP : VPSlash -> VP ; -- (oluesta) on pidettävä PastPartPassAdv : NP -> VP -> Adv ; -- junan mentyä - AgentPartAP : NP -> VPSlash -> AP ; -- koiran syömä + + PresPartActAP : VP -> AP ; -- (lihaa) syövä + PastPartActAP : VP -> AP ; -- (lihaa) syönyt + PresPartPassAP : VPSlash -> AP ; -- (tänään) syötävä + PastPartPassAP : VPSlash -> AP ; -- (tänään) syöty + + AgentPartAP : NP -> VPSlash -> AP ; -- koiran syömä + Inf2InessAdv : NP -> VP -> Adv ; -- junan mennessä - Inf2InessPassAdv : NP -> VPSlash -> Adv ; -- junaa odotettaessa + + Inf2InessPassAdv : VP -> Adv ; -- odotettaessa (junaa), touhuttaessa (junan kanssa) + Inf2InessPassInvAdv : NP -> VPSlash -> Adv ; -- junaa odotettaessa, junan kanssa touhutessa + Inf2InstrAdv : VP -> Adv ; -- odottaen (junaa) + Inf2InstrInvAdv : NP -> VPSlash -> Adv ; -- junaa odottaen + Inf2InstrAdv : VP -> Adv ; -- odottaen (junaa) + Inf2InstrInvAdv : NP -> VPSlash -> Adv ; -- junaa odottaen + + Inf3InessAdv : VP -> Adv ; -- odottamassa (junaa) + Inf3InessInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamassa + + Inf3ElatAdv : VP -> Adv ; -- odottamasta (junaa) + Inf3ElatInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamasta + + Inf3IllatAdv : VP -> Adv ; -- odottamaan (junaa) + Inf3IllatInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamaan + + Inf3AdessAdv : VP -> Adv ; -- odottamalla (junaa) + Inf3AdessInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamalla + + Inf3AbessAdv : VP -> Adv ; -- odottamatta (junaa) + Inf3AbessInvAdv : NP -> VPSlash -> Adv ; -- junaa odottamatta + + ComplPresPartActVS : VS -> NP -> VP -> VP ; -- sanoa junan menevän + ComplPastPartActVS : VS -> NP -> VP -> VP ; -- sanoa junan menneen + + ComplPresPartActAgrVS : VS -> VP -> VP ; -- sanoa menevänsä + ComplPastPartActAgrVS : VS -> VP -> VP ; -- sanoa menneensä + + ComplPresPartPassVS : VS -> NP -> VPSlash -> VP ; -- sanoa junaa odotettavan + ComplPastPartPassVS : VS -> NP -> VPSlash -> VP ; -- sanoa junaa odotetun + + } \ No newline at end of file diff --git a/src/finnish/infinitives/InfinitiveFin.gf b/src/finnish/infinitives/InfinitiveFin.gf index e5241ed83..8ace57860 100644 --- a/src/finnish/infinitives/InfinitiveFin.gf +++ b/src/finnish/infinitives/InfinitiveFin.gf @@ -1,7 +1,7 @@ --# -path=..:alltenses concrete InfinitiveFin of Infinitive = - GrammarFin, + GrammarFin - [VPSlashPrep], LexiconFin ** open ResFin, @@ -27,7 +27,31 @@ lin vp.adv ! Pos ++ vp.ext } ; - + + PresPartActAP vp = { + s = \\_, nf => preCompVP vp (PresPartAct (AN nf)) ; + hasPrefix = False ; + p = [] + } ; + + PastPartActAP vp = { + s = \\_, nf => preCompVP vp (PastPartAct (AN nf)) ; + hasPrefix = False ; + p = [] + } ; + + PresPartPassAP vp = { + s = \\_, nf => preCompVP (PresPartPass (AN nf)) ; + hasPrefix = False ; + p = [] + } ; + + PastPartPassAP vp = { + s = \\_, nf => preCompVP (PastPartPass (AN nf)) ; + hasPrefix = False ; + p = [] + } ; + AgentPartAP np vp = { s = \\_, nf => np.s ! NPCase Gen ++ @@ -45,21 +69,117 @@ lin infVP SCNom Pos np.a vp Inf2Iness } ; - Inf2InessPassAdv np vps = { - s = np.s ! NPCase Part ++ + Inf2InessPassAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf2InessPass + } ; + + Inf2InessPassInvAdv np vps = { + s = infAppCompl vps.c2 np ++ infVP SCNom Pos np.a Inf2InessPass } ; + Inf2InstrAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf2Instr + } ; + + Inf2InstrInvAdv np vps = { + s = infAppCompl vps.c2 np ++ + infVP SCNom Pos np.a Inf2Instr + } ; + + Inf3InessAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf3Iness + } ; + + Inf3InessInvAdv np vps = { + s = infAppCompl vps.c2 np ++ + infVP SCNom Pos np.a Inf3Iness + } ; + Inf3ElatAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf3Elat + } ; + + Inf3ElatInvAdv np vps = { + s = infAppCompl vps.c2 np ++ + infVP SCNom Pos np.a Inf3Elat + } ; + + Inf3IllatAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf3Illat + } ; + + Inf3IllatInvAdv np vps = { + s = infAppCompl vps.c2 np ++ + infVP SCNom Pos np.a Inf3Illat + } ; + + + Inf3AdessAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf3Adess + } ; + + Inf3AdessInvAdv np vps = { + s = infAppCompl vps.c2 np ++ + infVP SCNom Pos np.a Inf3Adess + } ; + + + Inf3AbessAdv vp = { + s = infVP SCNom Pos infAdvAgr vp Inf3Abess + } ; + + Inf3AbessInvAdv np vps = { + s = infAppCompl vps.c2 np ++ + infVP SCNom Pos np.a Inf3Abess + } ; + + ComplPresPartActVS vs np vp = + insertExtrapos (subjPartVP np vp (NPCase Gen) (PresPartAct (AN (NCase Sg Gen)))) (predSV vs) ; + ComplPastPartActVS vs np vp = + insertExtrapos (subjPartVP np vp (NPCase Gen) (PastPartAct (AN (NCase Sg Gen)))) (predSV vs) ; + + ComplPresPartActAgrVS vs vp = + insertObj (\\_,_,agr => subjPartAgrVP vp (PresPartAct (AN (NPossGen Sg))) agr) (predSV vs) ; + ComplPastPartActAgrVS vs vp = + insertObj (\\_,_,agr => subjPartAgrVP vp (PastPartAct (AN (NPossGen Sg))) agr) (predSV vs) ; + + ComplPresPartPassVS vs np vps = + insertExtrapos (subjPartVP np (NPCase Part) (PresPartPass (AN (NCase Sg Gen)))) (predSV vs) ; + ComplPastPartPassVS vs np vps = + insertExtrapos (subjPartVP np (NPCase Part) (PastPartPass (AN (NCase Sg Gen)))) (predSV vs) ; --- {s = vp.s.s ! Inf Inf1Long} ; --- {s = vp.s.s ! Inf Inf2Instr} ; - --- {s = vp.s.s ! Inf Inf2InessPass} ; --- {s = vp.s.s ! Inf Inf2Adess} ; --- {s = vp.s.s ! Inf InfPresPart} ; +oper + infAppCompl : Compl -> ResFin.NP -> Str = \co, np -> + appCompl False Neg co np ; -- not fin, Acc becomes Part + + infAdvAgr : Agr = agrP3 Sg ; --- ? + + -- hänen syövän, häntä syödyn, häntä syötävän + subjPartVP : ResFin.NP -> StemFin.VP -> NPForm -> VForm -> Str = \np, vp, npform, vform -> + np.s ! NPCase Gen ++ + vp.s.s ! vform ++ + vp.s2 ! True ! Pos ! np.a ++ + vp.adv ! Pos ++ + vp.ext ; + + -- tiedän syöväni, tiedän syöneeni + subjPartAgrVP : StemFin.VP -> VForm -> Agr -> Str = \vp, vform, agr -> + vp.s.s ! vform ++ BIND ++ + case vp.s.h of {Back => possSuffix agr ; Front => possSuffixFront agr} ++ + vp.s2 ! True ! Pos ! agr ++ + vp.adv ! Pos ++ + vp.ext ; + + + -- ruohoa syövä, Ranskassa valmistettu + preCompVP : StemFin.VP -> VForm -> Str = \vp, vform -> + vp.s2 ! True ! Pos ! infAdvAgr ++ + vp.adv ! Pos ++ + vp.s.s ! vform ++ + vp.ext ; } \ No newline at end of file From 146bc71a06442b3eb6255a71748c12aa5098cd1d Mon Sep 17 00:00:00 2001 From: Aarne Ranta Date: Wed, 16 Aug 2023 16:05:28 +0300 Subject: [PATCH 8/8] clean-up after Fin infinitives --- src/finnish/VerbFin.gf | 3 ++- src/finnish/infinitives/Infinitive.gf | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/finnish/VerbFin.gf b/src/finnish/VerbFin.gf index e70847c3a..cee24034d 100644 --- a/src/finnish/VerbFin.gf +++ b/src/finnish/VerbFin.gf @@ -79,7 +79,8 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in { ) ** {c2 = vp.c2} ; ---- correct ?? -} - SlashV2VNP = StemFin.slashV2VNP ; ---- compilation to pgf takes too long 6/8/2013 hence a simplified version in stemmed/ +---- + SlashV2VNP = StemFin.slashV2VNP ; ---- compilation to pgf takes too long 6/8/2013 hence a simplified version in stemmed/ AdvVP vp adv = insertAdv (\\_ => adv.s) vp ; ExtAdvVP vp adv = insertAdv (\\_ => embedInCommas adv.s) vp ; diff --git a/src/finnish/infinitives/Infinitive.gf b/src/finnish/infinitives/Infinitive.gf index ec1aa285d..c94cd6dfb 100644 --- a/src/finnish/infinitives/Infinitive.gf +++ b/src/finnish/infinitives/Infinitive.gf @@ -4,21 +4,23 @@ abstract Infinitive = Lexicon ** { -fun +flags startcat = Utt ; + +data PresPartPassSubjVP : VP -> VP ; -- (minun) on mentävä PresPartPassObjVP : VPSlash -> VP ; -- (oluesta) on pidettävä PastPartPassAdv : NP -> VP -> Adv ; -- junan mentyä - PresPartActAP : VP -> AP ; -- (lihaa) syövä - PastPartActAP : VP -> AP ; -- (lihaa) syönyt + PresPartActAP : VP -> AP ; -- (lihaa) syövä + PastPartActAP : VP -> AP ; -- (lihaa) syönyt PresPartPassAP : VPSlash -> AP ; -- (tänään) syötävä PastPartPassAP : VPSlash -> AP ; -- (tänään) syöty AgentPartAP : NP -> VPSlash -> AP ; -- koiran syömä - Inf2InessAdv : NP -> VP -> Adv ; -- junan mennessä + Inf2InessAdv : NP -> VP -> Adv ; -- junan mennessä Inf2InessPassAdv : VP -> Adv ; -- odotettaessa (junaa), touhuttaessa (junan kanssa) Inf2InessPassInvAdv : NP -> VPSlash -> Adv ; -- junaa odotettaessa, junan kanssa touhutessa @@ -53,6 +55,5 @@ fun ComplPastPartPassVS : VS -> NP -> VPSlash -> VP ; -- sanoa junaa odotetun - } \ No newline at end of file