mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-10-25 09:13:18 -06:00
extensions by Codex
This commit is contained in:
1 parent
d4b6da0687
commit
61f93263d4
8 files changed
+123
-11
No files matched your search
@@ -34,6 +34,13 @@ lin
|
||||
x_inches_AdA : AdA = lin AdA (mkUtt x_inches_NP) ;
|
||||
in mkAP x_inches_AdA <lin A a : A> ;
|
||||
|
||||
n_units_of_NP card cn np =
|
||||
mkNP (mkNP <lin Card card : Card> <lin CN cn : CN>)
|
||||
(SyntaxEst.mkAdv part_Prep <lin NP np : NP>) ;
|
||||
|
||||
cup_of_CN np =
|
||||
mkCN (lin N2 (mkN2 (mkN "tass") (casePrep partitive))) <lin NP np : NP> ;
|
||||
|
||||
{-
|
||||
glass_of_CN np = mkCN (lin N2 (mkN2 (mkN "klaas") (casePrep partitive))) (lin NP np) | mkCN (lin N2 (mkN2 (mkN "klaasitäis") (casePrep partitive))) (lin NP np) ;
|
||||
|
||||
|
||||
+34
-10
@@ -58,6 +58,19 @@ concrete ExtendEst of Extend =
|
||||
VPS = X.linVPS (agrP3 Sg) ;
|
||||
VPI = X.linVPI InfMa ;
|
||||
|
||||
lincat
|
||||
[Comp] = {s1,s2 : Agr => Str} ;
|
||||
[Imp] = {s1,s2 : Polarity => Agr => Str} ;
|
||||
|
||||
lin
|
||||
BaseComp = twoTable Agr ;
|
||||
ConsComp = consrTable Agr comma ;
|
||||
ConjComp conj xs = conjunctDistrTable Agr conj xs ;
|
||||
|
||||
BaseImp = twoTable2 Polarity Agr ;
|
||||
ConsImp = consrTable2 Polarity Agr comma ;
|
||||
ConjImp conj xs = conjunctDistrTable2 Polarity Agr conj xs ;
|
||||
|
||||
lin
|
||||
MkVPS = X.MkVPS ;
|
||||
BaseVPS = X.BaseVPS ;
|
||||
@@ -109,10 +122,8 @@ concrete ExtendEst of Extend =
|
||||
|
||||
-- : Num -> CN -> RNP ; -- my car(s)
|
||||
ReflPoss num cn = {
|
||||
s = \\a,npf => possPron ! a ++ num.s ! Sg ! Nom ++
|
||||
case npf of {
|
||||
NPCase c => cn.s ! NCase num.n c ;
|
||||
NPAcc => cn.s ! NCase num.n Gen } ;
|
||||
s = \\_,npf => possPron ! a ++ num.s ! Sg ! Nom ++
|
||||
cn.s ! NCase num.n (npform2case num.n npf) ;
|
||||
} ;
|
||||
|
||||
PredetRNP predet rnp = {
|
||||
@@ -129,19 +140,31 @@ concrete ExtendEst of Extend =
|
||||
Cons_rr_RNP x xs = consrTable2 Agr NPForm comma x xs ;
|
||||
Cons_nr_RNP x xs = consrTable2 Agr NPForm comma {s = \\a => x.s} xs ;
|
||||
|
||||
{-
|
||||
-- : Pron -> Num -> CN -> RNP -> NP ; -- his abandonment of his wife and children
|
||||
PossPronRNP pron num cn rnp =
|
||||
let np = DetCN (DetQuant (PossPron pron) num) cn in
|
||||
np ** {postmod = np.postmod ++ rnp.s ! pron.a ! NPCase Gen} ;
|
||||
|
||||
-- : NP -> Prep -> RNP -> RNP ; -- a dispute with his wife
|
||||
AdvRAP adv rp =
|
||||
AdvRNP np prep rnp = {
|
||||
s = \\agr,npf => linNP npf np ++ appCompl True Pos prep (rnp2np agr rnp)
|
||||
} ;
|
||||
|
||||
-- : VP -> Prep -> RNP -> VP ; -- lectured about her travels
|
||||
AdvRNP adv rp =
|
||||
AdvRVP vp prep rnp =
|
||||
insertObj (\\_,b,agr => appCompl True b prep (rnp2np agr rnp)) vp ;
|
||||
|
||||
-- : AP -> Prep -> RNP -> AP ; -- adamant in his refusal
|
||||
AdvRVP adv rp =
|
||||
-}
|
||||
AdvRAP ap prep rnp = ap ** {
|
||||
s = \\isMod,af => ap.s ! isMod ! af ++
|
||||
appCompl True Pos prep (rnp2np (agrP3 Sg) rnp)
|
||||
} ;
|
||||
|
||||
ReflPossPron = {
|
||||
s,sp = \\_,_ => "oma" ;
|
||||
isNum = False ;
|
||||
isDef = True
|
||||
} ;
|
||||
|
||||
oper
|
||||
possPron : Agr => Str = table {
|
||||
@@ -217,7 +240,8 @@ concrete ExtendEst of Extend =
|
||||
-- ComplGenVV v a p vp = insertObj (\\agr => a.s ++ p.s ++ infVP v.typ vp a.a p.p agr)
|
||||
-- (predVV v) ;
|
||||
|
||||
-- ComplSlashPartLast vps np = {} ; --- AR 7/3/2013
|
||||
ComplSlashPartLast vps np =
|
||||
insertObj (\\fin,b,_ => appCompl fin b vps.c2 np) vps ;
|
||||
|
||||
---------------------------------
|
||||
-- E - F
|
||||
|
||||
@@ -11,6 +11,14 @@ concrete IdiomEst of Idiom = CatEst **
|
||||
vp = insertObj (\\_,b,_ => "olemas" ++ linNP (cas b) np) (predV olla)
|
||||
in existClause noSubj (agrP3 Sg) vp ;
|
||||
|
||||
ExistNPAdv np adv =
|
||||
let cas : Polarity -> NPForm = \p -> case p of {
|
||||
Pos => NPCase Nom ;
|
||||
Neg => NPCase Part } ;
|
||||
vp = insertObj (\\_,b,_ => linNP (cas b) np)
|
||||
(insertAdv adv.s (predV olla))
|
||||
in existClause noSubj (agrP3 Sg) vp ;
|
||||
|
||||
ExistIP ip =
|
||||
let cas : NPForm = NPCase Nom ; ---- also partitive in Extra
|
||||
vp : MorphoEst.VP = insertObj (\\_,b,_ => "olemas") (predV olla) ;
|
||||
@@ -55,4 +63,3 @@ concrete IdiomEst of Idiom = CatEst **
|
||||
|
||||
noSubj : Polarity -> Str = \_ -> [] ;
|
||||
}
|
||||
|
||||
@@ -41,4 +41,8 @@ lin InLN pn = {
|
||||
})
|
||||
} ;
|
||||
|
||||
lin AdjLN ap ln = ln ** {
|
||||
s = \\c => ap.s ! True ! NCase ln.n c ++ ln.s ! c
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -70,6 +70,10 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
||||
|
||||
AdvNP np adv = np ** {postmod = np.postmod ++ adv.s} ;
|
||||
|
||||
ExtAdvNP np adv = np ** {
|
||||
postmod = np.postmod ++ SOFT_BIND ++ "," ++ adv.s
|
||||
} ;
|
||||
|
||||
DetQuantOrd quant num ord = {
|
||||
s = \\c => quant.s ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
|
||||
sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
|
||||
@@ -109,6 +113,22 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
|
||||
|
||||
PossNP cn np = np ** {s = \\nf => linNP (NPCase Gen) np ++ cn.s ! nf} ;
|
||||
|
||||
PartNP cn np = cn ** {
|
||||
postmod = cn.postmod ++ linNP (NPCase Part) np
|
||||
} ;
|
||||
|
||||
CountNP det np =
|
||||
let n : Number = case det.isNum of {
|
||||
True => Sg ;
|
||||
_ => det.n
|
||||
}
|
||||
in emptyNP ** {
|
||||
s = \\c => let k = npform2case n c in
|
||||
det.sp ! k ++ linNP (NPCase Elat) np ;
|
||||
a = agrP3 det.n ;
|
||||
isPron = False
|
||||
} ;
|
||||
|
||||
NumSg = {s = \\_,_ => [] ; isNum = False ; n = Sg} ;
|
||||
NumPl = {s = \\_,_ => [] ; isNum = False ; n = Pl} ;
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@ lin
|
||||
s = \\_,c => d.s ! NumAttr ! c ++ nBIND d.n ++ sataaN.s ! d.n ! c ++
|
||||
e.s ! NumIndep ! c
|
||||
} ;
|
||||
pot21 = pot2 pot01 ;
|
||||
pot2as3 n = {n = n.n ; s = n.s ! NumIndep} ;
|
||||
pot3 d = {n = Pl ; s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c} ;
|
||||
pot3plus d e = {
|
||||
@@ -65,8 +66,26 @@ lin
|
||||
s = \\c => d.s ! NumAttr ! c ++ tuhattaN.s ! d.n ! c ++ e.s ! NumIndep ! c
|
||||
} ;
|
||||
|
||||
pot31 = {n = Pl ; s = tuhatN.s} ;
|
||||
pot3as4 n = n ;
|
||||
pot3decimal d = {n = Pl ; s = \\_ => d.s ! NCard (NCase Sg Nom) ++ "tuhat"} ;
|
||||
|
||||
pot41 = {n = Pl ; s = miljonN.s} ;
|
||||
pot4 d = {n = Pl ; s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljonitN.s ! d.n ! c} ;
|
||||
pot4plus d e = {
|
||||
n = Pl ;
|
||||
s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljonitN.s ! d.n ! c ++ e.s ! c
|
||||
} ;
|
||||
pot4as5 n = n ;
|
||||
pot4decimal d = {n = Pl ; s = \\_ => d.s ! NCard (NCase Sg Nom) ++ "miljonit"} ;
|
||||
|
||||
pot51 = {n = Pl ; s = miljardN.s} ;
|
||||
pot5 d = {n = Pl ; s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljarditN.s ! d.n ! c} ;
|
||||
pot5plus d e = {
|
||||
n = Pl ;
|
||||
s = \\c => d.s ! NumAttr ! NCard (NCase Sg Nom) ++ nBIND d.n ++ miljarditN.s ! d.n ! c ++ e.s ! c
|
||||
} ;
|
||||
pot5decimal d = {n = Pl ; s = \\_ => d.s ! NCard (NCase Sg Nom) ++ "miljardit"} ;
|
||||
|
||||
oper
|
||||
co : (c,o : {s : NForm => Str}) -> {s : CardOrd => Str} = \c,o -> {
|
||||
@@ -98,6 +117,9 @@ oper
|
||||
(mkN "tuhat" "tuhande" "tuhandet" "tuhandesse" "tuhandete" "tuhandeid")
|
||||
(mkN "tuhandes" "tuhandenda" "tuhandendat" "tuhandendasse" "tuhandete" "tuhandendaid") ;
|
||||
|
||||
miljonN = co (mkN "miljon") (mkN "miljones") ;
|
||||
miljardN = co (mkN "miljard") (mkN "miljardes") ;
|
||||
|
||||
kymmendN =
|
||||
{s = table {
|
||||
NCard (NCase Sg Nom) => "kümmend" ;
|
||||
@@ -123,6 +145,24 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
miljonitN : {s : MorphoEst.Number => CardOrd => Str} = {s = table {
|
||||
Sg => miljonN.s ;
|
||||
Pl => table {
|
||||
NCard (NCase Sg Nom) => "miljonit" ;
|
||||
k => miljonN.s ! k
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
miljarditN : {s : MorphoEst.Number => CardOrd => Str} = {s = table {
|
||||
Sg => miljardN.s ;
|
||||
Pl => table {
|
||||
NCard (NCase Sg Nom) => "miljardit" ;
|
||||
k => miljardN.s ! k
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
|
||||
@@ -17,6 +17,10 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
|
||||
verb.fin ++ verb.inf ++ compl ++ vp.p ;
|
||||
} ;
|
||||
|
||||
AdvImp adv imp = {
|
||||
s = \\pol,agr => adv.s ++ imp.s ! pol ! agr
|
||||
} ;
|
||||
|
||||
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
|
||||
|
||||
SlashVP np vp = mkClause (subjForm np vp.sc) np.a vp ** {
|
||||
@@ -60,4 +64,6 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
|
||||
|
||||
RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ; ---- mikä
|
||||
|
||||
SSubjS s1 subj s2 = {s = s1.s ++ SOFT_BIND ++ "," ++ subj.s ++ s2.s} ;
|
||||
|
||||
}
|
||||
@@ -75,8 +75,12 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
|
||||
|
||||
AdvVP vp adv = insertAdv adv.s vp ;
|
||||
|
||||
ExtAdvVP vp adv = insertAdv (SOFT_BIND ++ "," ++ adv.s) vp ;
|
||||
|
||||
AdvVPSlash vp adv = insertAdv adv.s vp ** vp ;
|
||||
|
||||
AdVVPSlash adv vp = insertAdv adv.s vp ** vp ;
|
||||
|
||||
VPSlashPrep vp prep = vp ** {c2 = prep} ;
|
||||
|
||||
AdVVP adv vp = insertAdv adv.s vp ;
|
||||
|
||||
Reference in new issue
Block a user