forked from GitHub/gf-core
most Cl rules ok
This commit is contained in:
@@ -48,7 +48,7 @@ lincat
|
|||||||
V = Verb ;
|
V = Verb ;
|
||||||
-- = {s : VForm => Str}
|
-- = {s : VForm => Str}
|
||||||
---- VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
---- VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
||||||
---- VPI = {s : VIForm => Agr => Str ; s1 : Str} ; -- s1 is "not" or []
|
VPI = {s : VIForm => Str} ;
|
||||||
----- VP = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
----- VP = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
||||||
---- VG = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
---- VG = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
||||||
V2 = TransVerb ;
|
V2 = TransVerb ;
|
||||||
@@ -57,12 +57,12 @@ lincat
|
|||||||
VS = Verb ;
|
VS = Verb ;
|
||||||
VV = Verb ** {c : ComplCase} ;
|
VV = Verb ** {c : ComplCase} ;
|
||||||
VQ = Verb ;
|
VQ = Verb ;
|
||||||
VA = Verb ** {c : ComplCase} ;
|
VA = Verb ** {c : Case} ;
|
||||||
|
|
||||||
V2S = TransVerb ;
|
V2S = TransVerb ;
|
||||||
V2Q = TransVerb ;
|
V2Q = TransVerb ;
|
||||||
V2V = TransVerb ; ----
|
V2V = TransVerb ; ----
|
||||||
V2A = TransVerb ; ----
|
V2A = TransVerb ** {c2 : Case} ;
|
||||||
V0 = Verb ;
|
V0 = Verb ;
|
||||||
|
|
||||||
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
||||||
@@ -77,7 +77,7 @@ lincat
|
|||||||
|
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
Cl = Clause ;
|
Cl = Clause ;
|
||||||
-- = {s : SType => Bool => SForm => Str} ;
|
-- = {s : Bool => SForm => Str} ;
|
||||||
|
|
||||||
Slash = Sentence ** {s2 : Str ; c : Case} ;
|
Slash = Sentence ** {s2 : Str ; c : Case} ;
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ lincat
|
|||||||
IP = {s : NPForm => Str ; n : Number} ;
|
IP = {s : NPForm => Str ; n : Number} ;
|
||||||
IDet = {s : Gender => Case => Str ; n : Number} ;
|
IDet = {s : Gender => Case => Str ; n : Number} ;
|
||||||
IAdv = {s : Str} ;
|
IAdv = {s : Str} ;
|
||||||
---- QCl = {s : Bool => SForm => QuestForm => Str} ;
|
QCl = {s : Bool => SForm => Str} ;
|
||||||
QS = {s : Str} ;
|
QS = {s : Str} ;
|
||||||
Imp = {s : Number => Str} ;
|
Imp = {s : Number => Str} ;
|
||||||
Phr = {s : Str} ;
|
Phr = {s : Str} ;
|
||||||
|
|||||||
@@ -12,76 +12,74 @@ concrete ClauseFin of Clause = CategoriesFin **
|
|||||||
---- sats2clause (mkSatsCopula subj (v.s ! VPart (pgen2gen subj.g) subj.n)) ;
|
---- sats2clause (mkSatsCopula subj (v.s ! VPart (pgen2gen subj.g) subj.n)) ;
|
||||||
SPredV2 np v y =
|
SPredV2 np v y =
|
||||||
sats2clause (mkSatsObject np v y) ;
|
sats2clause (mkSatsObject np v y) ;
|
||||||
{-
|
|
||||||
SPredV3 subj verb obj1 obj2 =
|
SPredV3 subj verb obj1 obj2 =
|
||||||
sats2clause (insertObject (mkSatsObject subj verb obj1) verb.c3 verb.s3 obj2) ;
|
|
||||||
SPredReflV2 subj verb =
|
|
||||||
sats2clause (
|
sats2clause (
|
||||||
mkSatsObject subj
|
insertObject (mkSatsObject subj verb obj1) verb.c2 verb.s5 verb.s6 obj2) ;
|
||||||
{s = verb.s ; s2 = [] ; c = accusative ; aux = AEsse}
|
---- SPredReflV2 subj verb =
|
||||||
---- {s = verb.s ; s2 = verb.s2 ; c = verb.c ; aux = AEsse}
|
---- sats2clause (
|
||||||
---- this produces huge cf - find out why! AR 16/3/2005
|
---- mkSatsObject subj
|
||||||
(reflPronNounPhrase (pgen2gen subj.g) subj.n subj.p)) ;
|
---- {s = verb.s ; s2 = [] ; c = accusative ; aux = AEsse}
|
||||||
|
---- (reflPronNounPhrase (pgen2gen subj.g) subj.n subj.p)) ;
|
||||||
SPredVS subj verb sent =
|
SPredVS subj verb sent =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos (mkSats subj verb)
|
insertComplement (mkSats subj verb) sent.s) ;
|
||||||
(\\b => embedConj ++ sent.s ! subordMode verb b)) ; ---- mn
|
|
||||||
SPredVQ subj verb quest =
|
SPredVQ subj verb quest =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos (mkSats subj verb) (\\_ => quest.s ! IndirQ)) ;
|
insertComplement (mkSats subj verb) quest.s) ;
|
||||||
SPredV2S subj verb obj sent =
|
SPredV2S subj verb obj sent =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(\\b => embedConj ++ sent.s ! subordMode verb b)
|
sent.s
|
||||||
) ; ---- mn ;
|
) ;
|
||||||
SPredV2Q subj verb obj quest =
|
SPredV2Q subj verb obj quest =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(\\_ => quest.s ! IndirQ)) ;
|
quest.s
|
||||||
|
) ;
|
||||||
SPredVA subj verb adj =
|
SPredVA subj verb adj =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos (mkSats subj verb) (\\_ => adj.s ! AF (pgen2gen subj.g) subj.n)) ;
|
insertComplement (mkSats subj verb) (adj.s ! APred ! AN (NCase subj.n verb.c))) ;
|
||||||
SPredV2A subj verb obj adj =
|
SPredV2A subj verb obj adj =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(\\_ => adj.s ! AF (pgen2gen obj.g) obj.n)) ;
|
(adj.s ! APred ! AN (NCase subj.n verb.c2))
|
||||||
|
) ;
|
||||||
SPredVV subj verb vp =
|
SPredVV subj verb vp =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos
|
insertComplement
|
||||||
(mkSats subj verb)
|
(mkSats subj verb)
|
||||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen subj.g ! subj.n ! subj.p)
|
(vp.s ! VIInfinit)
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
SPredObjV2V subj verb obj vp =
|
SPredObjV2V subj verb obj vp =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen obj.g ! obj.n ! obj.p)
|
(vp.s ! VIInfinit)
|
||||||
) ;
|
) ;
|
||||||
SPredSubjV2V subj verb obj vp =
|
SPredSubjV2V subj verb obj vp =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
insertExtrapos
|
insertComplement
|
||||||
(mkSatsObject subj verb obj)
|
(mkSatsObject subj verb obj)
|
||||||
(\\_ => prepCase verb.c ++ vp.s ! VIInfinit ! pgen2gen subj.g ! subj.n ! subj.p)
|
(vp.s ! VIInfinit)
|
||||||
) ;
|
) ;
|
||||||
|
{-
|
||||||
SPredProgVP np vp = sats2clause (progressiveSats np vp) ;
|
SPredProgVP np vp = sats2clause (progressiveSats np vp) ;
|
||||||
|
-}
|
||||||
|
|
||||||
SPredAP subj adj =
|
SPredAP subj adj =
|
||||||
sats2clause (mkSatsCopula subj (adj.s ! AF (pgen2gen subj.g) subj.n)) ;
|
sats2clause (mkSatsCopula subj (complAdjPhrase subj.n adj)) ;
|
||||||
SPredCN subj cn =
|
SPredCN subj cn =
|
||||||
sats2clause (mkSatsCopula subj (indefNoun subj.n cn)) ;
|
sats2clause (mkSatsCopula subj (complCommNoun subj.n cn)) ;
|
||||||
SPredNP subj np =
|
SPredNP subj np =
|
||||||
sats2clause (mkSatsCopula subj (np.s ! stressed nominative)) ;
|
sats2clause (mkSatsCopula subj (np.s ! NPCase Nom)) ;
|
||||||
SPredAdv subj adv =
|
SPredAdv subj adv =
|
||||||
sats2clause (mkSatsCopula subj adv.s) ;
|
sats2clause (mkSatsCopula subj adv.s) ;
|
||||||
|
|
||||||
--------
|
--------
|
||||||
|
{-
|
||||||
QPredV np v =
|
QPredV np v =
|
||||||
sats2quest (mkSats (intNounPhrase np) v) ;
|
sats2quest (mkSats (intNounPhrase np) v) ;
|
||||||
QPredPassV subj v =
|
QPredPassV subj v =
|
||||||
|
|||||||
@@ -62,17 +62,21 @@ lin
|
|||||||
UseA = adj2adjPhrase ;
|
UseA = adj2adjPhrase ;
|
||||||
ComplA2 = complAdj ;
|
ComplA2 = complAdj ;
|
||||||
|
|
||||||
---- ComplAV v x = complVerbAdj v x ;
|
ComplAV av vpi = {s = \\_,a => av.s ! a ++ vpi.s ! VIInfinit} ;
|
||||||
---- ComplObjA2V v x y = complVerbAdj2 True v x y ;
|
ComplObjA2V av obj vpi = {s = \\_,a => av.s ! a ++ obj.s ! av.c ++ vpi.s ! VIInfinit} ;
|
||||||
|
|
||||||
PositADeg = positAdjPhrase ;
|
PositADeg = positAdjPhrase ;
|
||||||
ComparADeg = comparAdjPhrase ;
|
ComparADeg = comparAdjPhrase ;
|
||||||
---- SuperlADeg = superlAdjPhrase ;
|
SuperlADeg = superlAdjPhrase ;
|
||||||
|
|
||||||
-- verbs and verb prases
|
-- verbs and verb prases
|
||||||
|
|
||||||
---- PredAS = predAdjSent ;
|
PredAS adj sent = sats2clause (
|
||||||
---- PredV0 rain = predVerbClause (pronNounPhrase pronIt) rain (complVerb rain) ;
|
insertComplement
|
||||||
|
(mkSats impersNounPhrase verbOlla)
|
||||||
|
(complAdjPhrase Sg (adj2adjPhrase adj) ++ sent.s)
|
||||||
|
) ;
|
||||||
|
PredV0 rain = sats2clause (mkSats impersNounPhrase rain) ;
|
||||||
|
|
||||||
-- Partial saturation.
|
-- Partial saturation.
|
||||||
|
|
||||||
@@ -89,8 +93,8 @@ lin
|
|||||||
UseA2S x = x ;
|
UseA2S x = x ;
|
||||||
UseA2V x = x ;
|
UseA2V x = x ;
|
||||||
|
|
||||||
UseCl tp cl = {s = tp.s ++ cl.s ! SDecl ! tp.b ! VFinite tp.t tp.a} ;
|
UseCl tp cl = {s = tp.s ++ cl.s ! tp.b ! VFinite SDecl tp.t tp.a} ;
|
||||||
---- UseQCl tp cl = {s = \\q => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! q} ;
|
UseQCl tp cl = {s = tp.s ++ cl.s ! tp.b ! VFinite SQuest tp.t tp.a} ;
|
||||||
---- UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! a} ;
|
---- UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! a} ;
|
||||||
|
|
||||||
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
||||||
@@ -98,7 +102,7 @@ lin
|
|||||||
|
|
||||||
TPresent = {s = [] ; t = Present} ;
|
TPresent = {s = [] ; t = Present} ;
|
||||||
TPast = {s = [] ; t = Past} ;
|
TPast = {s = [] ; t = Past} ;
|
||||||
TFuture = {s = [] ; t = Future} ;
|
TFuture = {s = [] ; t = Present} ;
|
||||||
TConditional = {s = [] ; t = Conditional} ;
|
TConditional = {s = [] ; t = Conditional} ;
|
||||||
|
|
||||||
ASimul = {s = [] ; a = Simul} ;
|
ASimul = {s = [] ; a = Simul} ;
|
||||||
@@ -106,13 +110,13 @@ lin
|
|||||||
|
|
||||||
-- Adverbs.
|
-- Adverbs.
|
||||||
|
|
||||||
---- AdjAdv a = ss (a.s ! AAttr ! AAdv) ; --- also APred?
|
AdjAdv a = ss (a.s ! AAdv) ; --- also APred?
|
||||||
AdvPP p = p ;
|
AdvPP p = p ;
|
||||||
PrepNP = prepPhrase ;
|
PrepNP = prepPhrase ;
|
||||||
AdvCN = advCommNounPhrase ;
|
AdvCN = advCommNounPhrase ;
|
||||||
AdvAP = advAdjPhrase ;
|
AdvAP = advAdjPhrase ;
|
||||||
AdvAdv = cc2 ;
|
AdvAdv = cc2 ;
|
||||||
---- AdvNP pn pp = {s = \\c => pn.s ! c ++ pp.s ; a = pn.a} ;
|
AdvNP pn pp = {s = \\c => pn.s ! c ++ pp.s ; n = pn.n ; p = pn.p} ;
|
||||||
|
|
||||||
--3 Sentences and relative clauses
|
--3 Sentences and relative clauses
|
||||||
--
|
--
|
||||||
@@ -135,12 +139,12 @@ lin
|
|||||||
---- IDetCN d n = nounPhraseInt (detNounPhrase d n) ;
|
---- IDetCN d n = nounPhraseInt (detNounPhrase d n) ;
|
||||||
FunIP = funIntPron ;
|
FunIP = funIntPron ;
|
||||||
|
|
||||||
---- QuestCl = questClause ;
|
QuestCl cl = cl ;
|
||||||
---- IntSlash = intSlash ;
|
---- IntSlash = intSlash ;
|
||||||
---- QuestAdv = questAdverbial ;
|
QuestAdv = questAdverbial ;
|
||||||
|
|
||||||
---- PosImpVP = imperVerbPhrase True ;
|
PosImpVP = imperVerbPhrase True ;
|
||||||
---- NegImpVP = imperVerbPhrase False ;
|
NegImpVP = imperVerbPhrase False ;
|
||||||
|
|
||||||
IndicPhrase = indicUtt ;
|
IndicPhrase = indicUtt ;
|
||||||
QuestPhrase = interrogUtt ;
|
QuestPhrase = interrogUtt ;
|
||||||
|
|||||||
@@ -105,6 +105,8 @@ oper
|
|||||||
nameNounPhrase : ProperName -> NounPhrase = \jussi ->
|
nameNounPhrase : ProperName -> NounPhrase = \jussi ->
|
||||||
{s = \\f => jussi.s ! npForm2Case Sg f ; n = Sg ; p = NP3} ;
|
{s = \\f => jussi.s ! npForm2Case Sg f ; n = Sg ; p = NP3} ;
|
||||||
|
|
||||||
|
impersNounPhrase : NounPhrase = nameNounPhrase {s = \\_ => []} ;
|
||||||
|
|
||||||
singularNounPhrase : CommNounPhrase -> NounPhrase = \cn ->
|
singularNounPhrase : CommNounPhrase -> NounPhrase = \cn ->
|
||||||
{s = \\f => cn.s ! False ! Sg ! (npForm2Case Sg f) ; n = Sg ; p = NP3} ;
|
{s = \\f => cn.s ! False ! Sg ! (npForm2Case Sg f) ; n = Sg ; p = NP3} ;
|
||||||
|
|
||||||
@@ -342,6 +344,10 @@ oper
|
|||||||
p = NP3
|
p = NP3
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
superlAdjPhrase : AdjDegr -> AdjPhrase = \iso ->
|
||||||
|
{s = \\_,a => iso.s ! Sup ! a ;
|
||||||
|
} ;
|
||||||
|
|
||||||
--3 Two-place adjectives
|
--3 Two-place adjectives
|
||||||
--
|
--
|
||||||
-- A two-place adjective is an adjective with a case used after (or before)
|
-- A two-place adjective is an adjective with a case used after (or before)
|
||||||
@@ -468,19 +474,22 @@ oper
|
|||||||
|
|
||||||
param
|
param
|
||||||
|
|
||||||
Tense = Present | Past | Future | Conditional ;
|
Tense = Present | Past | Conditional ;
|
||||||
Anteriority = Simul | Anter ;
|
Anteriority = Simul | Anter ;
|
||||||
|
|
||||||
SForm =
|
SForm =
|
||||||
VFinite Tense Anteriority
|
VFinite SType Tense Anteriority
|
||||||
| VInfinit Anteriority
|
| VInfinit Anteriority
|
||||||
| VImperat
|
| VImperat
|
||||||
;
|
;
|
||||||
|
|
||||||
SType = SDecl | SQuest ;
|
SType = SDecl | SQuest ;
|
||||||
|
|
||||||
|
VIForm = VIInfinit | VIImperat Bool Number ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Clause : Type = {s : SType => Bool => SForm => Str} ;
|
Clause : Type = {s : Bool => SForm => Str} ;
|
||||||
|
VerbPhraseInf : Type = {s : VIForm => Str} ;
|
||||||
|
|
||||||
Sats : Type = {
|
Sats : Type = {
|
||||||
subj : Str ;
|
subj : Str ;
|
||||||
@@ -493,7 +502,7 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
sats2clause : Sats -> Clause = \sats ->
|
sats2clause : Sats -> Clause = \sats ->
|
||||||
{s = \\st,b,sf =>
|
{s = \\b,sf =>
|
||||||
let
|
let
|
||||||
subj = sats.subj ;
|
subj = sats.subj ;
|
||||||
pred = sats.pred ! b ! sf ;
|
pred = sats.pred ! b ! sf ;
|
||||||
@@ -502,9 +511,9 @@ oper
|
|||||||
obj = pred.obj ;
|
obj = pred.obj ;
|
||||||
comp = sats.comp
|
comp = sats.comp
|
||||||
in
|
in
|
||||||
case st of {
|
case sf of {
|
||||||
SDecl => subj ++ fin ++ inf ++ obj ++ comp ;
|
VFinite SQuest _ _ => questPart fin ++ subj ++ inf ++ obj ++ comp ;
|
||||||
SQuest => questPart fin ++ subj ++ inf ++ obj ++ comp
|
_ => subj ++ fin ++ inf ++ obj ++ comp
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -520,6 +529,9 @@ oper
|
|||||||
mkSatsObject : NounPhrase -> TransVerb -> NounPhrase -> Sats = \subj,verb,obj ->
|
mkSatsObject : NounPhrase -> TransVerb -> NounPhrase -> Sats = \subj,verb,obj ->
|
||||||
insertObject (mkSats subj verb) verb.c verb.s3 verb.s4 obj ;
|
insertObject (mkSats subj verb) verb.c verb.s3 verb.s4 obj ;
|
||||||
|
|
||||||
|
mkSatsCopula : NounPhrase -> Str -> Sats = \subj,comp ->
|
||||||
|
insertComplement (mkSats subj verbOlla) comp ;
|
||||||
|
|
||||||
insertObject : Sats -> ComplCase -> Str -> Str -> NounPhrase -> Sats =
|
insertObject : Sats -> ComplCase -> Str -> Str -> NounPhrase -> Sats =
|
||||||
\sats, c, prep, postp, obj ->
|
\sats, c, prep, postp, obj ->
|
||||||
{subj = sats.subj ;
|
{subj = sats.subj ;
|
||||||
@@ -532,11 +544,18 @@ oper
|
|||||||
comp = sats.comp
|
comp = sats.comp
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
insertComplement : Sats -> Str -> Sats =
|
||||||
|
\sats, comp ->
|
||||||
|
{subj = sats.subj ;
|
||||||
|
pred = sats.pred ;
|
||||||
|
comp = sats.comp ++ comp
|
||||||
|
} ;
|
||||||
|
|
||||||
complCase : Bool -> ComplCase -> SForm -> NPForm = \b,c,v -> case c of {
|
complCase : Bool -> ComplCase -> SForm -> NPForm = \b,c,v -> case c of {
|
||||||
CCase k => NPCase k ;
|
CCase k => NPCase k ;
|
||||||
CAcc => case b of {
|
CAcc => case b of {
|
||||||
True => case v of {
|
True => case v of {
|
||||||
VFinite _ _ => NPAccGen ;
|
VFinite _ _ _ => NPAccGen ;
|
||||||
_ => NPAccNom
|
_ => NPAccNom
|
||||||
} ;
|
} ;
|
||||||
_ => NPCase Part
|
_ => NPCase Part
|
||||||
@@ -567,11 +586,11 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
in case sf of {
|
in case sf of {
|
||||||
VFinite Past a => ei a (Impf n p) (part) ;
|
VFinite _ Past a => ei a (Impf n p) (part) ;
|
||||||
VFinite Conditional a => ei a (Cond n p) (Cond Sg P3) ;
|
VFinite _ Conditional a => ei a (Cond n p) (Cond Sg P3) ;
|
||||||
VFinite _ a => ei a (Pres n p) (Imper Sg) ; -- both Present and Future
|
VFinite _ _ a => ei a (Pres n p) (Imper Sg) ; -- Present
|
||||||
VInfinit a => ei a (Inf) (Inf) ; --- olla tulematta
|
VInfinit a => ei a (Inf) (Inf) ; --- olla tulematta
|
||||||
VImperat => älä
|
VImperat => älä
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -583,29 +602,9 @@ oper
|
|||||||
-- phrases ("minä uin" ; "minut valitaan" ; "minua odotetaan" ; "minulla on jano").
|
-- phrases ("minä uin" ; "minut valitaan" ; "minua odotetaan" ; "minulla on jano").
|
||||||
|
|
||||||
oper
|
oper
|
||||||
VerbPhrase = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
|
||||||
VerbGroup = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
|
||||||
|
|
||||||
predVerbGroup : Bool -> VerbGroup -> VerbPhrase = \b,vg -> {
|
|
||||||
s = vg.s ! b ;
|
|
||||||
s2 = vg.s2 ! b ;
|
|
||||||
c = vg.c
|
|
||||||
} ;
|
|
||||||
|
|
||||||
vp2vg : (Bool -> VerbPhrase) -> VerbGroup = \f -> {
|
|
||||||
s = \\b => (f b).s ;
|
|
||||||
s2 = \\b => (f b).s2 ;
|
|
||||||
c = (f True).c
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- The normal subject case is the nominative.
|
-- The normal subject case is the nominative.
|
||||||
|
|
||||||
nomVerbPhrase : (p,n : {s,s2 : VForm => Str}) -> VerbGroup = \pos,neg ->
|
|
||||||
{s = table {True => pos.s ; False => neg.s} ;
|
|
||||||
s2 = table {True => pos.s2 ; False => neg.s2} ;
|
|
||||||
c = CCase Nom
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- From the inflection table, we select the finite form as function
|
-- From the inflection table, we select the finite form as function
|
||||||
-- of person and number:
|
-- of person and number:
|
||||||
|
|
||||||
@@ -622,24 +621,12 @@ oper
|
|||||||
-- N.B. negation is *not* a function applicable to a verb phrase, since
|
-- N.B. negation is *not* a function applicable to a verb phrase, since
|
||||||
-- double negations with "ei" are not grammatical.
|
-- double negations with "ei" are not grammatical.
|
||||||
|
|
||||||
predVerb : Verb -> VerbGroup = \walk ->
|
|
||||||
let {
|
|
||||||
noCompl : {s2 : VForm => Str} = {s2 = \\_ => []} ;
|
|
||||||
infCompl : {s2 : VForm => Str} = {s2 = table {
|
|
||||||
Imper Pl => walk.s ! ImpNegPl ;
|
|
||||||
_ => walk.s ! vFormNeg
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
in
|
|
||||||
nomVerbPhrase (walk ** noCompl) (verbEi ** infCompl) ;
|
|
||||||
|
|
||||||
-- (N.B. local definitions workaround for poor type inference in GF 1.2).
|
-- (N.B. local definitions workaround for poor type inference in GF 1.2).
|
||||||
|
|
||||||
-- Sometimes we want to extract the verb part of a verb phrase. Not strictly
|
-- Sometimes we want to extract the verb part of a verb phrase. Not strictly
|
||||||
-- necessary since this is a consequence of record subtyping.
|
-- necessary since this is a consequence of record subtyping.
|
||||||
|
|
||||||
verbOfPhrase : VerbPhrase -> Verb = \v -> {s = v.s} ;
|
|
||||||
|
|
||||||
-- Verb phrases can also be formed from adjectives ("on vanha"),
|
-- Verb phrases can also be formed from adjectives ("on vanha"),
|
||||||
-- common nouns ("on mies"), and noun phrases ("on Jussi").
|
-- common nouns ("on mies"), and noun phrases ("on Jussi").
|
||||||
@@ -652,32 +639,18 @@ oper
|
|||||||
-- constructions of the "plurale tantum" kind. The adjective rule can be defined
|
-- constructions of the "plurale tantum" kind. The adjective rule can be defined
|
||||||
-- in terms of the common noun rule.
|
-- in terms of the common noun rule.
|
||||||
|
|
||||||
predAdjective : AdjPhrase -> VerbGroup = \iso ->
|
|
||||||
let
|
|
||||||
isot : CommNounPhrase = {
|
|
||||||
s = \\_,n,c => iso.s ! APred ! AN (NCase n c) ;
|
|
||||||
g = NonHuman
|
|
||||||
}
|
|
||||||
in predCommNoun isot ;
|
|
||||||
|
|
||||||
predCommNoun : CommNounPhrase -> VerbGroup = \mies ->
|
complCommNoun : Number -> CommNounPhrase -> Str = \n,mies ->
|
||||||
let {
|
case n of {
|
||||||
miehia : VForm => Str = \\v => case vform2number v of {
|
Sg => mies.s ! False ! Sg ! Nom ;
|
||||||
Sg => mies.s ! False ! Sg ! Nom ;
|
Pl => mies.s ! False ! Pl ! Part
|
||||||
Pl => mies.s ! False ! Pl ! Part
|
} ;
|
||||||
} ;
|
|
||||||
olemiehia : VForm => Str =
|
|
||||||
\\v => verbOlla.s ! vFormNeg ++ miehia ! v
|
|
||||||
}
|
|
||||||
in nomVerbPhrase (verbOlla ** {s2 = miehia}) (verbEi ** {s2 = olemiehia}) ;
|
|
||||||
|
|
||||||
predNounPhrase : NounPhrase -> VerbGroup = \jussi ->
|
complAdjPhrase : Number -> AdjPhrase -> Str = \n,hieno ->
|
||||||
let {jussia : Bool => Number => Case => Str = \\_,_,_ => jussi.s ! NPCase Nom}
|
case n of {
|
||||||
in predCommNoun {s = jussia ; g = Human} ; --- gender does not matter
|
Sg => hieno.s ! APred ! AN (NCase Sg Nom) ;
|
||||||
|
Pl => hieno.s ! APred ! AN (NCase Pl Part)
|
||||||
predAdverb : Adverb -> VerbGroup = \pois ->
|
} ;
|
||||||
let {poissa : Bool => Number => Case => Str = \\_,_,_ => pois.s}
|
|
||||||
in predCommNoun {s = poissa ; g = NonHuman} ; --- gender does not matter
|
|
||||||
|
|
||||||
--3 Transitive verbs
|
--3 Transitive verbs
|
||||||
--
|
--
|
||||||
@@ -698,17 +671,6 @@ oper
|
|||||||
--
|
--
|
||||||
-- N.B. One or both of the pre- and postposition are empty.
|
-- N.B. One or both of the pre- and postposition are empty.
|
||||||
|
|
||||||
complTransVerb : TransVerb -> NounPhrase -> VerbGroup = \ostaa,talo ->
|
|
||||||
let {
|
|
||||||
ostan = predVerb ostaa ;
|
|
||||||
talon : Bool => VForm => Str = \\b,v =>
|
|
||||||
ostaa.s3 ++ talo.s ! complementCase b ostaa.c v ++ ostaa.s4
|
|
||||||
}
|
|
||||||
in
|
|
||||||
{s = ostan.s ;
|
|
||||||
s2 = \\b,v => ostan.s2 ! b ! v ++ talon ! b ! v ;
|
|
||||||
c = CCase Nom
|
|
||||||
} ;
|
|
||||||
|
|
||||||
-- N.B. If the case is accusative, it becomes partitive in negated verb phrases.
|
-- N.B. If the case is accusative, it becomes partitive in negated verb phrases.
|
||||||
-- The choice between the nominative and genitive accusatives depends on the verb
|
-- The choice between the nominative and genitive accusatives depends on the verb
|
||||||
@@ -736,7 +698,7 @@ oper
|
|||||||
|
|
||||||
mkTransVerbDir : Verb -> TransVerb = \ostaa ->
|
mkTransVerbDir : Verb -> TransVerb = \ostaa ->
|
||||||
ostaa ** {s3 = [] ; s4 = [] ; c = CAcc} ;
|
ostaa ** {s3 = [] ; s4 = [] ; c = CAcc} ;
|
||||||
|
{-
|
||||||
-- Most two-place verbs can be used passively; the object case need not be
|
-- Most two-place verbs can be used passively; the object case need not be
|
||||||
-- the accusative, and it becomes the subject case in the passive sentence.
|
-- the accusative, and it becomes the subject case in the passive sentence.
|
||||||
|
|
||||||
@@ -751,7 +713,7 @@ oper
|
|||||||
|
|
||||||
passVerb : Verb -> VerbGroup = \uida ->
|
passVerb : Verb -> VerbGroup = \uida ->
|
||||||
passTransVerb (mkTransVerbDir uida) ;
|
passTransVerb (mkTransVerbDir uida) ;
|
||||||
|
-}
|
||||||
-- Transitive verbs can be used elliptically as verbs. The semantics
|
-- Transitive verbs can be used elliptically as verbs. The semantics
|
||||||
-- is left to applications. The definition is trivial, due to record
|
-- is left to applications. The definition is trivial, due to record
|
||||||
-- subtyping.
|
-- subtyping.
|
||||||
@@ -764,9 +726,6 @@ oper
|
|||||||
-- bare verb phrase in passive, and putting the complement before
|
-- bare verb phrase in passive, and putting the complement before
|
||||||
-- the verb ("auttaa minua" - "minua autetaan").
|
-- the verb ("auttaa minua" - "minua autetaan").
|
||||||
|
|
||||||
passPredVerbPhrase : VerbPhrase -> Sentence = \auttaaminua ->
|
|
||||||
let {p = Pass True} in
|
|
||||||
{s = auttaaminua.s2 ! p ++ auttaaminua.s ! p} ;
|
|
||||||
|
|
||||||
-- *Ditransitive verbs* are verbs with three argument places.
|
-- *Ditransitive verbs* are verbs with three argument places.
|
||||||
-- We treat so far only the rule in which the ditransitive
|
-- We treat so far only the rule in which the ditransitive
|
||||||
@@ -774,21 +733,6 @@ oper
|
|||||||
|
|
||||||
DitransVerb = TransVerb ** {s5, s6 : Str ; c2 : ComplCase} ;
|
DitransVerb = TransVerb ** {s5, s6 : Str ; c2 : ComplCase} ;
|
||||||
|
|
||||||
complDitransVerb : DitransVerb -> NounPhrase -> NounPhrase -> VerbGroup =
|
|
||||||
\ostaa,talo,me ->
|
|
||||||
let {
|
|
||||||
ostan = predVerb ostaa ;
|
|
||||||
talon : Bool => VForm => Str = \\b,v =>
|
|
||||||
ostaa.s3 ++ talo.s ! complementCase b ostaa.c v ++ ostaa.s4 ;
|
|
||||||
meille : Bool => VForm => Str = \\b,v =>
|
|
||||||
ostaa.s5 ++ me.s ! complementCase b ostaa.c2 v ++ ostaa.s6
|
|
||||||
}
|
|
||||||
in {
|
|
||||||
s = ostan.s ;
|
|
||||||
s2 = \\b,v => ostan.s2 ! b ! v ++ talon ! b ! v ++ meille ! b ! v ;
|
|
||||||
c = CCase Nom
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
--2 Adverbials
|
--2 Adverbials
|
||||||
--
|
--
|
||||||
@@ -799,13 +743,13 @@ oper
|
|||||||
|
|
||||||
-- This rule adds the adverbial as a prefix or a suffix to the complement,
|
-- This rule adds the adverbial as a prefix or a suffix to the complement,
|
||||||
-- in free variation.
|
-- in free variation.
|
||||||
|
{-
|
||||||
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \laulaa, hyvin ->
|
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \laulaa, hyvin ->
|
||||||
{s = laulaa.s ;
|
{s = laulaa.s ;
|
||||||
s2 = \\v => bothWays (laulaa.s2 ! v) hyvin.s ;
|
s2 = \\v => bothWays (laulaa.s2 ! v) hyvin.s ;
|
||||||
c = laulaa.c
|
c = laulaa.c
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
advAdjPhrase : Adverb -> AdjPhrase -> AdjPhrase = \liian, iso ->
|
advAdjPhrase : Adverb -> AdjPhrase -> AdjPhrase = \liian, iso ->
|
||||||
{s = \\p,a => liian.s ++ iso.s ! p ! a
|
{s = \\p,a => liian.s ++ iso.s ! p ! a
|
||||||
} ;
|
} ;
|
||||||
@@ -849,13 +793,6 @@ oper
|
|||||||
-- agreement between subject and verb. Recall that the VP may already
|
-- agreement between subject and verb. Recall that the VP may already
|
||||||
-- contain negation.
|
-- contain negation.
|
||||||
|
|
||||||
predVerbPhrase : NounPhrase -> VerbPhrase -> Sentence = \jussi,uida ->
|
|
||||||
let {
|
|
||||||
p = np2Person jussi.p ;
|
|
||||||
c = complementCase True uida.c Inf --- True,Inf don't matter here
|
|
||||||
}
|
|
||||||
in
|
|
||||||
ss (jussi.s ! c ++ uida.s ! Pres jussi.n p ++ uida.s2 ! Pres jussi.n p) ;
|
|
||||||
|
|
||||||
--3 Sentence-complement verbs
|
--3 Sentence-complement verbs
|
||||||
--
|
--
|
||||||
@@ -865,16 +802,6 @@ oper
|
|||||||
|
|
||||||
-- To generate "sanoo että Jussi ui" / "ei sano että Jussi ui"
|
-- To generate "sanoo että Jussi ui" / "ei sano että Jussi ui"
|
||||||
|
|
||||||
complSentVerb : SentenceVerb -> Sentence -> VerbGroup =
|
|
||||||
\sanoa,jussiui ->
|
|
||||||
let {
|
|
||||||
sanon = predVerb sanoa
|
|
||||||
}
|
|
||||||
in {
|
|
||||||
s = sanon.s ;
|
|
||||||
s2 = \\b,v => sanon.s2 ! b ! v ++ conjEtta ++ jussiui.s ;
|
|
||||||
c = CCase Nom
|
|
||||||
} ;
|
|
||||||
|
|
||||||
--3 Verb-complement verbs
|
--3 Verb-complement verbs
|
||||||
--
|
--
|
||||||
@@ -883,7 +810,7 @@ oper
|
|||||||
-- also verbs with a special subject case ("täytyy", "on pakko").
|
-- also verbs with a special subject case ("täytyy", "on pakko").
|
||||||
|
|
||||||
VerbVerb : Type = Verb ** {c : ComplCase} ;
|
VerbVerb : Type = Verb ** {c : ComplCase} ;
|
||||||
|
{-
|
||||||
complVerbVerb : VerbVerb -> VerbGroup -> VerbGroup = \haluta, uida ->
|
complVerbVerb : VerbVerb -> VerbGroup -> VerbGroup = \haluta, uida ->
|
||||||
let
|
let
|
||||||
hc = haluta.c ;
|
hc = haluta.c ;
|
||||||
@@ -902,7 +829,7 @@ oper
|
|||||||
uida.s2 ! True ! Inf ;
|
uida.s2 ! True ! Inf ;
|
||||||
c = hc
|
c = hc
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
nomVerbVerb : Verb -> VerbVerb = \v -> v ** {c = CCase Nom} ;
|
nomVerbVerb : Verb -> VerbVerb = \v -> v ** {c = CCase Nom} ;
|
||||||
|
|
||||||
--2 Sentences missing noun phrases
|
--2 Sentences missing noun phrases
|
||||||
@@ -922,7 +849,7 @@ nomVerbVerb : Verb -> VerbVerb = \v -> v ** {c = CCase Nom} ;
|
|||||||
-- fixed by the Boolean parameter and the subject.
|
-- fixed by the Boolean parameter and the subject.
|
||||||
|
|
||||||
SentenceSlashNounPhrase = Sentence ** {s2 : Str ; c : Case} ;
|
SentenceSlashNounPhrase = Sentence ** {s2 : Str ; c : Case} ;
|
||||||
|
{-
|
||||||
slashTransVerb : Bool -> NounPhrase -> TransVerb -> SentenceSlashNounPhrase =
|
slashTransVerb : Bool -> NounPhrase -> TransVerb -> SentenceSlashNounPhrase =
|
||||||
\b,jussi,ostaa ->
|
\b,jussi,ostaa ->
|
||||||
predVerbPhrase jussi (predVerbGroup b (predVerb ostaa)) ** {
|
predVerbPhrase jussi (predVerbGroup b (predVerb ostaa)) ** {
|
||||||
@@ -930,7 +857,7 @@ nomVerbVerb : Verb -> VerbVerb = \v -> v ** {c = CCase Nom} ;
|
|||||||
c = npForm2Case jussi.n
|
c = npForm2Case jussi.n
|
||||||
(complementCase b ostaa.c (Pres jussi.n (np2Person jussi.p)))
|
(complementCase b ostaa.c (Pres jussi.n (np2Person jussi.p)))
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
--2 Relative pronouns and relative clauses
|
--2 Relative pronouns and relative clauses
|
||||||
--
|
--
|
||||||
-- As described in $types.Fin.gf$, relative pronouns are inflected like
|
-- As described in $types.Fin.gf$, relative pronouns are inflected like
|
||||||
@@ -947,11 +874,11 @@ nomVerbVerb : Verb -> VerbVerb = \v -> v ** {c = CCase Nom} ;
|
|||||||
-- slash expressions ("jonka sinä näet", "jonka kautta sinä käyt").
|
-- slash expressions ("jonka sinä näet", "jonka kautta sinä käyt").
|
||||||
|
|
||||||
RelClause : Type = {s : Number => Str} ;
|
RelClause : Type = {s : Number => Str} ;
|
||||||
|
{-
|
||||||
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \joka,ui ->
|
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \joka,ui ->
|
||||||
{s = \\n => joka.s ! n ! npForm2Case n (complementCase True ui.c Inf) ++
|
{s = \\n => joka.s ! n ! npForm2Case n (complementCase True ui.c Inf) ++
|
||||||
ui.s ! Pres n P3 ++ ui.s2 ! Pres n P3} ;
|
ui.s ! Pres n P3 ++ ui.s2 ! Pres n P3} ;
|
||||||
|
-}
|
||||||
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause = \joka,saat ->
|
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause = \joka,saat ->
|
||||||
{s = \\n => joka.s ! n ! saat.c ++ saat.s2 ++ saat.s} ;
|
{s = \\n => joka.s ! n ! saat.c ++ saat.s2 ++ saat.s} ;
|
||||||
|
|
||||||
@@ -1043,16 +970,13 @@ nomVerbVerb : Verb -> VerbVerb = \v -> v ** {c = CCase Nom} ;
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
Question = SS ;
|
Question = SS ;
|
||||||
|
QuestClause = Clause ; ---- too many forms
|
||||||
|
|
||||||
--3 Yes-no questions
|
--3 Yes-no questions
|
||||||
--
|
--
|
||||||
-- Yes-no questions are formed by inversed predication, with the clitic "ko" / "kö"
|
-- Yes-no questions are formed by inversed predication, with the clitic "ko" / "kö"
|
||||||
-- particle attached to the verb part of the verb phrase.
|
-- particle attached to the verb part of the verb phrase.
|
||||||
|
|
||||||
questVerbPhrase : NounPhrase -> VerbPhrase -> Question = \jussi,ui ->
|
|
||||||
let {np = Pres jussi.n (np2Person jussi.p)} in
|
|
||||||
ss (ui.s ! np ++ koPart ++ jussi.s ! complementCase True ui.c Inf ++ ui.s2 ! np);
|
|
||||||
|
|
||||||
onkoNounPhrase : NounPhrase -> Question = \kaljaa ->
|
onkoNounPhrase : NounPhrase -> Question = \kaljaa ->
|
||||||
ss ("onko" ++ kaljaa.s ! NPCase Nom) ;
|
ss ("onko" ++ kaljaa.s ! NPCase Nom) ;
|
||||||
|
|
||||||
@@ -1061,8 +985,8 @@ oper
|
|||||||
-- Wh-questions are of two kinds: ones that are like $NP - VP$ sentences
|
-- Wh-questions are of two kinds: ones that are like $NP - VP$ sentences
|
||||||
-- ("kuka ui?") others that are line $S/NP - NP$ sentences ("kenet sinä tapaat?").
|
-- ("kuka ui?") others that are line $S/NP - NP$ sentences ("kenet sinä tapaat?").
|
||||||
|
|
||||||
intVerbPhrase : IntPron -> VerbPhrase -> Question = \kuka,ui ->
|
-- intVerbPhrase : IntPron -> VerbPhrase -> Question = \kuka,ui ->
|
||||||
predVerbPhrase (kuka ** {p = NP3}) ui ;
|
-- predVerbPhrase (kuka ** {p = NP3}) ui ;
|
||||||
|
|
||||||
intSlash : IntPron -> SentenceSlashNounPhrase -> Question = \kuka,tapaat ->
|
intSlash : IntPron -> SentenceSlashNounPhrase -> Question = \kuka,tapaat ->
|
||||||
ss (kuka.s ! NPCase tapaat.c ++ tapaat.s2 ++ tapaat.s) ;
|
ss (kuka.s ! NPCase tapaat.c ++ tapaat.s2 ++ tapaat.s) ;
|
||||||
@@ -1086,9 +1010,9 @@ oper
|
|||||||
-- sense is a semantic question. The syntax is very simple: just prefix the
|
-- sense is a semantic question. The syntax is very simple: just prefix the
|
||||||
-- adverbial to the predication.
|
-- adverbial to the predication.
|
||||||
|
|
||||||
questAdverbial : IntAdverb -> NounPhrase -> VerbPhrase -> Question =
|
questAdverbial : IntAdverb -> Clause -> QuestClause =
|
||||||
\miksi, jussi, ui ->
|
\miksi, cl ->
|
||||||
cc2 miksi (predVerbPhrase jussi ui) ;
|
{s = \\b,f => miksi.s ++ cl.s ! b ! f} ;
|
||||||
|
|
||||||
--2 Imperatives
|
--2 Imperatives
|
||||||
--
|
--
|
||||||
@@ -1096,8 +1020,8 @@ oper
|
|||||||
|
|
||||||
Imperative = SS1 Number ;
|
Imperative = SS1 Number ;
|
||||||
|
|
||||||
imperVerbPhrase : VerbPhrase -> Imperative = \ui ->
|
imperVerbPhrase : Bool -> VerbPhraseInf -> Imperative = \b,ui ->
|
||||||
{s = \\n => ui.s ! Imper n ++ ui.s2 ! Imper n} ;
|
{s = \\n => ui.s ! VIImperat b n} ;
|
||||||
|
|
||||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||||
ss (I.s ! n ++ exclPunct) ;
|
ss (I.s ! n ++ exclPunct) ;
|
||||||
@@ -1245,11 +1169,11 @@ oper
|
|||||||
|
|
||||||
subjunctVariants : Subjunction -> Str -> Str -> Str = \if,A,B ->
|
subjunctVariants : Subjunction -> Str -> Str -> Str = \if,A,B ->
|
||||||
variants {if.s ++ A ++ commaPunct ++ B ; B ++ commaPunct ++ if.s ++ A} ;
|
variants {if.s ++ A ++ commaPunct ++ B ; B ++ commaPunct ++ if.s ++ A} ;
|
||||||
|
{-
|
||||||
subjunctVerbPhrase : VerbPhrase -> Subjunction -> Sentence -> VerbPhrase =
|
subjunctVerbPhrase : VerbPhrase -> Subjunction -> Sentence -> VerbPhrase =
|
||||||
\V, if, A ->
|
\V, if, A ->
|
||||||
adVerbPhrase V (ss (if.s ++ A.s)) ;
|
adVerbPhrase V (ss (if.s ++ A.s)) ;
|
||||||
|
-}
|
||||||
--2 One-word utterances
|
--2 One-word utterances
|
||||||
--
|
--
|
||||||
-- An utterance can consist of one phrase of almost any category,
|
-- An utterance can consist of one phrase of almost any category,
|
||||||
|
|||||||
Reference in New Issue
Block a user