mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-10-30 10:33:18 -06:00
extensions by codex
This commit is contained in:
1 parent
fb3cf2203b
commit
bd11a65fd5
3 files changed
+127
-4
No files matched your search
@@ -1,6 +1,11 @@
|
|||||||
--# -path=alltenses:../common:../abstract:../romance
|
--# -path=alltenses:../common:../abstract:../romance
|
||||||
concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor -
|
concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor -
|
||||||
[
|
[
|
||||||
|
EmptyRelSlash,
|
||||||
|
BaseVPI, ConsVPI, ConjVPI, MkVPI, ComplVPIVV,
|
||||||
|
RNP, ReflRNP, ReflPron, ReflPoss, PredetRNP,
|
||||||
|
AdvRNP, AdvRVP, AdvRAP, ReflA2RNP, PossPronRNP, ReflPossPron,
|
||||||
|
ProgrVPSlash,
|
||||||
CompoundAP,
|
CompoundAP,
|
||||||
CompoundN,
|
CompoundN,
|
||||||
ExistsNP,
|
ExistsNP,
|
||||||
@@ -31,6 +36,98 @@ concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor -
|
|||||||
(S = StructuralPor),
|
(S = StructuralPor),
|
||||||
(P = ParamX) in {
|
(P = ParamX) in {
|
||||||
|
|
||||||
|
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) ;
|
||||||
|
|
||||||
|
-- A progressive wrapper would consume the object gap. In relative and
|
||||||
|
-- interrogative clauses the Portuguese simple form preserves that 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,_ => reflTonicPron agr ;
|
||||||
|
isPron = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflPoss num cn = {
|
||||||
|
s = \\agr,c => possCase cn.g num.n c ++
|
||||||
|
reflPossDet 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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflA2RNP a rnp = a ** {
|
||||||
|
s = \\af => a.s ! af ++ a.c2.s ++
|
||||||
|
rnp.s ! (aform2aagr af ** {p = P3}) ! a.c2.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 ! ResPor.genitive ;
|
||||||
|
a = agrP3 cn.g num.n ;
|
||||||
|
hasClit = False ;
|
||||||
|
isNeg = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ReflPossPron = PossPron he_Pron ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
reflTonicPron : Agr -> Str = \agr -> case <agr.n,agr.p> of {
|
||||||
|
<Sg,P1> => "mim" ;
|
||||||
|
<Sg,P2> => "ti" ;
|
||||||
|
<Pl,P1> => "nós" ;
|
||||||
|
<Pl,P2> => "vós" ;
|
||||||
|
<_,P3> => "si"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
reflPossDet : Agr -> Number -> Gender -> Str = \agr,n,g ->
|
||||||
|
case <agr.n,agr.p> of {
|
||||||
|
<Sg,P1> => genNumForms "meu" "minha" "meus" "minhas" ! g ! n ;
|
||||||
|
<Sg,P2> => genNumForms "teu" "tua" "teus" "tuas" ! g ! n ;
|
||||||
|
<Sg,P3> => genNumForms "seu" "sua" "seus" "suas" ! g ! n ;
|
||||||
|
<Pl,P1> => genNumForms "nosso" "nossa" "nossos" "nossas" ! g ! n ;
|
||||||
|
<Pl,P2> => genNumForms "vosso" "vossa" "vossos" "vossas" ! g ! n ;
|
||||||
|
<Pl,P3> => genNumForms "seu" "sua" "seus" "suas" ! g ! n
|
||||||
|
} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ExistsNP np =
|
ExistsNP np =
|
||||||
mkClause [] True False np.a
|
mkClause [] True False np.a
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ flags optimize=noexpand ;
|
|||||||
-- if you can find out what is its paradigm and then add it!
|
-- if you can find out what is its paradigm and then add it!
|
||||||
|
|
||||||
lin acontecer_V = mkV (acontecer_Besch "acontecer") ;
|
lin acontecer_V = mkV (acontecer_Besch "acontecer") ;
|
||||||
lin conhecer_V = mkV (acontecer_Besch "conhecer") ;
|
lin conhecer_V = mkV (aquecer_Besch "conhecer") ;
|
||||||
lin coalescer_V = mkV (acontecer_Besch "coalescer") ;
|
lin coalescer_V = mkV (acontecer_Besch "coalescer") ;
|
||||||
lin comparecer_V = mkV (acontecer_Besch "comparecer") ;
|
lin comparecer_V = mkV (acontecer_Besch "comparecer") ;
|
||||||
lin compadecer_V = mkV (acontecer_Besch "compadecer") ;
|
lin compadecer_V = mkV (acontecer_Besch "compadecer") ;
|
||||||
@@ -310,7 +310,7 @@ lin garantir_V = mkV (garantir_Besch "garantir") ;
|
|||||||
lin partir_V = mkV (garantir_Besch "partir") ;
|
lin partir_V = mkV (garantir_Besch "partir") ;
|
||||||
lin haver_V = mkV (haver_Besch "haver") ;
|
lin haver_V = mkV (haver_Besch "haver") ;
|
||||||
lin abolir_V = mkV (imergir_Besch "abolir") ;
|
lin abolir_V = mkV (imergir_Besch "abolir") ;
|
||||||
lin banir_V = mkV (imergir_Besch "banir") ;
|
lin banir_V = mkV "banir" ;
|
||||||
lin brandir_V = mkV (imergir_Besch "brandir") ;
|
lin brandir_V = mkV (imergir_Besch "brandir") ;
|
||||||
lin brunir_V = mkV (imergir_Besch "brunir") ;
|
lin brunir_V = mkV (imergir_Besch "brunir") ;
|
||||||
lin emergir_V = mkV (imergir_Besch "emergir") ;
|
lin emergir_V = mkV (imergir_Besch "emergir") ;
|
||||||
|
|||||||
@@ -113,10 +113,15 @@ concrete NumeralPor of Numeral = CatPor [Numeral,Digits,Decimal] **
|
|||||||
++ m.s ! co ;
|
++ m.s ! co ;
|
||||||
n = Pl} ;
|
n = Pl} ;
|
||||||
|
|
||||||
|
pot3decimal d = {s = \\_ => d.s ! NCard Masc ++ "mil" ; n = Pl} ;
|
||||||
|
|
||||||
|
|
||||||
pot3as4 n = n ;
|
pot3as4 n = n ;
|
||||||
|
|
||||||
pot4 n = {s = table CardOrd {co => n.s ! NCard Masc ++ milhao ! co } ; n = Pl} ;
|
pot4 n = {s = table CardOrd {
|
||||||
|
NCard _ => n.s ! NCard Masc ++ milhao ! NCard Masc ++ "de" ;
|
||||||
|
co => n.s ! NCard Masc ++ milhao ! co
|
||||||
|
} ; n = Pl} ;
|
||||||
|
|
||||||
pot4plus n m = {s = \\co => n.s ! NCard Masc
|
pot4plus n m = {s = \\co => n.s ! NCard Masc
|
||||||
++ milhao ! co
|
++ milhao ! co
|
||||||
@@ -129,10 +134,31 @@ concrete NumeralPor of Numeral = CatPor [Numeral,Digits,Decimal] **
|
|||||||
pot31 = mkNum "mil" "milésimo" ;
|
pot31 = mkNum "mil" "milésimo" ;
|
||||||
|
|
||||||
-- cem, mil, but um milhão, um bilhão
|
-- cem, mil, but um milhão, um bilhão
|
||||||
pot41 = mkNum "um milhão" "milhonésimo" ;
|
pot41 = {s = table CardOrd {
|
||||||
|
NCard _ => "um milhão de" ;
|
||||||
|
NOrd g n => regCard "milhonésimo" g n
|
||||||
|
} ; n = Sg} ;
|
||||||
|
|
||||||
|
pot4decimal d = {s = \\_ => d.s ! NCard Masc ++ "milhões de" ; n = Pl} ;
|
||||||
|
|
||||||
pot4as5 n = n ;
|
pot4as5 n = n ;
|
||||||
|
|
||||||
|
pot51 = {s = \\co => case co of {
|
||||||
|
NCard _ => "um bilhão de" ;
|
||||||
|
NOrd g n => regCard "bilionésimo" g n
|
||||||
|
} ; n = Sg} ;
|
||||||
|
|
||||||
|
pot5 n = {s = \\co => case co of {
|
||||||
|
NCard _ => n.s ! NCard Masc ++ "bilhões de" ;
|
||||||
|
NOrd g k => n.s ! NCard Masc ++ regCard "bilionésimo" g k
|
||||||
|
} ; n = Pl} ;
|
||||||
|
|
||||||
|
pot5plus n m = {s = \\co => n.s ! NCard Masc ++ "bilhões" ++
|
||||||
|
e_CardOrd co ++ m.s ! co ;
|
||||||
|
n = Pl} ;
|
||||||
|
|
||||||
|
pot5decimal d = {s = \\_ => d.s ! NCard Masc ++ "bilhões de" ; n = Pl} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
milhao : CardOrd => Str ;
|
milhao : CardOrd => Str ;
|
||||||
milhao = mkNumStr "milhão" "milhonésimo" ;
|
milhao = mkNumStr "milhão" "milhonésimo" ;
|
||||||
|
|||||||
Reference in new issue
Block a user