1
0
forked from GitHub/gf-rgl

(Dut) Add inflected form of past participle + WIP on PastPartAP in ExtendDut

This commit is contained in:
Inari Listenmaa
2018-04-18 16:30:41 +02:00
parent f2a02c438d
commit de5ce221b6
2 changed files with 73 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
concrete ExtendDut of Extend = concrete ExtendDut of Extend =
CatDut ** ExtendFunctor CatDut ** ExtendFunctor
-- - [] -- put the names of your own definitions here - [PastPartAP]
with with
(Grammar = GrammarDut) ** (Grammar = GrammarDut) **
open open
@@ -11,6 +11,11 @@ concrete ExtendDut of Extend =
Coordination, Coordination,
Prelude, Prelude,
ParadigmsDut in { ParadigmsDut in {
-- put your own definitions here lin
PastPartAP vp = {
s = \\agr,af => (infClause [] agr vp).s ! Past ! Anter ! Pos ! Sub ;
isPre = notB vp.inf.p2
} ;
} }

View File

@@ -123,6 +123,7 @@ param
| VImp3 -- weest | VImp3 -- weest
| VImpPl -- wezen | VImpPl -- wezen
| VPerf -- geweest | VPerf -- geweest
| VPerfInfl -- geweeste --# notpresent
| VPresPart -- zijnde | VPresPart -- zijnde
| VGer -- zijnde | VGer -- zijnde
; ;
@@ -136,21 +137,35 @@ param
\aai, aait, aaien, aaide, aaidet, aaiden, geaaid -> \aai, aait, aaien, aaide, aaidet, aaiden, geaaid ->
mkVerb8 aai aait aait aaien aaide aaidet aaiden geaaid ; mkVerb8 aai aait aait aaien aaide aaidet aaiden geaaid ;
mkVerb8 : (_,_,_,_,_,_,_,_ : Str) -> mkVerb8 : (_,_,_,_,_,_,_,_ : Str) -> Verb =
Verb = \aai, aaitt, aait, aaien, aaide, _, aaiden, geaaid -> { \aai, aaitt, aait, aaien, aaide, _, aaiden, geaaid ->
s = table { let geaaide = inflParticiple geaaid
VInf | VInfFull | VImpPl | VPresPl => aaien; -- hij/zij/het/wij aaien in { s = table {
VInf | VInfFull |
VImpPl | VPresPl => aaien; -- hij/zij/het/wij aaien
VPresSg1 | VImp2 => aai; -- ik aai VPresSg1 | VImp2 => aai; -- ik aai
VPresSg2 => aaitt ; -- jij aait VPresSg2 => aaitt ; -- jij aait
VPresSg3 | VImp3 => aait; -- jij aait VPresSg3 | VImp3 => aait; -- hij/zij aait
VPastSg => aaide; -- ik aaide --# notpresent VPastSg => aaide; -- ik aaide --# notpresent
VPastPl => aaiden; -- hij/zij/het/wij aaiden --# notpresent VPastPl => aaiden; -- hij/zij/het/wij aaiden --# notpresent
VPerf => geaaid ; -- ik heb geaaid VPerf => geaaid ; -- ik heb geaaid
VPerfInfl => geaaide ; -- inflected form of participle --# notpresent
VPresPart => aaien + "de" ; VPresPart => aaien + "de" ;
VGer => aaien + "d" VGer => aaien + "d"
} }
}; };
inflParticiple : Str -> Str = \gezien ->
case gezien of {
_ + "ien" => gezien + "e" ; -- gezien/geziene
_ + "en" => gezien ; -- geboren/geboren
x + "aa" + n@? => x + "a" + n + "e" ; -- gegaan/gegane ; gepraat/geprate
-- not sure if these even exist, remove if wrong
x + "ee" + n@? => x + "e" + n + "e" ;
x + "oo" + n@? => x + "o" + n + "e" ;
_ => gezien + "e" -- betaald/betaalde ; gemaakt/gemaakte
} ;
regVerb : Str -> Verb = \s -> smartVerb s (mkStem s) ; regVerb : Str -> Verb = \s -> smartVerb s (mkStem s) ;
irregVerb : (breken,brak,gebroken : Str) -> Verb = \breken,brak,gebroken -> irregVerb : (breken,brak,gebroken : Str) -> Verb = \breken,brak,gebroken ->
@@ -161,7 +176,7 @@ param
irregVerb2 : (breken,brak,braken,gebroken : Str) -> Verb = \breken,brak,braken,gebroken -> irregVerb2 : (breken,brak,braken,gebroken : Str) -> Verb = \breken,brak,braken,gebroken ->
let brek = (regVerb breken).s let brek = (regVerb breken).s
in in
mkVerb (brek ! VPresSg1) (brek ! VPresSg3) (brek ! VInf) brak brak (braken) gebroken ; mkVerb (brek ! VPresSg1) (brek ! VPresSg3) (brek ! VInf) brak brak braken gebroken ;
-- To add a prefix (like "ein") to an already existing verb. -- To add a prefix (like "ein") to an already existing verb.
@@ -200,6 +215,7 @@ param
_ => d_regVerb vergeten vergeet _ => d_regVerb vergeten vergeet
}; };
consonant : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"y"|"z") ; consonant : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"y"|"z") ;
vowel : pattern Str = #("a"|"e"|"i"|"o"|"u") ; vowel : pattern Str = #("a"|"e"|"i"|"o"|"u") ;
-- To make a stem out of a verb -- To make a stem out of a verb
@@ -298,6 +314,7 @@ param
VImp3 => "weest" ; VImp3 => "weest" ;
VImpPl => "wezen" ; VImpPl => "wezen" ;
VPerf => "geweest" ; VPerf => "geweest" ;
VPerfInfl => "geweeste" ;
VPresPart => "zijnde" ; VPresPart => "zijnde" ;
VGer => "wezend" VGer => "wezend"
} ; } ;
@@ -321,6 +338,7 @@ param
VImp3 => "heeft" ; VImp3 => "heeft" ;
VImpPl => "hebben" ; VImpPl => "hebben" ;
VPerf => "gehad" ; VPerf => "gehad" ;
VPerfInfl => "gehadde" ;
VPresPart => "hebbende" ; VPresPart => "hebbende" ;
VGer => "hebbend" VGer => "hebbend"
} ; } ;
@@ -344,6 +362,7 @@ param
VImp3 => "zoudt" ; VImp3 => "zoudt" ;
VImpPl => "zouden" ; ---- VImpPl => "zouden" ; ----
VPerf => "gezoudt" ; VPerf => "gezoudt" ;
VPerfInfl => "gezoude" ;
VPresPart => "zullende" ; VPresPart => "zullende" ;
VGer => "zullend" VGer => "zullend"
} ; } ;
@@ -367,6 +386,7 @@ param
VImp3 => "kan" ; VImp3 => "kan" ;
VImpPl => "kunnen" ; ---- VImpPl => "kunnen" ; ----
VPerf => "gekund" ; VPerf => "gekund" ;
VPerfInfl => "gekunde" ;
VPresPart => "kunnende" ; VPresPart => "kunnende" ;
VGer => "kunnend" VGer => "kunnend"
} ; } ;
@@ -568,21 +588,45 @@ param
-- For $Sentence$. -- For $Sentence$.
param
ClType = Inf | Fin ;
oper
Clause : Type = { Clause : Type = {
s : Tense => Anteriority => Polarity => Order => Str s : Tense => Anteriority => Polarity => Order => Str
} ; } ;
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { -- To be used for normal clauses
mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp ->
mkClause' subj agr vp ! Fin ;
-- To be used for ExtendDut.PastPartAP
-- If we need more variants, extend mkClause'
infClause : Str -> Agr -> VP -> Clause = \subj,agr,vp ->
mkClause' subj agr vp ! Inf ;
-- Lines 615-618 add a possibility to choose a participle verb form.
-- This is so far only used in ExtendDut.PastPartAP. /IL2018
mkClause' : Str -> Agr -> VP -> (ClType => Clause) = \subj,agr,vp ->
\\isPart => {
s = \\t,a,b,o => s = \\t,a,b,o =>
let let
vform = vForm t agr.g agr.n agr.p o ; vform = vForm t agr.g agr.n agr.p o ;
auxv = (auxVerb vp.s.aux).s ; auxv = (auxVerb vp.s.aux).s ;
vperf = vp.s.s ! VPerf ; vperf = vp.s.s ! VPerf ;
verb : Str * Str = case <t,a> of { verb : Str * Str = case <isPart,t,a> of {
<Fut|Cond,Simul> => <zullen_V.s ! vform, vp.s.s ! VInf> ; --# notpresent
<Fut|Cond,Anter> => <zullen_V.s ! vform, vperf ++ auxv ! VInf> ; --# notpresent -- <Experimental: only used in ExtendDut.PastPartAP>
<_, Anter> => <auxv ! vform, vperf> ; --# notpresent <Inf,Fut|Pres, _> => <vp.s.s ! VPresPart, []> ; --# notpresent
<_, Simul> => <vp.s.s ! vform, []> <Inf,Past|Cond,_> => <case agr.g of { Utr => vp.s.s ! VPerfInfl ;
_ => vperf }
,[]> ; --# notpresent
-- </Experimental>
<_,Fut|Cond,Simul> => <zullen_V.s ! vform, vp.s.s ! VInf> ; --# notpresent
<_,Fut|Cond,Anter> => <zullen_V.s ! vform, vperf ++ auxv ! VInf> ; --# notpresent
<_,_, Anter> => <auxv ! vform, vperf> ; --# notpresent
<_,_, Simul> => <vp.s.s ! vform, []>
} ; } ;
fin = verb.p1 ; fin = verb.p1 ;
neg = vp.a1 ! b ; neg = vp.a1 ! b ;