mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-10-29 18:33:17 -06:00
extensions by Codex
This commit is contained in:
1 parent
cf8fdd7cec
commit
1ddd8bd16c
3 files changed
+159
-1
No files matched your search
@@ -31,6 +31,7 @@ lin
|
|||||||
is_wrong_VP = mkVP (reflV (mkV "sbagliare")) ;
|
is_wrong_VP = mkVP (reflV (mkV "sbagliare")) ;
|
||||||
|
|
||||||
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn)))) (lin A a) ;
|
||||||
|
n_units_of_NP card cn np = mkNP card (mkCN (lin N2 cn) np) ;
|
||||||
|
|
||||||
bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "bottiglia" feminine) part_Prep)) np ;
|
bottle_of_CN np = mkCN (lin N2 (mkN2 (mkN "bottiglia" feminine) part_Prep)) np ;
|
||||||
cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "tazza") part_Prep)) np ;
|
cup_of_CN np = mkCN (lin N2 (mkN2 (mkN "tazza") part_Prep)) np ;
|
||||||
@@ -81,6 +82,7 @@ lin InLanguage l = SyntaxIta.mkAdv (mkPrep "in") (mkNP l) ;
|
|||||||
|
|
||||||
lin
|
lin
|
||||||
weekdayN w = w ;
|
weekdayN w = w ;
|
||||||
|
monthN m = m ;
|
||||||
|
|
||||||
weekdayPN w = mkPN w ;
|
weekdayPN w = mkPN w ;
|
||||||
monthPN m = mkPN m ;
|
monthPN m = mkPN m ;
|
||||||
|
|||||||
+128
-1
@@ -1,6 +1,13 @@
|
|||||||
--# -path=alltenses:../common:../abstract:../romance
|
--# -path=alltenses:../common:../abstract:../romance
|
||||||
concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor -
|
concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor -
|
||||||
[
|
[
|
||||||
|
EmptyRelSlash,
|
||||||
|
BaseVPI, ConsVPI, ConjVPI, MkVPI, ComplVPIVV,
|
||||||
|
BaseComp, ConsComp, ConjComp, BaseImp, ConsImp, ConjImp,
|
||||||
|
RNP, ReflRNP, ReflPron, ReflPoss, PredetRNP,
|
||||||
|
AdvRNP, AdvRVP, AdvRAP, PossPronRNP,
|
||||||
|
PresPartAP, GerundNP, GerundCN,
|
||||||
|
CompoundAP, InOrderToVP, CompVP,
|
||||||
GenRP,
|
GenRP,
|
||||||
PassVPSlash, PassAgentVPSlash,
|
PassVPSlash, PassAgentVPSlash,
|
||||||
ExistsNP
|
ExistsNP
|
||||||
@@ -17,10 +24,120 @@ concrete ExtendIta of Extend = CatIta ** ExtendRomanceFunctor -
|
|||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
ParadigmsIta,
|
ParadigmsIta,
|
||||||
IrregIta in {
|
IrregIta,
|
||||||
|
(P = ParamX) in {
|
||||||
-- put your own definitions here
|
-- put your own definitions here
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
EmptyRelSlash = RelSlash IdRP ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
RNP = {s : Agr => Case => Str ; isPron : Bool} ;
|
||||||
|
VPI = {s : Agr => Str} ;
|
||||||
|
[VPI] = {s1,s2 : Agr => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
MkVPI vp = {s = \\a => infVP vp RPos a} ;
|
||||||
|
BaseVPI = twoTable Agr ;
|
||||||
|
ConsVPI = consrTable Agr comma ;
|
||||||
|
ConjVPI = conjunctDistrTable Agr ;
|
||||||
|
ComplVPIVV vv vpi =
|
||||||
|
insertComplement (\\a => prepCase vv.c2.c ++ vpi.s ! a) (predV vv) ;
|
||||||
|
|
||||||
|
lincat [Comp] = {s1,s2 : Agr => Str ; cop : CopulaType} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseComp x y = twoTable Agr x y ** {cop = x.cop} ;
|
||||||
|
ConsComp xs x = consrTable Agr comma xs x ** xs ;
|
||||||
|
ConjComp conj cs = conjunctDistrTable Agr conj cs ** {cop = cs.cop} ;
|
||||||
|
|
||||||
|
lincat [Imp] = {s1,s2 : RPolarity => P.ImpForm => Gender => Str} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseImp = twoTable3 RPolarity P.ImpForm Gender ;
|
||||||
|
ConsImp = consrTable3 RPolarity P.ImpForm Gender comma ;
|
||||||
|
ConjImp = conjunctDistrTable3 RPolarity P.ImpForm Gender ;
|
||||||
|
|
||||||
|
-- The simple form is idiomatic in the relative and interrogative
|
||||||
|
-- contexts where a progressive VPSlash is used, and preserves the gap.
|
||||||
|
ProgrVPSlash vps = vps ;
|
||||||
|
|
||||||
|
ReflRNP v rnp = case <rnp.isPron,v.c2.isDir> of {
|
||||||
|
<True,True> => insertRefl v ;
|
||||||
|
_ => insertComplement
|
||||||
|
(\\a => let agr = verbAgr a in
|
||||||
|
v.c2.s ++ rnp.s ! agr ! v.c2.c) v
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflPron = {
|
||||||
|
s = \\agr,c => reflPron agr.n agr.p c ;
|
||||||
|
isPron = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflPoss num cn = {
|
||||||
|
s = \\agr,c => possCase cn.g num.n c ++
|
||||||
|
possDet agr num.n cn.g ++ cn.s ! num.n ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PredetRNP pred rnp = {
|
||||||
|
s = \\agr,c => pred.s ! complAgr agr ! c ++ rnp.s ! agr ! pred.c ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvRNP np prep rnp = {
|
||||||
|
s = \\agr,c => (np.s ! c).ton ++ prep.s ++ rnp.s ! agr ! prep.c ;
|
||||||
|
isPron = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
AdvRVP vp prep rnp =
|
||||||
|
insertComplement (\\a => prep.s ++ rnp.s ! verbAgr a ! prep.c) vp ;
|
||||||
|
|
||||||
|
AdvRAP ap prep rnp = ap ** {
|
||||||
|
s = \\af => ap.s ! af ++ prep.s ++
|
||||||
|
rnp.s ! (aform2aagr af ** {p = P3}) ! prep.c ;
|
||||||
|
isPre = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PossPronRNP pron num cn rnp = heavyNP {
|
||||||
|
s = \\c => possCase cn.g num.n c ++ pron.poss ! num.n ! cn.g ++
|
||||||
|
cn.s ! num.n ++ rnp.s ! pron.a ! ResIta.genitive ;
|
||||||
|
a = agrP3 cn.g num.n ;
|
||||||
|
hasClit = False ;
|
||||||
|
isNeg = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PresPartAP vp = {
|
||||||
|
s = \\af =>
|
||||||
|
let agr = aform2aagr af ** {p = P3} ;
|
||||||
|
in vp.s.s ! VPresPart ++ vp.comp ! agr ++ vp.ext ! RPos ;
|
||||||
|
isPre = False ;
|
||||||
|
copTyp = serCopula
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundNP vp = let agr = Ag Masc Sg P3 in heavyNP {
|
||||||
|
s = \\_ => infVP vp RPos agr ;
|
||||||
|
a = agr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundCN vp = {
|
||||||
|
s = \\n => infVP vp RPos (Ag Masc n P3) ;
|
||||||
|
g = Masc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompoundAP noun adj = {
|
||||||
|
s = \\af => adj.s ! af ++ "da" ++ noun.s ! (aform2number af) ;
|
||||||
|
isPre = adj.isPre ;
|
||||||
|
copTyp = adj.copTyp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InOrderToVP vp = {s = "per" ++ infStr vp} ;
|
||||||
|
|
||||||
|
CompVP ant pol vp = {
|
||||||
|
s = \\agr => ant.s ++ pol.s ++ infVP vp pol.p agr ;
|
||||||
|
cop = serCopula
|
||||||
|
} ;
|
||||||
|
|
||||||
GenRP nu cn = {
|
GenRP nu cn = {
|
||||||
s = \\_b,_aagr,_c => "di cui" ++ num ++ cn.s ! n ;
|
s = \\_b,_aagr,_c => "di cui" ++ num ++ cn.s ! n ;
|
||||||
a = aagr g n ;
|
a = aagr g n ;
|
||||||
@@ -39,6 +156,16 @@ lin PassVPSlash vps = passVPSlash vps [] ;
|
|||||||
vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
possDet : Agr -> Number -> Gender -> Str = \agr,n,g ->
|
||||||
|
case <agr.n,agr.p> of {
|
||||||
|
<Sg,P1> => i_Pron.poss ! n ! g ;
|
||||||
|
<Sg,P2> => youSg_Pron.poss ! n ! g ;
|
||||||
|
<Sg,P3> => he_Pron.poss ! n ! g ;
|
||||||
|
<Pl,P1> => we_Pron.poss ! n ! g ;
|
||||||
|
<Pl,P2> => youPl_Pron.poss ! n ! g ;
|
||||||
|
<Pl,P3> => they_Pron.poss ! n ! g
|
||||||
|
} ;
|
||||||
|
|
||||||
passVPSlash : VPSlash -> Str -> VP = \vps, agent ->
|
passVPSlash : VPSlash -> Str -> VP = \vps, agent ->
|
||||||
let auxvp = predV auxPassive
|
let auxvp = predV auxPassive
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -64,6 +64,10 @@ lin pot1as2 n = n ;
|
|||||||
|
|
||||||
lin pot2 d = spl (\\co => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++
|
lin pot2 d = spl (\\co => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++
|
||||||
(mkTall "cento" [] [] [] "cent").s ! ental indip ! co) ;
|
(mkTall "cento" [] [] [] "cent").s ! ental indip ! co) ;
|
||||||
|
lin pot21 = spl (table {
|
||||||
|
NCard _ => "cento" ;
|
||||||
|
NOrd g n => regOrdpred "cent" g n
|
||||||
|
}) ;
|
||||||
lin pot2plus d e =
|
lin pot2plus d e =
|
||||||
{s = table {NCard g => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++"cento" ++ BIND ++e.s ! NCard Masc ;
|
{s = table {NCard g => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++"cento" ++ BIND ++e.s ! NCard Masc ;
|
||||||
NOrd g n => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++"cento" ++ BIND ++ e.s ! NOrd g n};
|
NOrd g n => d.s ! ental indip ! NCard Masc ++ nBIND d.n ++"cento" ++ BIND ++ e.s ! NOrd g n};
|
||||||
@@ -71,11 +75,36 @@ lin pot2plus d e =
|
|||||||
lin pot2as3 n = n ;
|
lin pot2as3 n = n ;
|
||||||
lin pot3 n = spl (\\co => n.s ! NCard Masc ++ nBIND n.n ++
|
lin pot3 n = spl (\\co => n.s ! NCard Masc ++ nBIND n.n ++
|
||||||
(mkTall (mille ! n.n) [] [] [] "mill").s ! ental indip ! co ) ;
|
(mkTall (mille ! n.n) [] [] [] "mill").s ! ental indip ! co ) ;
|
||||||
|
lin pot31 = spl (table {
|
||||||
|
NCard _ => "mille" ;
|
||||||
|
NOrd g n => regOrdpred "mill" g n
|
||||||
|
}) ;
|
||||||
|
|
||||||
lin pot3plus n m = {s = \\g => n.s ! NCard Masc ++ nBIND n.n ++ mille ! n.n ++ "e" ++ m.s ! g ; n = Pl} ;
|
lin pot3plus n m = {s = \\g => n.s ! NCard Masc ++ nBIND n.n ++ mille ! n.n ++ "e" ++ m.s ! g ; n = Pl} ;
|
||||||
|
lin pot3decimal d = {s = \\_ => d.s ! NCard Masc ++ "mila" ; n = Pl} ;
|
||||||
|
|
||||||
lin pot3as4 n = n ;
|
lin pot3as4 n = n ;
|
||||||
|
lin pot41 = {s = \\co => case co of {
|
||||||
|
NCard _ => "un milione" ;
|
||||||
|
NOrd g n => regOrdpred "milion" g n
|
||||||
|
} ; n = Sg} ;
|
||||||
|
lin pot4 n = {s = \\co => n.s ! NCard Masc ++ case co of {
|
||||||
|
NCard _ => "milioni" ;
|
||||||
|
NOrd g k => regOrdpred "milion" g k
|
||||||
|
} ; n = Pl} ;
|
||||||
|
lin pot4plus n m = {s = \\co => n.s ! NCard Masc ++ "milioni" ++ m.s ! co ; n = Pl} ;
|
||||||
|
lin pot4decimal d = {s = \\_ => d.s ! NCard Masc ++ "milioni" ; n = Pl} ;
|
||||||
lin pot4as5 n = n ;
|
lin pot4as5 n = n ;
|
||||||
|
lin pot51 = {s = \\co => case co of {
|
||||||
|
NCard _ => "un miliardo" ;
|
||||||
|
NOrd g n => regOrdpred "miliard" g n
|
||||||
|
} ; n = Sg} ;
|
||||||
|
lin pot5 n = {s = \\co => n.s ! NCard Masc ++ case co of {
|
||||||
|
NCard _ => "miliardi" ;
|
||||||
|
NOrd g k => regOrdpred "miliard" g k
|
||||||
|
} ; n = Pl} ;
|
||||||
|
lin pot5plus n m = {s = \\co => n.s ! NCard Masc ++ "miliardi" ++ m.s ! co ; n = Pl} ;
|
||||||
|
lin pot5decimal d = {s = \\_ => d.s ! NCard Masc ++ "miliardi" ; n = Pl} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
nBIND : Number -> Str = \n -> case n of {Sg => [] ; _ => BIND} ; -- no BIND after silent 1
|
nBIND : Number -> Str = \n -> case n of {Sg => [] ; _ => BIND} ; -- no BIND after silent 1
|
||||||
|
|||||||
Reference in new issue
Block a user