mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-10-01 06:33:38 -06:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d3591ca08 |
@@ -4,8 +4,7 @@ concrete AllAfr of AllAfrAbs =
|
|||||||
LangAfr,
|
LangAfr,
|
||||||
IrregAfr,
|
IrregAfr,
|
||||||
ExtendAfr
|
ExtendAfr
|
||||||
**
|
** open ExtraAfr in {
|
||||||
{
|
|
||||||
--{} ;
|
--{} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
abstract AllAfrAbs =
|
abstract AllAfrAbs =
|
||||||
Lang,
|
Lang,
|
||||||
IrregAfrAbs,
|
IrregAfrAbs,
|
||||||
ExtraAfrAbs
|
Extend
|
||||||
**
|
**
|
||||||
{
|
{
|
||||||
--{} ;
|
--{} ;
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ concrete CatAfr of Cat =
|
|||||||
|
|
||||||
lindef
|
lindef
|
||||||
VPSlash = \s -> {
|
VPSlash = \s -> {
|
||||||
s = {s = \\_ => s; prefix = ""; aux = VHebben; vtype = VAct} ;
|
s = {s = \\_ => s; prefix = ""; hasPrefix = False; hasPast = False; aux = VHebben; vtype = VAct} ;
|
||||||
a1 = \\_ => "" ;
|
a1 = \\_ => "" ;
|
||||||
n0 = \\_ => "" ;
|
n0 = \\_ => "" ;
|
||||||
n2 = \\_ => "" ;
|
n2 = \\_ => "" ;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ lin GenModNP num np cn = heavyNP {
|
|||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
PastPartAgentAP vp np = {
|
PastPartAgentAP vp np = {
|
||||||
s = \\_ => partVP vp (agrP3 Sg) ++ "door" ++ np.s ! NPAcc ;
|
s = \\_ => partVP vp (agrP3 Sg) ++ "deur" ++ np.s ! NPAcc ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
ProgrVPSlash vp = vp ;
|
ProgrVPSlash vp = vp ;
|
||||||
@@ -121,12 +121,12 @@ lin GenModNP num np cn = heavyNP {
|
|||||||
s = \\_ => infVPString vp (agrP3 Sg) ;
|
s = \\_ => infVPString vp (agrP3 Sg) ;
|
||||||
a = agrP3 Sg
|
a = agrP3 Sg
|
||||||
} ;
|
} ;
|
||||||
GerundAdv vp = {s = "door" ++ infVPString vp (agrP3 Sg)} ;
|
GerundAdv vp = {s = "deur" ++ infVPBody vp (agrP3 Sg)} ;
|
||||||
ByVP vp = {s = "door" ++ infVPString vp (agrP3 Sg)} ;
|
ByVP vp = {s = "deur" ++ infVPBody vp (agrP3 Sg)} ;
|
||||||
InOrderToVP vp = {s = "om" ++ infVPString vp (agrP3 Sg)} ;
|
InOrderToVP vp = {s = infVPString vp (agrP3 Sg)} ;
|
||||||
|
|
||||||
ApposNP np1 np2 = heavyNP {
|
ApposNP np1 np2 = heavyNP {
|
||||||
s = \\c => np1.s ! c ++ "," ++ np2.s ! c ;
|
s = \\c => np1.s ! c ++ bindComma ++ np2.s ! c ;
|
||||||
a = np1.a
|
a = np1.a
|
||||||
} ;
|
} ;
|
||||||
PositAdVAdj a = {s = a.s ! Posit ! APred} ;
|
PositAdVAdj a = {s = a.s ! Posit ! APred} ;
|
||||||
@@ -155,11 +155,14 @@ lin BaseImp = twoTable2 Polarity ImpForm ;
|
|||||||
lin PassVPSlash vps =
|
lin PassVPSlash vps =
|
||||||
insertInf (vps.s.s ! VPerf) (predV word_V) ;
|
insertInf (vps.s.s ! VPerf) (predV word_V) ;
|
||||||
PassAgentVPSlash vps np =
|
PassAgentVPSlash vps np =
|
||||||
insertAdv (appPrep "door" np.s) (insertInf (vps.s.s ! VPerf) (predV word_V)) ;
|
insertAdv (appPrep "deur" np.s) (insertInf (vps.s.s ! VPerf) (predV word_V)) ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
infVPString : ResAfr.VP -> Agr -> Str = \vp,a ->
|
infVPString : ResAfr.VP -> Agr -> Str = \vp,a ->
|
||||||
"om" ++ vp.n0 ! a ++ vp.n2 ! a ++ vp.a2 ++ "te" ++
|
"om" ++ infVPBody vp a ;
|
||||||
|
|
||||||
|
infVPBody : ResAfr.VP -> Agr -> Str = \vp,a ->
|
||||||
|
vp.n0 ! a ++ vp.n2 ! a ++ vp.a2 ++ vp.s.prefix ++ "te" ++
|
||||||
vp.s.s ! VInf ++ vp.inf.p1 ++ vp.ext ;
|
vp.s.s ! VInf ++ vp.inf.p1 ++ vp.ext ;
|
||||||
|
|
||||||
partVP : ResAfr.VP -> Agr -> Str = \vp,a ->
|
partVP : ResAfr.VP -> Agr -> Str = \vp,a ->
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ concrete IdiomAfr of Idiom = CatAfr **
|
|||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ProgrVP vp = insertAdv ("aan" ++ "die" ++ useInfVP True vp) (predV zijn_V) ; --afr
|
ProgrVP vp = insertExtrapos (useInfVP False vp)
|
||||||
|
(insertObj (\\_ => "besig") (predV zijn_V)) ;
|
||||||
|
|
||||||
ImpPl1 vp =
|
ImpPl1 vp =
|
||||||
let
|
let
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ concrete NounAfr of Noun = CatAfr ** open ResAfr, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
ExtAdvNP np adv = heavyNP {
|
ExtAdvNP np adv = heavyNP {
|
||||||
s = \\c => np.s ! c ++ "," ++ adv.s ++ "," ;
|
s = \\c => np.s ! c ++ embedInCommas adv.s ;
|
||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -163,7 +163,7 @@ concrete NounAfr of Noun = CatAfr ** open ResAfr, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelNP np rs = {
|
RelNP np rs = {
|
||||||
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a.g ! np.a.n ;
|
s = \\c => np.s ! c ++ bindComma ++ rs.s ! np.a.g ! np.a.n ;
|
||||||
a = np.a ;
|
a = np.a ;
|
||||||
isPron = False
|
isPron = False
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -243,11 +243,14 @@ oper
|
|||||||
mkV : (breek,gebreek : Str) -> V =
|
mkV : (breek,gebreek : Str) -> V =
|
||||||
\a,b -> lin V (v2vv (irregVerb a b)) ;
|
\a,b -> lin V (v2vv (irregVerb a b)) ;
|
||||||
mkV : (wil,wou,gewil : Str) -> V =
|
mkV : (wil,wou,gewil : Str) -> V =
|
||||||
\a,b,c -> lin V (v2vv (mkVerb a a b c)) ;
|
\a,b,c -> lin V (v2vvPast (mkVerb a a b c)) ;
|
||||||
mkV : Str -> V -> V = \v,s ->lin V (prefixV v s) ;
|
mkV : Str -> V -> V = \v,s ->lin V (prefixV v s) ;
|
||||||
} ;
|
} ;
|
||||||
zijnV v = v ; -- lin V (v2vvAux v VZijn) ;
|
zijnV v = v ; -- lin V (v2vvAux v VZijn) ;
|
||||||
reflV v = lin V {s = v.s ; aux = v.aux ; prefix = v.prefix ; vtype = VRefl} ;
|
reflV v = lin V {
|
||||||
|
s = v.s ; aux = v.aux ; prefix = v.prefix ; hasPrefix = v.hasPrefix ;
|
||||||
|
hasPast = v.hasPast ; vtype = VRefl
|
||||||
|
} ;
|
||||||
|
|
||||||
zijn_V : V = lin V ResAfr.zijn_V ;
|
zijn_V : V = lin V ResAfr.zijn_V ;
|
||||||
hebben_V : V = lin V ResAfr.hebben_V ;
|
hebben_V : V = lin V ResAfr.hebben_V ;
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ concrete PhraseAfr of Phrase = CatAfr ** open Prelude, ResAfr in
|
|||||||
PConjConj conj = ss (conj.s2) ;
|
PConjConj conj = ss (conj.s2) ;
|
||||||
|
|
||||||
NoVoc = {s = []} ;
|
NoVoc = {s = []} ;
|
||||||
VocNP np = {s = "," ++ np.s ! NPNom} ;
|
VocNP np = {s = bindComma ++ np.s ! NPNom} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+86
-28
@@ -58,6 +58,9 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
b + v@("ei"|"eu"|"oe"|"ou"|"ie"|"y"|"ui") + "g" => mkNoun s (b + v + "e") Neutr ; --tuig, tuie --R13.1
|
b + v@("ei"|"eu"|"oe"|"ou"|"ie"|"y"|"ui") + "g" => mkNoun s (b + v + "e") Neutr ; --tuig, tuie --R13.1
|
||||||
|
|
||||||
_ + ("oir" | "ion" | "je") => mkNoun s (s + "s") Neutr ; --uit Nederlandse reël
|
_ + ("oir" | "ion" | "je") => mkNoun s (s + "s") Neutr ; --uit Nederlandse reël
|
||||||
|
|
||||||
|
b + "heid" => mkNoun s (b + "hede") Neutr ;
|
||||||
|
_ + "teit" => mkNoun s (s + "e") Neutr ;
|
||||||
|
|
||||||
_ + ("rm" | "lm") => mkNoun s (s + "s") Neutr ; --R13.3
|
_ + ("rm" | "lm") => mkNoun s (s + "s") Neutr ; --R13.3
|
||||||
|
|
||||||
@@ -120,8 +123,9 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
b + v@("aal"|"baar"|"eel"|"loos") => b + init (init v) + last v + "e" ; --p288
|
b + v@("aal"|"baar"|"eel"|"loos") => b + init (init v) + last v + "e" ; --p288
|
||||||
_ + ("agtig"|"ant"|"ent"|"êr"|"ies"|"ig"|"lik"|"matig"|"s") => s + "e" ; --p288
|
_ + ("agtig"|"ant"|"ent"|"êr"|"ies"|"ig"|"lik"|"matig"|"s") => s + "e" ; --p288
|
||||||
b + "ief" => b + "iewe" ; --p288
|
b + "ief" => b + "iewe" ; --p288
|
||||||
|
|
||||||
|
_ + "af" => s ; -- compounds such as kortaf
|
||||||
|
|
||||||
--b + ("ei"|"eu"|"oe"|"ou"|"ie"|"y"|"ui") + ? => endCons s + "e" ;
|
|
||||||
b + v@("ou"|"y") + "d" => b + v + "e" ; --koud, koue / wyd, wye
|
b + v@("ou"|"y") + "d" => b + v + "e" ; --koud, koue / wyd, wye
|
||||||
|
|
||||||
--b + v@("oo"|"ee") + "d" => b + init v + "ë" ; --leeg, leë
|
--b + v@("oo"|"ee") + "d" => b + init v + "ë" ; --leeg, leë
|
||||||
@@ -132,6 +136,7 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
b + v@("aa"|"ee"|"oo"|"uu") + "r" => s ; --duur, duur
|
b + v@("aa"|"ee"|"oo"|"uu") + "r" => s ; --duur, duur
|
||||||
b + v@("aa"|"ee"|"oo"|"uu") + c@#cons => b + shortVoc v c + "e" ; --gaaf, gawe
|
b + v@("aa"|"ee"|"oo"|"uu") + c@#cons => b + shortVoc v c + "e" ; --gaaf, gawe
|
||||||
|
b + ("ei"|"eu"|"oe"|"ou"|"ie"|"y"|"ui") + ? => endCons s + "e" ;
|
||||||
b + v@("a"|"e"|"i"|"o"|"u" ) + "f" => b + v + "ww" + "e" ; --grof, growwe
|
b + v@("a"|"e"|"i"|"o"|"u" ) + "f" => b + v + "ww" + "e" ; --grof, growwe
|
||||||
--b + v@("a"|"e"|"i"|"o"|"u" ) + c@? => b + v + c + c + "e" ; --stom, growwe
|
--b + v@("a"|"e"|"i"|"o"|"u" ) + c@? => b + v + c + c + "e" ; --stom, growwe
|
||||||
_ + "d" => s + "e" ; --p286
|
_ + "d" => s + "e" ; --p286
|
||||||
@@ -175,12 +180,19 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
s = table {
|
s = table {
|
||||||
VInf => aaien; -- hij/zij/het/wij aaien
|
VInf => aaien; -- hij/zij/het/wij aaien
|
||||||
VPres => aai; -- ik aai
|
VPres => aai; -- ik aai
|
||||||
VPast => aai; -- ik aaide --# notpresent --!afr! lyk vir nou soos VPres
|
VPast => aaide; --# notpresent
|
||||||
VPerf => geaaid -- ik heb geaaid
|
VPerf => geaaid -- ik heb geaaid
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
regVerb : Str -> Verb = \s -> irregVerb s ("ge" + s) ;
|
regVerb : Str -> Verb = \s ->
|
||||||
|
let perf : Str = case s of {
|
||||||
|
("be" | "ge" | "her" | "er" | "ont" | "ver") + _ => s ;
|
||||||
|
"e" + r => "geë" + r ;
|
||||||
|
"i" + r => "geï" + r ;
|
||||||
|
_ => "ge" + s
|
||||||
|
}
|
||||||
|
in irregVerb s perf ;
|
||||||
|
|
||||||
irregVerb : (breek, gebreek : Str) -> Verb = \breek,gebreek ->
|
irregVerb : (breek, gebreek : Str) -> Verb = \breek,gebreek ->
|
||||||
mkVerb breek breek breek gebreek ;
|
mkVerb breek breek breek gebreek ;
|
||||||
@@ -195,10 +207,12 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
if_then_Str b (ein + geb) geb ;
|
if_then_Str b (ein + geb) geb ;
|
||||||
in
|
in
|
||||||
{s = table {
|
{s = table {
|
||||||
f@(VInf | VPerf) => ein + vs ! f ; ---- TODO: eingegeven
|
VPerf => ein + vs ! VPerf ; ---- TODO: eingegeven
|
||||||
f => vs ! f
|
f => vs ! f
|
||||||
} ;
|
} ;
|
||||||
prefix = ein ;
|
prefix = ein ;
|
||||||
|
hasPrefix = True ;
|
||||||
|
hasPast = verb.hasPast ;
|
||||||
aux = verb.aux ;
|
aux = verb.aux ;
|
||||||
vtype = verb.vtype
|
vtype = verb.vtype
|
||||||
} ;
|
} ;
|
||||||
@@ -211,18 +225,22 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
aux = VZijn ;
|
aux = VZijn ;
|
||||||
prefix = [] ;
|
prefix = [] ;
|
||||||
|
hasPrefix = False ;
|
||||||
|
hasPast = True ;
|
||||||
vtype = VAct ;
|
vtype = VAct ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
hebben_V : VVerb = {
|
hebben_V : VVerb = {
|
||||||
s = table {
|
s = table {
|
||||||
VInf => "het" ;
|
VInf => "hê" ;
|
||||||
VPres => "het" ;
|
VPres => "het" ;
|
||||||
VPast => "het" ; --# notpresent
|
VPast => "het" ; --# notpresent
|
||||||
VPerf => "gehad"
|
VPerf => "gehad"
|
||||||
} ;
|
} ;
|
||||||
aux = VHebben ;
|
aux = VHebben ;
|
||||||
prefix = [] ;
|
prefix = [] ;
|
||||||
|
hasPrefix = False ;
|
||||||
|
hasPast = False ;
|
||||||
vtype = VAct ;
|
vtype = VAct ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -241,6 +259,8 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
aux = VHebben ;
|
aux = VHebben ;
|
||||||
prefix = [] ;
|
prefix = [] ;
|
||||||
|
hasPrefix = False ;
|
||||||
|
hasPast = True ;
|
||||||
vtype = VAct ;
|
vtype = VAct ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -248,11 +268,13 @@ resource ResAfr = ParamX ** open Prelude in {
|
|||||||
s = table {
|
s = table {
|
||||||
VInf => "word" ;
|
VInf => "word" ;
|
||||||
VPres => "word" ;
|
VPres => "word" ;
|
||||||
VPast => "word" ; --# notpresent
|
VPast => "is" ; --# notpresent
|
||||||
VPerf => "geword"
|
VPerf => []
|
||||||
} ;
|
} ;
|
||||||
aux = VHebben ;
|
aux = VZijn ;
|
||||||
prefix = [] ;
|
prefix = [] ;
|
||||||
|
hasPrefix = False ;
|
||||||
|
hasPast = True ;
|
||||||
vtype = VAct ;
|
vtype = VAct ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -273,15 +295,18 @@ param
|
|||||||
Adjf = Strong | Weak ;
|
Adjf = Strong | Weak ;
|
||||||
|
|
||||||
|
|
||||||
oper VVerb = Verb ** {prefix : Str ; aux : VAux ; vtype : VType} ;
|
oper VVerb = Verb ** {
|
||||||
|
prefix : Str ; hasPrefix : Bool ; hasPast : Bool ; aux : VAux ; vtype : VType
|
||||||
|
} ;
|
||||||
param VAux = VHebben | VZijn ;
|
param VAux = VHebben | VZijn ;
|
||||||
|
|
||||||
param VType = VAct | VRefl ;
|
param VType = VAct | VRefl ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
v2vvAux : Verb -> VAux -> VVerb = \v,a ->
|
v2vvAux : Verb -> VAux -> VVerb = \v,a ->
|
||||||
{s = v.s ; aux = a ; prefix = [] ; vtype = VAct} ;
|
{s = v.s ; aux = a ; prefix = [] ; hasPrefix = False ; hasPast = False ; vtype = VAct} ;
|
||||||
v2vv : Verb -> VVerb = \v -> v2vvAux v VHebben ;
|
v2vv : Verb -> VVerb = \v -> v2vvAux v VHebben ;
|
||||||
|
v2vvPast : Verb -> VVerb = \v -> (v2vvAux v VHebben) ** {hasPast = True} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -325,11 +350,10 @@ param
|
|||||||
|
|
||||||
-- Used in $NounAfr$.
|
-- Used in $NounAfr$.
|
||||||
|
|
||||||
agrAdj : Gender -> Adjf -> NForm -> AForm = \g,a,n ->
|
-- Afrikaans attributive agreement does not depend on the article in the
|
||||||
case <a,g,n> of {
|
-- way Dutch/German strong and weak agreement does. The adjective's
|
||||||
<Strong,Neutr,NF Sg _> => APred ;
|
-- lexical paradigm determines whether its attributive form has -e.
|
||||||
_ => AAttr
|
agrAdj : Gender -> Adjf -> NForm -> AForm = \_,_,_ -> AAttr ;
|
||||||
} ;
|
|
||||||
|
|
||||||
oper VP : Type = {
|
oper VP : Type = {
|
||||||
s : VVerb ;
|
s : VVerb ;
|
||||||
@@ -440,30 +464,47 @@ param
|
|||||||
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 <t,a> of {
|
||||||
<Fut|Cond,Simul> => <sal_V.s ! vform, vp.s.s ! VInf> ; --# notpresent
|
<Fut|Cond,Simul> => <sal_V.s ! vform, joinPrefix vp.s.hasPrefix vp.s.prefix (vp.s.s ! VInf)> ; --# notpresent
|
||||||
<Fut|Cond,Anter> => <sal_V.s ! vform, vperf ++ auxv ! VInf> ; --# notpresent
|
<Fut|Cond,Anter> => <sal_V.s ! vform, vperf ++ auxv ! VInf> ; --# notpresent
|
||||||
|
<Past, Simul> => case vp.s.hasPast of {
|
||||||
|
True => <vp.s.s ! VPast, []> ;
|
||||||
|
False => <hebben_V.s ! VPast, vperf>
|
||||||
|
} ;
|
||||||
<_, Anter> => <auxv ! vform, vperf> ; --# notpresent
|
<_, Anter> => <auxv ! vform, vperf> ; --# notpresent
|
||||||
<_, Simul> => <vp.s.s ! vform, []>
|
<_, Simul> => <vp.s.s ! vform, []>
|
||||||
} ;
|
} ;
|
||||||
fin = verb.p1 ;
|
fin = case <t,a,o,vp.s.hasPast> of {
|
||||||
|
<Pres,Simul,Sub,_> => joinPrefix vp.s.hasPrefix vp.s.prefix verb.p1 ;
|
||||||
|
<Past,Simul,Sub,True> => joinPrefix vp.s.hasPrefix vp.s.prefix verb.p1 ;
|
||||||
|
_ => verb.p1
|
||||||
|
} ;
|
||||||
neg = vp.a1 ! b ;
|
neg = vp.a1 ! b ;
|
||||||
|
tailNeg = case b of {Pos => [] ; Neg => "nie"} ;
|
||||||
obj0 = vp.n0 ! agr ;
|
obj0 = vp.n0 ! agr ;
|
||||||
obj = vp.n2 ! agr ;
|
obj = vp.n2 ! agr ;
|
||||||
compl = obj0 ++ neg ++ obj ++ vp.a2 ++ vp.s.prefix ;
|
pref = case <t,a,o,vp.s.hasPast> of {
|
||||||
|
<Pres,Simul,Main|Inv,_> => vp.s.prefix ;
|
||||||
|
<Past,Simul,Main|Inv,True> => vp.s.prefix ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
|
compl = obj0 ++ neg ++ obj ++ vp.a2 ++ pref ;
|
||||||
inf =
|
inf =
|
||||||
case <vp.isAux, vp.inf.p2, a> of { --# notpresent
|
case <vp.isAux, vp.inf.p2, a> of { --# notpresent
|
||||||
<True,True,Anter> => vp.s.s ! VInf ++ vp.inf.p1 ; --# notpresent
|
<True,True,Anter> => vp.s.s ! VInf ++ vp.inf.p1 ; --# notpresent
|
||||||
_ => --# notpresent
|
_ => case <t,vp.s.aux,vp.inf.p2,vp.isAux> of {
|
||||||
vp.inf.p1 ++ verb.p2 ++ neg
|
<Fut|Cond,VZijn,True,False> => vp.inf.p1 ++ verb.p2 ++ tailNeg ;
|
||||||
|
_ => verb.p2 ++ vp.inf.p1 ++ tailNeg
|
||||||
|
}
|
||||||
} --# notpresent
|
} --# notpresent
|
||||||
;
|
;
|
||||||
extra = vp.ext ;
|
extra = vp.ext ;
|
||||||
inffin =
|
inffin =
|
||||||
case <a,vp.isAux> of { --# notpresent
|
case <t,vp.isAux,vp.inf.p2,vp.s.hasPast> of {
|
||||||
<Anter,True> => fin ++ inf ; -- double inf --# notpresent
|
<Fut|Cond,_,_,_> => fin ++ inf ;
|
||||||
_ => --# notpresent
|
<_,True,_,_> => fin ++ inf ;
|
||||||
inf ++ fin --- or just auxiliary vp
|
<Pres,False,True,False> => fin ++ inf ;
|
||||||
} --# notpresent
|
_ => inf ++ fin
|
||||||
|
}
|
||||||
in
|
in
|
||||||
case o of {
|
case o of {
|
||||||
Main => subj ++ fin ++ compl ++ inf ++ extra ;
|
Main => subj ++ fin ++ compl ++ inf ++ extra ;
|
||||||
@@ -477,17 +518,34 @@ param
|
|||||||
VZijn => zijn_V
|
VZijn => zijn_V
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- Separable prefixes are joined to the verb in subordinate clauses and
|
||||||
|
-- infinitives. An unconditional BIND is not safe here: with an empty
|
||||||
|
-- prefix it binds the preceding constituent to the verb (e.g. *hy salgaan).
|
||||||
|
joinPrefix : Bool -> Str -> Str -> Str = \has,p,v -> case has of {
|
||||||
|
False => v ;
|
||||||
|
True => p ++ BIND ++ v
|
||||||
|
} ;
|
||||||
|
|
||||||
infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp ->
|
infVP : Bool -> VP -> ((Agr => Str) * Str * Str) = \isAux, vp ->
|
||||||
<
|
<
|
||||||
\\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2,
|
\\agr => vp.n0 ! agr ++ vp.n2 ! agr ++ vp.a2,
|
||||||
vp.a1 ! Pos ++
|
vp.a1 ! Pos ++
|
||||||
if_then_Str isAux [] "om" ++ "te" ++ vp.s.s ! VInf,
|
case isAux of {
|
||||||
|
True => joinPrefix vp.s.hasPrefix vp.s.prefix (vp.s.s ! VInf) ;
|
||||||
|
False => "om" ++ vp.s.prefix ++ "te" ++ vp.s.s ! VInf
|
||||||
|
},
|
||||||
vp.inf.p1 ++ vp.ext
|
vp.inf.p1 ++ vp.ext
|
||||||
> ;
|
> ;
|
||||||
|
|
||||||
useInfVP : Bool -> VP -> Str = \isAux,vp ->
|
useInfVP : Bool -> VP -> Str = \isAux,vp ->
|
||||||
let vpi = infVP isAux vp in
|
let a = agrP3 Sg ;
|
||||||
vpi.p1 ! agrP3 Sg ++ vpi.p3 ++ vpi.p2 ;
|
obj = vp.n0 ! a ++ vp.n2 ! a ++ vp.a2
|
||||||
|
in case isAux of {
|
||||||
|
True => obj ++ joinPrefix vp.s.hasPrefix vp.s.prefix (vp.s.s ! VInf) ++
|
||||||
|
vp.inf.p1 ++ vp.ext ;
|
||||||
|
False => "om" ++ obj ++ vp.s.prefix ++ "te" ++ vp.s.s ! VInf ++
|
||||||
|
vp.inf.p1 ++ vp.ext
|
||||||
|
} ;
|
||||||
|
|
||||||
reflPron : Agr => Str = table {
|
reflPron : Agr => Str = table {
|
||||||
{n = Sg ; p = P1} => "my" ; --afr
|
{n = Sg ; p = P1} => "my" ; --afr
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ concrete SentenceAfr of Sentence = CatAfr ** open ResAfr, Prelude in {
|
|||||||
inf = vp.inf.p1 ;
|
inf = vp.inf.p1 ;
|
||||||
in
|
in
|
||||||
verb ++ ps.p2 ++
|
verb ++ ps.p2 ++
|
||||||
vp.n2 ! agr ++ vp.a1 ! pol ++ vp.a2 ++ inf ++ vp.ext
|
vp.n2 ! agr ++ vp.a1 ! pol ++ vp.a2 ++ vp.s.prefix ++ inf ++ vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
@@ -60,18 +60,24 @@ concrete SentenceAfr of Sentence = CatAfr ** open ResAfr, Prelude in {
|
|||||||
c2 = cl.c2
|
c2 = cl.c2
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ;
|
AdvS a s = {s = \\o => a.s ++ s.s ! case o of {
|
||||||
|
Sub => Sub ;
|
||||||
|
_ => Inv
|
||||||
|
}} ;
|
||||||
|
|
||||||
ExtAdvS a s = {s = \\o => a.s ++ "," ++ s.s ! Inv} ;
|
ExtAdvS a s = {s = \\o => a.s ++ bindComma ++ s.s ! case o of {
|
||||||
|
Sub => Sub ;
|
||||||
|
_ => Inv
|
||||||
|
}} ;
|
||||||
|
|
||||||
SSubjS s1 subj s2 = {
|
SSubjS s1 subj s2 = {
|
||||||
s = \\o => s1.s ! o ++ "," ++ subj.s ++ s2.s ! Sub
|
s = \\o => s1.s ! o ++ bindComma ++ subj.s ++ s2.s ! Sub
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
AdvImp adv imp = {
|
AdvImp adv imp = {
|
||||||
s = \\p,i => adv.s ++ imp.s ! p ! i
|
s = \\p,i => adv.s ++ imp.s ! p ! i
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! Neutr ! Sg} ;
|
RelS s r = {s = \\o => s.s ! o ++ bindComma ++ r.s ! Neutr ! Sg} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ concrete StructuralAfr of Structural = CatAfr, Prelude **
|
|||||||
but_PConj = ss "maar" ;
|
but_PConj = ss "maar" ;
|
||||||
by8agent_Prep = mkPrep "deur" ;
|
by8agent_Prep = mkPrep "deur" ;
|
||||||
by8means_Prep = mkPrep "met" ;
|
by8means_Prep = mkPrep "met" ;
|
||||||
can8know_VV, can_VV = auxVV (mkV "kan" "kon") ;
|
can8know_VV, can_VV = auxVV (mkV "kan" "kon" "gekon") ;
|
||||||
during_Prep = mkPrep "tydens" ;
|
during_Prep = mkPrep "tydens" ;
|
||||||
either7or_DConj = {s1 = "òf" ; s2 = "òf" ; n = Pl} ;
|
either7or_DConj = {s1 = "òf" ; s2 = "òf" ; n = Pl} ;
|
||||||
everybody_NP = mkNP "almal" Neutr Pl ; ----
|
everybody_NP = mkNP "almal" Neutr Pl ; ----
|
||||||
every_Det = mkDet "elke" "elk" Sg ; ----
|
every_Det = mkDet "elke" "elke" Sg ;
|
||||||
everything_NP = mkNP "alles" Neutr Sg ; ----
|
everything_NP = mkNP "alles" Neutr Sg ; ----
|
||||||
everywhere_Adv = ss "oral" ;
|
everywhere_Adv = ss "oral" ;
|
||||||
few_Det = mkDet "min" "min" Pl ;
|
few_Det = mkDet "min" "min" Pl ;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ concrete VerbAfr of Verb = CatAfr ** open Prelude, ResAfr in {
|
|||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
AdvVP vp adv = insertAdv adv.s vp ;
|
AdvVP vp adv = insertAdv adv.s vp ;
|
||||||
ExtAdvVP vp adv = insertAdv ("," ++ adv.s ++ ",") vp ;
|
ExtAdvVP vp adv = insertAdv (embedInCommas adv.s) vp ;
|
||||||
AdVVP adv vp = insertAdV adv.s vp ;
|
AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
AdvVPSlash vp adv = vp ** {a2 = vp.a2 ++ adv.s} ;
|
AdvVPSlash vp adv = vp ** {a2 = vp.a2 ++ adv.s} ;
|
||||||
@@ -93,6 +93,7 @@ concrete VerbAfr of Verb = CatAfr ** open Prelude, ResAfr in {
|
|||||||
---- workaround for a subtyping bug
|
---- workaround for a subtyping bug
|
||||||
oper
|
oper
|
||||||
v2v : VVerb -> VVerb = \v ->
|
v2v : VVerb -> VVerb = \v ->
|
||||||
{s = v.s ; aux = v.aux ; prefix = v.prefix ; vtype = v.vtype} ;
|
{s = v.s ; aux = v.aux ; prefix = v.prefix ; hasPrefix = v.hasPrefix ;
|
||||||
|
hasPast = v.hasPast ; vtype = v.vtype} ;
|
||||||
predVv : VVerb -> ResAfr.VP = \v -> predV (v2v v) ;
|
predVv : VVerb -> ResAfr.VP = \v -> predV (v2v v) ;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-405
@@ -14,422 +14,19 @@ concrete ExtendDan of Extend = CatDan **
|
|||||||
RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP,
|
RNP, RNPList, ReflRNP, ReflPron, ReflPoss, PredetRNP, ConjRNP,
|
||||||
Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ReflPossPron,
|
Base_rr_RNP, Base_nr_RNP, Base_rn_RNP, Cons_rr_RNP, Cons_nr_RNP, ReflPossPron,
|
||||||
CompoundN, CompoundAP, AdvIsNP,
|
CompoundN, CompoundAP, AdvIsNP,
|
||||||
UttAccNP,
|
|
||||||
A2VPSlash, N2VPSlash,
|
A2VPSlash, N2VPSlash,
|
||||||
CardCNCard,
|
CardCNCard,
|
||||||
GenRP
|
GenRP
|
||||||
]
|
]
|
||||||
with (Grammar = GrammarDan)
|
with (Grammar = GrammarDan)
|
||||||
**
|
** open Prelude in {
|
||||||
open CommonScand, ResDan, ParamX, VerbDan, Prelude, DiffDan, StructuralDan, MorphoDan,
|
|
||||||
NounDan, Coordination, AdjectiveDan, SentenceDan, AdverbDan, RelativeDan, (P = ParadigmsDan),
|
|
||||||
(M = MakeStructuralDan)
|
|
||||||
in {
|
|
||||||
|
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
|
|
||||||
lin
|
lin CompoundN n1 n2 = {
|
||||||
GenNP np = {
|
|
||||||
s,sp = \\n,_,_,g => np.s ! NPPoss (gennum (ngen2gen g) n) Nom ;
|
|
||||||
det = DDef Indef
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
|
|
||||||
|
|
||||||
ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ;
|
|
||||||
|
|
||||||
CompBareCN cn = {s = \\a => case a.n of {
|
|
||||||
Sg => cn.s ! Sg ! DIndef ! Nom ;
|
|
||||||
Pl => cn.s ! Pl ! DIndef ! Nom
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
StrandRelSlash rp slash = {
|
|
||||||
s = \\t,a,p,ag,_ =>
|
|
||||||
rp.s ! ag.g ! ag.n ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ;
|
|
||||||
c = NPAcc
|
|
||||||
} ;
|
|
||||||
EmptyRelSlash slash = {
|
|
||||||
s = \\t,a,p,ag,_ =>
|
|
||||||
slash.s ! t ! a ! p ! Sub ++ slash.n3 ! ag ++ slash.c2.s ;
|
|
||||||
c = NPAcc
|
|
||||||
} ;
|
|
||||||
|
|
||||||
StrandQuestSlash ip slash = {
|
|
||||||
s = \\t,a,p =>
|
|
||||||
let
|
|
||||||
cls = slash.s ! t ! a ! p ;
|
|
||||||
who = ip.s ! accusative ;
|
|
||||||
agr = agrP3 ip.g ip.n ;
|
|
||||||
in table {
|
|
||||||
QDir => who ++ cls ! Inv ++ slash.n3 ! agr ++ slash.c2.s ;
|
|
||||||
QIndir => who ++ cls ! Sub ++ slash.n3 ! agr ++ slash.c2.s
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
PassVPSlash vps =
|
|
||||||
insertObj (\\a => vps.c2.s ++ vps.n3 ! a) (passiveVP vps) ;
|
|
||||||
PassAgentVPSlash vps np =
|
|
||||||
insertObjPost (\\a => vps.c2.s ++ vps.n3 ! a) (insertObj (\\_ => (PrepNP by8agent_Prep np).s) (passiveVP vps)) ;
|
|
||||||
ProgrVPSlash vp =
|
|
||||||
insertObj (\\a => "ved å" ++ infVP vp a) (predV verbBe) **
|
|
||||||
{ n3 = vp.n3 ;
|
|
||||||
c2 = vp.c2
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
N2VPSlash n2 =
|
|
||||||
let vp : CatDan.VP = UseComp (CompCN (UseN2 n2)) ;
|
|
||||||
dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ;
|
|
||||||
in dummyVPS ** -- has necessary fields for VPSlash
|
|
||||||
vp ** -- has all the right fields except for c2
|
|
||||||
{c2 = n2.c2} ; -- has the right c2
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
A2VPSlash a2 =
|
|
||||||
let vp : CatDan.VP = UseComp (CompAP (UseA2 a2)) ;
|
|
||||||
dummyVPS : VPSlash = SlashV2a (P.mkV2 "dummy") ;
|
|
||||||
in dummyVPS ** -- has necessary fields for VPSlash
|
|
||||||
vp ** -- has all the right fields except for c2
|
|
||||||
{c2 = a2.c2} ; -- has the right c2
|
|
||||||
|
|
||||||
|
|
||||||
lin UttVPShort vp = {s = infVP vp (agrP3 Utr Sg)} ;
|
|
||||||
|
|
||||||
lincat
|
|
||||||
VPI = {s : VPIForm => Agr => Str} ;
|
|
||||||
[VPI] = {s1,s2 : VPIForm => Agr => Str} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
BaseVPI = twoTable2 VPIForm Agr ;
|
|
||||||
ConsVPI = consrTable2 VPIForm Agr comma ;
|
|
||||||
|
|
||||||
MkVPI vp = {
|
|
||||||
s = \\v,a => infVP vp a ---- no sup
|
|
||||||
} ;
|
|
||||||
ConjVPI = conjunctDistrTable2 VPIForm Agr ;
|
|
||||||
ComplVPIVV vv vpi = insertObj (\\a => vv.c2.s ++ vpi.s ! VPIInf ! a) (predV vv) ;
|
|
||||||
|
|
||||||
lincat
|
|
||||||
VPS = {s : Order => Agr => {verb, compl : Str}} ;
|
|
||||||
[VPS] = {s : Order => Agr => {s1, s2, s3 : Str}} ; -- älskar, (jag) dig, (och) är lycklig
|
|
||||||
|
|
||||||
lin
|
|
||||||
BaseVPS v w = {
|
|
||||||
s = \\ord, agr =>
|
|
||||||
let
|
|
||||||
vs = v.s ! ord ! agr ;
|
|
||||||
ws = w.s ! ord ! agr ;
|
|
||||||
in {
|
|
||||||
s1 = vs.verb ;
|
|
||||||
s2 = vs.compl ;
|
|
||||||
s3 = ws.verb ++ ws.compl
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ConsVPS v vv = {
|
|
||||||
s = \\ord, agr =>
|
|
||||||
let
|
|
||||||
vs = v.s ! ord ! agr ;
|
|
||||||
vvs = vv.s ! ord ! agr ;
|
|
||||||
in {
|
|
||||||
s1 = vs.verb ;
|
|
||||||
s2 = vs.compl ++ comma ++ vvs.s1 ++ vvs.s2 ;
|
|
||||||
s3 = vvs.s3
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ConjVPS conj vv = {
|
|
||||||
s = \\ord, agr =>
|
|
||||||
let
|
|
||||||
vvs = vv.s ! ord ! agr
|
|
||||||
in {
|
|
||||||
verb = vvs.s1 ;
|
|
||||||
compl = conj.s1 ++ vvs.s2 ++ conj.s2 ++ vvs.s3
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
PredVPS np vps =
|
|
||||||
let
|
|
||||||
subj = np.s ! nominative ;
|
|
||||||
agr = np.a ;
|
|
||||||
in {
|
|
||||||
s = \\o =>
|
|
||||||
let verb = vps.s ! o ! agr
|
|
||||||
in case o of {
|
|
||||||
Main => subj ++ verb.verb ++ verb.compl ;
|
|
||||||
Inv => verb.verb ++ subj ++ verb.compl ; -- älskar jag henne och sover
|
|
||||||
Sub => subj ++ verb.verb ++ verb.compl --- not quite correct in ConjVPS
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
RelVPS rp vps = {
|
|
||||||
s = \\ag,rcase =>
|
|
||||||
let agr = case rp.a of { -- RP's agr may override in the regular RelativeScand, is this true with VPS too?
|
|
||||||
RNoAg => ag ;
|
|
||||||
RAg g n p => {g = g ; n = n ; p = p}
|
|
||||||
} ;
|
|
||||||
verb = vps.s ! Sub ! agr
|
|
||||||
in
|
|
||||||
rp.s ! ag.g ! ag.n ! rcase ++ verb.verb ++ verb.compl ;
|
|
||||||
c = NPNom
|
|
||||||
} ;
|
|
||||||
|
|
||||||
MkVPS t p vp = {
|
|
||||||
s = \\o,a =>
|
|
||||||
let
|
|
||||||
verb = vp.s ! Act ! VPFinite t.t t.a ;
|
|
||||||
neg = verb.a1 ! p.p ! a ;
|
|
||||||
compl = vp.n2 ! a ++ vp.a2 ++ vp.ext ;
|
|
||||||
pron = vp.n1 ! a ;
|
|
||||||
verbf = t.s ++ p.s ++ verb.fin
|
|
||||||
in
|
|
||||||
case o of {
|
|
||||||
Main => {verb = verbf ; compl = neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl} ;
|
|
||||||
Inv => {verb = verbf ; compl = neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl} ;
|
|
||||||
Sub => {verb = neg.p1 ++ neg.p2 ++ verbf ; compl = verb.inf ++ pron ++ compl}
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lincat
|
|
||||||
VPS2 = {s : Order => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
|
|
||||||
[VPS2] = {s1,s2 : Order => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
BaseVPS2 x y = twoTable2 Order Agr x y ** {c2 = y.c2} ;
|
|
||||||
ConsVPS2 x xs = consrTable2 Order Agr comma x xs ** {c2 = xs.c2};
|
|
||||||
|
|
||||||
|
|
||||||
MkVPS2 t p vp = {
|
|
||||||
s = \\o,a =>
|
|
||||||
let
|
|
||||||
verb = vp.s ! Act ! VPFinite t.t t.a ;
|
|
||||||
neg = verb.a1 ! p.p ! a ;
|
|
||||||
compl = vp.n2 ! a ++ vp.a2 ++ vp.ext ;
|
|
||||||
pron = vp.n1 ! a
|
|
||||||
in t.s ++ p.s ++ case o of {
|
|
||||||
Main => verb.fin ++ neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl ;
|
|
||||||
Inv => verb.fin ++ neg.p1 ++ verb.inf ++ pron ++ neg.p2 ++ compl ; ----
|
|
||||||
Sub => neg.p1 ++ neg.p2 ++ verb.fin ++ verb.inf ++ pron ++ compl
|
|
||||||
} ;
|
|
||||||
c2 = vp.c2
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ComplVPS2 vps2 np = {
|
|
||||||
s = \\o,a => {verb = vps2.s !o ! a ; compl = vps2.c2.s ++ np.s ! NPAcc}
|
|
||||||
} ;
|
|
||||||
ReflVPS2 vps2 rnp = {
|
|
||||||
s = \\o,a => {verb = vps2.s ! o ! a ; compl = vps2.c2.s ++ rnp.s ! a}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ConjVPS2 c xs = conjunctDistrTable2 Order Agr c xs ** {c2 = xs.c2} ;
|
|
||||||
|
|
||||||
lincat
|
|
||||||
VPI2 = {s : VPIForm => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
|
|
||||||
[VPI2] = {s1,s2 : VPIForm => Agr => Str ; c2 : {s : Str; hasPrep : Prelude.Bool}} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
BaseVPI2 x y = twoTable2 VPIForm Agr x y ** {c2 = y.c2} ;
|
|
||||||
ConsVPI2 x xs = consrTable2 VPIForm Agr comma x xs ** {c2 = xs.c2} ;
|
|
||||||
|
|
||||||
MkVPI2 vp = {
|
|
||||||
s = \\v,a => infVP vp a ; ---- no sup
|
|
||||||
c2 = vp.c2
|
|
||||||
} ;
|
|
||||||
ConjVPI2 c xs = conjunctDistrTable2 VPIForm Agr c xs ** {c2 = xs.c2} ;
|
|
||||||
|
|
||||||
ComplVPI2 vpi2 np = {
|
|
||||||
s = \\t,a => vpi2.s ! t ! a ++ vpi2.c2.s ++ np.s ! NPAcc
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lincat [Comp] = {s1,s2 : Agr => Str} ;
|
|
||||||
lin BaseComp x y = twoTable Agr x y ;
|
|
||||||
ConsComp xs x = consrTable Agr comma xs x ;
|
|
||||||
ConjComp conj ss = conjunctDistrTable Agr conj ss ;
|
|
||||||
|
|
||||||
lincat ListImp = {s1,s2 : Polarity => Number => Str} ;
|
|
||||||
lin BaseImp = twoTable2 Polarity Number ;
|
|
||||||
ConsImp = consrTable2 Polarity Number comma ;
|
|
||||||
ConjImp conj ss = conjunctDistrTable2 Polarity Number conj ss ;
|
|
||||||
|
|
||||||
-----------
|
|
||||||
|
|
||||||
ICompAP ap = {s = \\a => hur_IAdv.s ++ ap.s ! a} ;
|
|
||||||
|
|
||||||
ProDrop pro = pro ** {s = \\_ => []} ;
|
|
||||||
|
|
||||||
lincat
|
|
||||||
RNP = {s : Agr => Str ; isPron : Bool} ; ---- inherent Agr needed: han färgar sitt hår vitt. But also depends on subject
|
|
||||||
RNPList = {s1,s2 : Agr => Str} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
ReflRNP vps rnp =
|
|
||||||
insertObjPost (\\a => vps.n3 ! a)
|
|
||||||
(insertObjPron (andB rnp.isPron (notB vps.c2.hasPrep)) (\\a => vps.c2.s ++ rnp.s ! a)
|
|
||||||
vps) ;
|
|
||||||
|
|
||||||
ReflPron = {s = \\a => reflPron a ; isPron = True} ; ---- agr ??
|
|
||||||
ReflPoss num cn = {
|
|
||||||
s = \\a => possPron a.n a.p num.n (ngen2gen cn.g) ++ num.s ! cn.g ++ cn.s ! num.n ! DDef Indef ! Nom ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
PredetRNP predet rnp = {
|
|
||||||
s = \\a => predet.s ! Utr ! Pl ++ predet.p ++ rnp.s ! a ; ---- agr needed here as well
|
|
||||||
---- s = \\a => predet.s ! np.a.g ! np.a.n ++ predet.p ++ np.s ! a ;
|
|
||||||
---- a = case pred.a of {PAg n => agrP3 np.a.g n ; _ => np.a} ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
AdvRNP np prep rnp = {s = \\a => np.s ! NPAcc ++ prep.s ++ rnp.s ! a; isPron = False} ;
|
|
||||||
AdvRVP vp prep rnp = insertObjPost (\\a => prep.s ++ rnp.s ! a) vp ;
|
|
||||||
AdvRAP ap prep rnp = {
|
|
||||||
s = \\a => let agr = case a of {
|
|
||||||
Strong (GSg g) => agrP3 g Sg ;
|
|
||||||
Strong GPl => agrP3 Utr Pl ;
|
|
||||||
Weak n => agrP3 Utr n
|
|
||||||
}
|
|
||||||
in ap.s ! a ++ prep.s ++ rnp.s ! agr ;
|
|
||||||
isPre = ap.isPre
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ReflA2RNP a rnp = {
|
|
||||||
s = \\ap => let agr = case ap of {
|
|
||||||
Strong (GSg g) => agrP3 g Sg ;
|
|
||||||
Strong GPl => agrP3 Utr Pl ;
|
|
||||||
Weak n => agrP3 Utr n
|
|
||||||
}
|
|
||||||
in a.s ! AF (APosit ap) Nom ++ a.c2.s ++ rnp.s ! agr ;
|
|
||||||
isPre = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
PossPronRNP pron num cn rnp = DetCN (DetQuant (PossPron pron) num) (PossNP cn (lin NP {s = \\_ => rnp.s ! pron.a; a = pron.a; isPron=False})) ;
|
|
||||||
|
|
||||||
ConjRNP conj rpns = conjunctDistrTable Agr conj rpns ** {isPron = False} ;
|
|
||||||
|
|
||||||
Base_rr_RNP x y = twoTable Agr x y ;
|
|
||||||
Base_nr_RNP x y = twoTable Agr {s = \\a => x.s ! NPAcc} y ;
|
|
||||||
Base_rn_RNP x y = twoTable Agr x {s = \\a => y.s ! NPAcc} ;
|
|
||||||
Cons_rr_RNP x xs = consrTable Agr comma x xs ;
|
|
||||||
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
|
|
||||||
|
|
||||||
ReflPossPron = M.mkQuant "sin" "sit" "sine" ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
ApposNP np1 np2 = {s = \\nform => np1.s ! nform ++ comma ++ np2.s ! nform; a = np1.a; isPron = False} ;
|
|
||||||
|
|
||||||
DetNPMasc, DetNPFem = \det ->
|
|
||||||
let
|
|
||||||
g = utrum ; ----
|
|
||||||
m = True ; ---- is this needed for other than Art?
|
|
||||||
in {
|
|
||||||
s = \\c => det.sp ! m ! g ; ---- case of det!
|
|
||||||
a = agrP3 (ngen2gen g) det.n ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
CompoundN n1 n2 = {
|
|
||||||
s = \\n,s,c => n1.co ++ BIND ++ n2.s ! n ! s ! c ;
|
s = \\n,s,c => n1.co ++ BIND ++ n2.s ! n ! s ! c ;
|
||||||
co = n1.co ++ BIND ++ n2.co ;
|
co = n1.co ++ BIND ++ n2.co ;
|
||||||
g = n2.g
|
g = n2.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
CompoundAP noun adj = {
|
|
||||||
s = \\ap => noun.co ++ BIND ++ adj.s ! AF (APosit ap) Nom ;
|
|
||||||
isPre = True
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin
|
|
||||||
AdAdV = cc2 ;
|
|
||||||
|
|
||||||
PositAdVAdj a = {s = a.s ! AAdv} ;
|
|
||||||
|
|
||||||
PresPartAP vp = {
|
|
||||||
s = \\af => case vp.isSimple of {
|
|
||||||
True => partVPPlus vp (PartPres Sg Indef Nom) (aformpos2agr af) Pos ;
|
|
||||||
False => partVPPlusPost vp (PartPres Sg Indef Nom) (aformpos2agr af) Pos
|
|
||||||
} ;
|
|
||||||
isPre = vp.isSimple
|
|
||||||
} ;
|
|
||||||
|
|
||||||
PastPartAP vp = {
|
|
||||||
s = \\af => let vp' = vp**{n2 : Agr => Str =\\a => vp.n2 ! a ++ vp.n3 ! a}
|
|
||||||
in case vp.isSimple of {
|
|
||||||
True => partVPPlus vp' (PartPret af Nom) (aformpos2agr af) Pos ;
|
|
||||||
False => partVPPlusPost vp' (PartPret af Nom) (aformpos2agr af) Pos
|
|
||||||
} ;
|
|
||||||
isPre = vp.isSimple
|
|
||||||
} ;
|
|
||||||
|
|
||||||
PastPartAgentAP vp np = {
|
|
||||||
s = \\af => let vp' = vp**{n2 : Agr => Str =\\a => vp.n2 ! a ++ vp.n3 ! a}
|
|
||||||
in partVPPlusPost vp' (PartPret af Nom) (aformpos2agr af) Pos ++ "af" ++ np.s ! accusative ;
|
|
||||||
isPre = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundCN vp = { -- infinitive: att dricka öl, att vara glad
|
|
||||||
s = \\_,_,_ => "at" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ;
|
|
||||||
g = Neutr ;
|
|
||||||
isMod = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundNP vp = { -- infinitive: att dricka öl, att vara glad
|
|
||||||
s = \\_ => "at" ++ infVP vp {g = Utr ; n = Sg ; p = P3} ;
|
|
||||||
a = {g = Neutr ; n = Sg ; p = P3} ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
GerundAdv vp = {
|
|
||||||
s = partVPPlusPost vp (PartPres Sg Indef (Nom|Gen)) {g = Utr ; n = Sg ; p = P3} Pos -- sovande(s) i sängen
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ByVP vp = { -- infinitive: att dricka öl, att vara glad
|
|
||||||
s = "ved at" ++ infVP vp {g = Utr ; n = Sg ; p = P3}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
InOrderToVP vp = { -- infinitive: att dricka öl, att vara glad
|
|
||||||
s = "for at" ++ infVP vp {g = Utr ; n = Sg ; p = P3}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
AdvIsNP adv np = PredVP {s = \\_ => adv.s ; a = np.a ; isPron = False} (UseComp (CompNP np)) ;
|
|
||||||
|
|
||||||
EmbedSSlash ss = {s = "det" ++ ss.s ! Main ++ ss.c2.s ++ ss.n3 ! agrUSgP3} ;
|
|
||||||
|
|
||||||
UttAccNP np = {s = np.s ! NPAcc} ;
|
|
||||||
|
|
||||||
lin UseDAP dap =
|
|
||||||
let
|
|
||||||
g = neutrum ; ----
|
|
||||||
m = True ; ---- is this needed for other than Art?
|
|
||||||
in {
|
|
||||||
s = table {
|
|
||||||
NPPoss _ _ => dap.sp ! m ! g ++ BIND ++ "s" ;
|
|
||||||
_ => dap.sp ! m ! g
|
|
||||||
} ;
|
|
||||||
a = agrP3 (ngen2gen g) dap.n ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin UseDAPMasc, UseDAPFem = \dap ->
|
|
||||||
let
|
|
||||||
g = utrum ; ----
|
|
||||||
m = True ; ---- is this needed for other than Art?
|
|
||||||
in {
|
|
||||||
s = table {
|
|
||||||
NPPoss _ _ => dap.sp ! m ! g ++ BIND ++ "s" ;
|
|
||||||
_ => dap.sp ! m ! g
|
|
||||||
} ;
|
|
||||||
a = agrP3 (ngen2gen g) dap.n ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin CardCNCard card cn =
|
|
||||||
{s = \\g => card.s ! cn.g ++ cn.s ! card.n ! DIndef ! Nom ; n = Pl} ;
|
|
||||||
|
|
||||||
GenRP num cn = {
|
|
||||||
s = \\g_,n,c => "hvis" ++ cn.s ! num.n ! DDef Indef ! Nom ; --- c ?
|
|
||||||
a = RAg cn.g num.n P3
|
|
||||||
} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-32
@@ -30,41 +30,10 @@ concrete IdiomDan of Idiom = CatDan **
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ExistNPAdv np adv =
|
|
||||||
mkClause "det" (agrP3 MorphoDan.neutrum Sg) (insertObj
|
|
||||||
(\\_ => np.s ! accusative ++ adv.s) (predV (depV finde_V))) ;
|
|
||||||
|
|
||||||
ExistIPAdv ip adv = {
|
|
||||||
s = \\t,a,p =>
|
|
||||||
let cls = (mkClause "det" (agrP3 MorphoDan.neutrum Sg)
|
|
||||||
(insertAdv adv.s (predV (depV finde_V)))).s ! t ! a ! p ;
|
|
||||||
who = ip.s ! accusative
|
|
||||||
in table {
|
|
||||||
QDir => who ++ cls ! Inv ;
|
|
||||||
QIndir => who ++ cls ! Sub
|
|
||||||
}
|
|
||||||
} ;
|
|
||||||
|
|
||||||
ProgrVP vp =
|
ProgrVP vp =
|
||||||
insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ;
|
insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ;
|
||||||
|
|
||||||
ImpPl1 vp = {s = ["lad os"] ++ infVP vp {g = Utr ; n = Pl ; p = P1}} ;
|
ImpPl1 vp = {s = ["lad os"] ++ infVP vp {g = Utr ; n = Pl ; p = P1}} ;
|
||||||
|
|
||||||
ImpP3 np vp = {s = "lad" ++ np.s ! accusative ++ infVP vp np.a} ;
|
|
||||||
|
|
||||||
SelfAdvVP vp = insertObj (\\a => selv a.g a.n) vp ;
|
|
||||||
SelfAdVVP vp = insertAdVAgr (\\a => selv a.g a.n) vp ;
|
|
||||||
SelfNP np = {
|
|
||||||
s = \\c => np.s ! c ++ selv np.a.g np.a.n ;
|
|
||||||
a = np.a ;
|
|
||||||
isPron = False
|
|
||||||
} ;
|
|
||||||
|
|
||||||
oper
|
|
||||||
selv : Gender -> Number -> Str = \g,n -> case <g,n> of {
|
|
||||||
<Utr,Sg> => "selv" ;
|
|
||||||
<Neutr,Sg> => "selv" ;
|
|
||||||
_ => "selv"
|
|
||||||
} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,36 +38,16 @@ lin n9 = mkTal "ni" "nitten" "halvfems" "niende" "halvfemsindstyvende" ;
|
|||||||
pot1plus d e = {
|
pot1plus d e = {
|
||||||
s = \\g => e.s ! ental ! invNum ++ "og" ++ d.s ! tiotal ! g ; n = Pl} ;
|
s = \\g => e.s ! ental ! invNum ++ "og" ++ d.s ! tiotal ! g ; n = Pl} ;
|
||||||
pot1as2 n = n ;
|
pot1as2 n = n ;
|
||||||
pot21 = numPl (cardOrd "hundrede" "hundredende") ;
|
|
||||||
pot2 d = numPl (\\_ => d.s ! ental ! invNum ++ "hundrede") ;
|
pot2 d = numPl (\\_ => d.s ! ental ! invNum ++ "hundrede") ;
|
||||||
pot2plus d e =
|
pot2plus d e =
|
||||||
{s = \\g => d.s ! ental ! invNum ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ;
|
{s = \\g => d.s ! ental ! invNum ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ;
|
||||||
pot2as3 n = n ;
|
pot2as3 n = n ;
|
||||||
pot31 = numPl (cardOrd "tusind" "tusinde") ;
|
|
||||||
pot3 n = numPl (\\g => n.s ! invNum ++ cardOrd "tusind" "tusinde" ! g) ;
|
pot3 n = numPl (\\g => n.s ! invNum ++ cardOrd "tusind" "tusinde" ! g) ;
|
||||||
pot3plus n m = {s = \\g => n.s ! invNum ++ "tusind" ++ "og" ++ m.s ! g ; n =Pl} ;
|
pot3plus n m = {s = \\g => n.s ! invNum ++ "tusind" ++ "og" ++ m.s ! g ; n =Pl} ;
|
||||||
|
|
||||||
pot3as4 n = n ;
|
pot3as4 n = n ;
|
||||||
|
|
||||||
pot41 = numPl (cardOrd "en million" "millionte") ;
|
|
||||||
pot4 n = numPl (\\g => n.s ! NCard Utr ++
|
|
||||||
cardOrd (case n.n of {Sg => "million" ; Pl => "millioner"}) "millionte" ! g) ;
|
|
||||||
pot4plus n m = {
|
|
||||||
s = \\g => n.s ! NCard Utr ++ case n.n of {Sg => "million" ; Pl => "millioner"} ++ m.s ! g ;
|
|
||||||
n = Pl
|
|
||||||
} ;
|
|
||||||
pot4decimal d = numPl (\\g => d.s ! NCard Utr ++ cardOrd "millioner" "millionte" ! g) ;
|
|
||||||
pot4as5 n = n ;
|
pot4as5 n = n ;
|
||||||
|
|
||||||
pot51 = numPl (cardOrd "en milliard" "milliardte") ;
|
|
||||||
pot5 n = numPl (\\g => n.s ! NCard Utr ++
|
|
||||||
cardOrd (case n.n of {Sg => "milliard" ; Pl => "milliarder"}) "milliardte" ! g) ;
|
|
||||||
pot5plus n m = {
|
|
||||||
s = \\g => n.s ! NCard Utr ++ case n.n of {Sg => "milliard" ; Pl => "milliarder"} ++ m.s ! g ;
|
|
||||||
n = Pl
|
|
||||||
} ;
|
|
||||||
pot5decimal d = numPl (\\g => d.s ! NCard Utr ++ cardOrd "milliarder" "milliardte" ! g) ;
|
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Dig = TDigit ;
|
Dig = TDigit ;
|
||||||
|
|
||||||
|
|||||||
@@ -63,11 +63,6 @@ oper
|
|||||||
mkPrep : Str -> Prep ; -- e.g. "til"
|
mkPrep : Str -> Prep ; -- e.g. "til"
|
||||||
noPrep : Prep ; -- empty string
|
noPrep : Prep ; -- empty string
|
||||||
|
|
||||||
-- Subjunctions and phrase conjunctions are not inflected.
|
|
||||||
|
|
||||||
mkSubj : Str -> Subj ;
|
|
||||||
mkPConj : Str -> PConj ;
|
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
mkN : overload {
|
mkN : overload {
|
||||||
@@ -561,18 +556,6 @@ oper
|
|||||||
mkInterj : Str -> Interj
|
mkInterj : Str -> Interj
|
||||||
= \s -> lin Interj {s = s} ;
|
= \s -> lin Interj {s = s} ;
|
||||||
|
|
||||||
mkSubj : Str -> Subj = \s -> lin Subj {s = s} ;
|
|
||||||
mkPConj : Str -> PConj = \s -> lin PConj {s = s} ;
|
|
||||||
mkIAdv : Str -> IAdv = \s -> lin IAdv {s = s} ;
|
|
||||||
mkCAdv : Str -> Str -> CAdv = \s,p -> lin CAdv {s=s; p=p} ;
|
|
||||||
|
|
||||||
mkCard : Str -> Card = \x -> lin Card {s=\\g => x; n=Pl} ;
|
|
||||||
mkACard : Str -> ACard = \s -> lin ACard {s=s; n=Pl} ;
|
|
||||||
mkDet : Str -> Det = \x -> lin Det {s,sp=\\b,g => x; n=Pl; det=DIndef} ;
|
|
||||||
mkIDet : Str -> IDet = \x -> lin IDet {s=\\g => x; n=Pl; det=DIndef} ;
|
|
||||||
mkQuant : Str -> Quant = \x -> lin Quant {s,sp=\\n,b,d,g => x; det=DIndef} ;
|
|
||||||
mkPredet : Str -> Predet = \x -> lin Predet {s=\\g,n => x; p=[]; a=PNoAg} ;
|
|
||||||
|
|
||||||
mkMU : Str -> MU = \s -> lin MU {s=s; isPre=False} ;
|
mkMU : Str -> MU = \s -> lin MU {s=s; isPre=False} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user