mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-29 04:46:30 -06:00
(Romance,Por,Spa) refactor Extend{Por,Spa} into ExtendRomanceFunctor
- couldn't get a functor on top of another working in GFSS2018, so now we just copy the relevant definitions from ExtendFunctor and add the Romance-specific ones - add stare_V to DiffRomance (and essere_V for symmetry) so that we can use it in ExtendRomance; using Latin verb name for fairness; - add two missing lins to ExtendFunctor + related changes
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
concrete ConstructionPor of Construction = CatPor **
|
||||
open SyntaxPor, SymbolicPor, ParadigmsPor, BeschPor,
|
||||
(L = LexiconPor), (B = DiffPor), (R = ResPor),
|
||||
(L = LexiconPor), (D = DiffPor), (R = ResPor),
|
||||
(S = SyntaxPor), (C = CommonRomance), CommonRomance,
|
||||
Prelude in {
|
||||
flags coding=utf8 ;
|
||||
@@ -22,13 +22,13 @@ lin
|
||||
|
||||
what_name_QCl x = mkQCl how_IAdv (mkCl (lin NP x) (reflV (mkV "chamar"))) ;
|
||||
how_old_QCl x = mkQCl (mkIP how8many_IDet L.year_N) x have_V2 ;
|
||||
how_far_QCl x = mkQCl (lin IAdv (ss "a que distância")) (mkCl x B.estar_V) ;
|
||||
how_far_QCl x = mkQCl (lin IAdv (ss "a que distância")) (mkCl x D.stare_V) ;
|
||||
|
||||
-- some more things
|
||||
weather_adjCl ap = mkCl (mkVP (mkVA (mkV (fazer_Besch "fazer"))) (lin AP ap)) ;
|
||||
|
||||
is_right_VP = mkVP (mkVA B.estar_V) (mkAP (mkA "certo")) ;
|
||||
is_wrong_VP = mkVP (mkVA B.estar_V) (mkAP (mkA "errado")) ;
|
||||
is_right_VP = mkVP (mkVA D.stare_V) (mkAP (mkA "certo")) ;
|
||||
is_wrong_VP = mkVP (mkVA D.stare_V) (mkAP (mkA "errado")) ;
|
||||
|
||||
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn))))
|
||||
(lin A a) ;
|
||||
@@ -225,4 +225,4 @@ lin thai_Language = mkLanguage "tailandês" ;
|
||||
lin turkish_Language = mkLanguage "turco" ;
|
||||
lin urdu_Language = mkLanguage "urdu" ;
|
||||
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../romance:../abstract:../common:../prelude
|
||||
|
||||
instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoPor, BeschPor, Prelude in {
|
||||
instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,stare_V,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoPor, BeschPor, Prelude in {
|
||||
|
||||
flags optimize=noexpand ;
|
||||
coding=utf8 ;
|
||||
@@ -87,8 +87,8 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
||||
oper
|
||||
CopulaType = Copula ;
|
||||
selectCopula coptyp = case coptyp of {
|
||||
SerCop => copula ;
|
||||
EstarCop => estar_V ;
|
||||
SerCop => essere_V ;
|
||||
EstarCop => stare_V ;
|
||||
FicarCop => ficar_V
|
||||
} ;
|
||||
|
||||
@@ -263,14 +263,14 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
||||
<_, Pl,P3> => cases3 "os" "seus" "eles"
|
||||
} ;
|
||||
|
||||
estar_V : Verb = verboV (estar_Besch "estar") ;
|
||||
essere_V : Verb = verboV (ser_Besch "ser") ;
|
||||
stare_V : Verb = verboV (estar_Besch "estar") ;
|
||||
|
||||
haver_V : Verb = verboV (haver_Besch "haver") ;
|
||||
|
||||
ficar_V : Verb = verboV (ficar_Besch "ficar") ;
|
||||
|
||||
verboV : Verbum -> Verb ;
|
||||
-- make a verb of type haver
|
||||
verboV v = verbBesch v ** {vtyp = VHabere ; p = [] ; lock_V = <>} ;
|
||||
|
||||
}
|
||||
} ;
|
||||
|
||||
+30
-235
@@ -1,81 +1,39 @@
|
||||
--# -path=alltenses:../common:../abstract
|
||||
|
||||
concrete ExtendPor of Extend =
|
||||
CatPor ** ExtendFunctor -
|
||||
--# -path=alltenses:../common:../abstract:../romance
|
||||
concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor -
|
||||
[
|
||||
AdAdV,
|
||||
AdjAsCN,
|
||||
AdjAsNP,
|
||||
ApposNP,
|
||||
BaseVPS,
|
||||
ByVP,
|
||||
CompBareCN,
|
||||
ComplBareVS,
|
||||
ComplSlashPartLast,
|
||||
CompoundAP,
|
||||
CompoundN,
|
||||
CompVP,
|
||||
ConjVPS,
|
||||
ConsVPS,
|
||||
--EmptyRelSlash,
|
||||
ExistsNP,
|
||||
GenIP,
|
||||
GenModIP,
|
||||
GenModNP,
|
||||
GenNP,
|
||||
GerundAdv,
|
||||
GerundCN,
|
||||
GerundNP,
|
||||
IAdvAdv,
|
||||
ICompAP,
|
||||
InOrderToVP,
|
||||
ListVPS,
|
||||
MkVPS,
|
||||
PassAgentVPSlash,
|
||||
PassVPSlash,
|
||||
PastPartAP,
|
||||
PastPartAgentAP,
|
||||
PositAdVAdj,
|
||||
PredVPS,
|
||||
PresPartAP,
|
||||
ProDrop,
|
||||
PurposeVP,
|
||||
UseComp_estar,
|
||||
VPS,
|
||||
iFem_Pron,
|
||||
theyFem_Pron,
|
||||
UttAdV,
|
||||
UttVPShort,
|
||||
weFem_Pron,
|
||||
WithoutVP,
|
||||
youFem_Pron,
|
||||
youPlFem_Pron,
|
||||
youPolFem_Pron,
|
||||
youPolPlFem_Pron,
|
||||
youPolPl_Pron
|
||||
] -- don't forget to put the names of your own
|
||||
CompoundAP,
|
||||
CompoundN,
|
||||
ExistsNP,
|
||||
GenRP,
|
||||
GenRP,
|
||||
ICompAP,
|
||||
InOrderToVP,
|
||||
WithoutVP,
|
||||
iFem_Pron,
|
||||
theyFem_Pron,
|
||||
weFem_Pron,
|
||||
youFem_Pron,
|
||||
youPlFem_Pron,
|
||||
youPolFem_Pron,
|
||||
youPolPlFem_Pron,
|
||||
youPolPl_Pron
|
||||
] -- don't forget to put the names of your own
|
||||
-- definitions here
|
||||
with
|
||||
(Grammar = GrammarPor), (Syntax = SyntaxPor) **
|
||||
(Grammar = GrammarPor), (Syntax = SyntaxPor), (ResRomance = ResPor) **
|
||||
open
|
||||
GrammarPor,
|
||||
ResPor,
|
||||
MorphoPor,
|
||||
Coordination,
|
||||
Prelude,
|
||||
ParadigmsPor,
|
||||
(L = LexiconPor),
|
||||
(S = StructuralPor) in {
|
||||
|
||||
lin
|
||||
GenNP np =
|
||||
let denp = (np.s ! ResPor.genitive).ton in {
|
||||
s = \\_,_,_,_ => [] ;
|
||||
sp = \\_,_,_ => denp ;
|
||||
s2 = denp ;
|
||||
isNeg = False ;
|
||||
} ;
|
||||
|
||||
GenIP ip = {s = \\_,_,c => ip.s ! c} ;
|
||||
lin
|
||||
ExistsNP np =
|
||||
mkClause [] True False np.a
|
||||
(insertComplement (\\_ => (np.s ! Nom).ton)
|
||||
(predV exist_V)) ;
|
||||
|
||||
GenRP nu cn = {
|
||||
s = \\_b,_aagr,_c => cujo ! g ! n ++ num ++ cn.s ! n ;
|
||||
@@ -88,56 +46,7 @@ concrete ExtendPor of Extend =
|
||||
num = if_then_Str nu.isNum (nu.s ! g) []
|
||||
} ;
|
||||
|
||||
GenModNP num np cn = DetCN (DetQuant (GenNP (lin NP np)) num) cn ;
|
||||
|
||||
GenModIP num ip cn = IdetCN (IdetQuant (GenIP (lin IP ip)) num) cn ;
|
||||
|
||||
CompBareCN cn = {
|
||||
s = \\agr => cn.s ! agr.n ;
|
||||
cop = serCopula
|
||||
} ;
|
||||
|
||||
EmptyRelSlash cls = {
|
||||
s = \\agr,t,a,p,m => cls.s ! agr ! DDir ! t ! a ! p ! m ++ cls.c2.s ;
|
||||
c = Nom
|
||||
} ;
|
||||
|
||||
---- these come from ExtraRomance: how to avoid the repetition?
|
||||
---- can't seem to be able to use two functors
|
||||
lincat
|
||||
VPS = {s : Mood => Agr => Bool => Str} ;
|
||||
[VPS] = {s1,s2 : Mood => Agr => Bool => Str} ;
|
||||
|
||||
lin
|
||||
BaseVPS x y = twoTable3 Mood Agr Bool x y ;
|
||||
ConsVPS = consrTable3 Mood Agr Bool comma ;
|
||||
|
||||
PredVPS np vpi = {
|
||||
s = \\m => (np.s ! Nom).comp ++ vpi.s ! m ! np.a ! np.isNeg
|
||||
} ;
|
||||
|
||||
MkVPS tm p vp = {
|
||||
s = \\m,agr,isNeg =>
|
||||
tm.s ++ p.s ++
|
||||
(mkClausePol (orB isNeg vp.isNeg) [] False False agr vp).s
|
||||
! DDir ! tm.t ! tm.a ! p.p ! m
|
||||
} ;
|
||||
|
||||
ConjVPS = conjunctDistrTable3 Mood Agr Bool ;
|
||||
|
||||
lin
|
||||
ProDrop p = {
|
||||
s = table {
|
||||
Nom => let pn = p.s ! Nom in {c1 = pn.c1 ; c2 = pn.c2 ; comp = [] ; ton = pn.ton} ;
|
||||
c => p.s ! c
|
||||
} ;
|
||||
a = p.a ;
|
||||
poss = p.poss ;
|
||||
hasClit = p.hasClit ;
|
||||
isPol = p.isPol ;
|
||||
isNeg = False
|
||||
} ;
|
||||
|
||||
ICompAP ap = {
|
||||
s =\\a => "o quão" ++ ap.s ! (genNum2Aform a.g a.n) ;
|
||||
cop = serCopula
|
||||
@@ -147,63 +56,9 @@ concrete ExtendPor of Extend =
|
||||
s = "o quão" ++ adv.s
|
||||
} ;
|
||||
|
||||
CompIQuant iq = {s = \\aa => iq.s ! aa.n ! aa.g ! Nom ; cop = serCopula} ;
|
||||
|
||||
PrepCN prep cn = {s = prep.s ++ prepCase prep.c ++ cn.s ! Sg} ;
|
||||
|
||||
lin
|
||||
PresPartAP vp = {
|
||||
s = \\af => gerVP vp (aform2aagr af ** {p = P3}) ;
|
||||
isPre = False ;
|
||||
copTyp = serCopula
|
||||
} ;
|
||||
|
||||
PastPartAP vps = pastPartAP vps [] ;
|
||||
|
||||
PastPartAgentAP vps np = pastPartAP vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
||||
|
||||
PassVPSlash vps = passVPSlash vps [] ;
|
||||
|
||||
PassAgentVPSlash vps np = passVPSlash vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
||||
|
||||
ExistsNP np =
|
||||
mkClause [] True False np.a
|
||||
(insertComplement (\\_ => (np.s ! Nom).ton)
|
||||
(predV (mkV "existir"))) ;
|
||||
|
||||
PurposeVP vp = {
|
||||
s = infVP vp (Ag Masc Sg P3)
|
||||
} ;
|
||||
|
||||
ComplBareVS = ComplVS ;
|
||||
|
||||
AdjAsCN ap = {
|
||||
s =\\n => ap.s ! (genNum2Aform Masc n) ;
|
||||
g = Masc
|
||||
} ;
|
||||
|
||||
AdjAsNP ap = heavyNP {
|
||||
s = \\_c => ap.s ! ASg Masc APred ;
|
||||
a = Ag Masc Sg P3
|
||||
} ;
|
||||
|
||||
oper
|
||||
pastPartAP : VPSlash -> Str -> AP ;
|
||||
pastPartAP vps agent = lin AP {
|
||||
s = \\af => vps.comp ! (aform2aagr af ** {p = P3}) ++ vps.s.s ! VPart (aform2gender af) (aform2number af) ++ agent ;
|
||||
isPre = False ;
|
||||
copTyp = serCopula
|
||||
} ;
|
||||
|
||||
passVPSlash : VPSlash -> Str -> VP ;
|
||||
passVPSlash vps agent = let
|
||||
auxvp = predV auxPassive
|
||||
in
|
||||
vps ** {
|
||||
s = auxvp.s ;
|
||||
agr = auxvp.agr ;
|
||||
comp = \\a => vps.comp ! a ++ (let agr = complAgr a in vps.s.s ! VPart agr.g agr.n) ++ agent ;
|
||||
} ;
|
||||
exist_V : V ;
|
||||
exist_V = mkV "existir" ;
|
||||
|
||||
lin
|
||||
CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english
|
||||
@@ -221,75 +76,15 @@ concrete ExtendPor of Extend =
|
||||
copTyp = adj.copTyp
|
||||
} ;
|
||||
|
||||
GerundCN vp = {
|
||||
s = \\n => infVP vp {g = Masc ; n = n ; p = P3} ;
|
||||
g = Masc
|
||||
} ;
|
||||
|
||||
GerundNP vp = let
|
||||
neutrAgr = Ag Masc Sg P3
|
||||
in heavyNP {
|
||||
s = \\_ => gerVP vp neutrAgr ;
|
||||
a = neutrAgr
|
||||
} ;
|
||||
|
||||
GerundAdv vp = {
|
||||
s = gerundStr vp
|
||||
} ;
|
||||
|
||||
WithoutVP vp = {
|
||||
s = "sem" ++ gerundStr vp
|
||||
} ;
|
||||
|
||||
ByVP vp = {
|
||||
s = "by" ++ gerundStr vp
|
||||
s = "sem" ++ infStr vp
|
||||
} ;
|
||||
|
||||
InOrderToVP vp = {
|
||||
s = "a fim de" ++ gerundStr vp
|
||||
s = "a fim de" ++ infStr vp
|
||||
} ;
|
||||
|
||||
ApposNP np1 np2 = np1 ** {
|
||||
s = \\c => {
|
||||
c1 = (np1.s ! c).c1 ++ (np2.s ! c).c1 ;
|
||||
c2 = (np1.s ! c).c2 ++ (np2.s ! c).c2 ;
|
||||
comp = (np1.s ! c).comp ++ (np2.s ! c).comp ;
|
||||
ton = (np1.s ! c).ton ++ (np2.s ! c).ton
|
||||
} ;
|
||||
} ;
|
||||
|
||||
AdAdV aa av = {
|
||||
s = aa.s ++ av.s
|
||||
} ;
|
||||
|
||||
UttAdV av = av ;
|
||||
|
||||
PositAdVAdj a = {
|
||||
s = a.s ! Posit ! AA
|
||||
} ;
|
||||
|
||||
--TODO: actually use ant
|
||||
CompVP ant p vp = let
|
||||
neg = negation ! p.p
|
||||
in {
|
||||
s = \\agr => ant.s ++ p.s ++ "de" ++ neg.p1 ++ infVP vp agr ;
|
||||
cop = serCopula
|
||||
} ;
|
||||
|
||||
UttVPShort = UttVP ;
|
||||
|
||||
ComplSlashPartLast = ComplSlash ;
|
||||
|
||||
oper
|
||||
gerundStr : VP -> Str ;
|
||||
gerundStr vp = gerVP vp (Ag Masc Sg P3) ;
|
||||
|
||||
lin
|
||||
UncontractedNeg = {s = [] ; p = RNeg False} ;
|
||||
|
||||
-- Romance
|
||||
UseComp_estar comp = insertComplement comp.s (predV estar_V) ;
|
||||
|
||||
iFem_Pron = pronAgr S.i_Pron Fem Sg P1 ;
|
||||
weFem_Pron = pronAgr S.we_Pron Fem Pl P1 ;
|
||||
youFem_Pron = pronAgr S.youSg_Pron Fem Sg P3 ;
|
||||
|
||||
@@ -46,7 +46,7 @@ concrete IdiomPor of Idiom = CatPor **
|
||||
in
|
||||
vp.s.s ! VGer ++ clpr.p1 ++ obj
|
||||
)
|
||||
(predV B.estar_V) ;
|
||||
(predV B.stare_V) ;
|
||||
|
||||
ImpPl1 vp = {s =
|
||||
mkImperative False P1 vp ! RPos ! Masc ! Pl ; --- fem
|
||||
|
||||
Reference in New Issue
Block a user