forked from GitHub/gf-rgl
Merge branch 'master' of https://github.com/GrammaticalFramework/gf-rgl into persian
This commit is contained in:
@@ -29,7 +29,7 @@ concrete IdiomAra of Idiom = CatAra ** open
|
|||||||
|
|
||||||
-- : NP -> Cl ; -- there is a house
|
-- : NP -> Cl ; -- there is a house
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
predVP (emptyNP ** {s=\\c=>"هُنَاكَ"}) (UseComp (CompNP np)) ; -- IL
|
predVP (indeclNP "هُنَاكَ" Sg) (UseComp (CompNP np)) ; -- IL
|
||||||
|
|
||||||
-- : IP -> QCl ; -- which houses are there
|
-- : IP -> QCl ; -- which houses are there
|
||||||
ExistIP ip = let cl = ExistNP (ip2np ip False) in {
|
ExistIP ip = let cl = ExistNP (ip2np ip False) in {
|
||||||
@@ -40,7 +40,7 @@ concrete IdiomAra of Idiom = CatAra ** open
|
|||||||
|
|
||||||
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
-- : NP -> Adv -> Cl ; -- there is a house in Paris
|
||||||
ExistNPAdv np adv =
|
ExistNPAdv np adv =
|
||||||
predVP (emptyNP ** {s=\\c=>"هُنَاكَ"}) (AdvVP (UseComp (CompNP np)) adv) ; -- IL
|
predVP (indeclNP "هُنَاكَ" Sg) (AdvVP (UseComp (CompNP np)) adv) ; -- IL
|
||||||
|
|
||||||
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
-- ExistIPAdv : IP -> Adv -> QCl ; -- which houses are there in Paris
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:prelude
|
--# -path=.:../romance:../abstract:../common:prelude
|
||||||
instance DiffCat of DiffRomance - [partAgr,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoCat, BeschCat, Prelude in {
|
instance DiffCat of DiffRomance - [partAgr,stare_V,vpAgrSubj,vpAgrClits] = open CommonRomance, PhonoCat, BeschCat, Prelude in {
|
||||||
|
|
||||||
flags optimize=noexpand ;
|
flags optimize=noexpand ;
|
||||||
coding=utf8 ;
|
coding=utf8 ;
|
||||||
@@ -199,12 +199,10 @@ oper
|
|||||||
_ => False
|
_ => False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
auxPassive : Verb = verbBeschH (estar_54 "estar") ;
|
haver_V, auxPassive : Verb = verbBeschH (estar_54 "estar") ;
|
||||||
|
|
||||||
copula = verbBeschH (ser_52 "ser") ;
|
essere_V, copula = verbBeschH (ser_52 "ser") ;
|
||||||
estar_V = verbBeschH (estar_54 "estar") ;
|
stare_V, estar_V = verbBeschH (estar_54 "estar") ;
|
||||||
|
|
||||||
haver_V : Verb = verbBeschH (haver_59 "haver" True) ;
|
|
||||||
|
|
||||||
verbBeschH : Verbum -> Verb = \v -> verbBesch v ** {vtyp = VHabere ; p = []} ;
|
verbBeschH : Verbum -> Verb = \v -> verbBesch v ** {vtyp = VHabere ; p = []} ;
|
||||||
|
|
||||||
|
|||||||
@@ -105,10 +105,12 @@ lin
|
|||||||
youPolFem_Pron = youPol_Pron ; -- DEFAULT you polite (masc)
|
youPolFem_Pron = youPol_Pron ; -- DEFAULT you polite (masc)
|
||||||
youPolPl_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
youPolPl_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
||||||
youPolPlFem_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
youPolPlFem_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
||||||
|
UncontractedNeg = variants {} ; -- do not, etc, as opposed to don't
|
||||||
UttAccNP = UttNP ; -- him (accusative) ; DEFAULT he
|
UttAccNP = UttNP ; -- him (accusative) ; DEFAULT he
|
||||||
UttDatNP np = UttAccNP (lin NP np) ; -- him(dative) ; DEFAULT he
|
UttDatNP np = UttAccNP (lin NP np) ; -- him(dative) ; DEFAULT he
|
||||||
UttAccIP = UttIP ; -- whom (accusative) ; DEFAULT who
|
UttAccIP = UttIP ; -- whom (accusative) ; DEFAULT who
|
||||||
UttDatIP ip = UttAccIP (lin IP ip) ; -- whom (dative) ; DEFAULT who
|
UttDatIP ip = UttAccIP (lin IP ip) ; -- whom (dative) ; DEFAULT who
|
||||||
|
UttVPShort = UttVP ; -- have fun, as opposed to "to have fun" ; DEFAULT UttVP
|
||||||
|
|
||||||
oper
|
oper
|
||||||
quoted : Str -> Str = \s -> "\"" ++ s ++ "\"" ; ---- TODO bind ; move to Prelude?
|
quoted : Str -> Str = \s -> "\"" ++ s ++ "\"" ; ---- TODO bind ; move to Prelude?
|
||||||
|
|||||||
@@ -246,9 +246,7 @@ instance DiffFre of DiffRomance - [
|
|||||||
|
|
||||||
getVTypT : VType -> VBool = \t -> case t of {VTyp _ b => b} ; -- only in Fre
|
getVTypT : VType -> VBool = \t -> case t of {VTyp _ b => b} ; -- only in Fre
|
||||||
|
|
||||||
auxPassive : Verb = copula ;
|
copula, auxPassive, essere_V : Verb = {s = table VF ["être";bindHyphen;"suis";"es";"est";"sommes";"êtes";"sont";"sois";"sois"
|
||||||
|
|
||||||
copula : Verb = {s = table VF ["être";bindHyphen;"suis";"es";"est";"sommes";"êtes";"sont";"sois";"sois"
|
|
||||||
;"soit";"soyons";"soyez";"soient";
|
;"soit";"soyons";"soyez";"soient";
|
||||||
"étais";"étais";"était";"étions";"étiez";"étaient";--# notpresent
|
"étais";"étais";"était";"étions";"étiez";"étaient";--# notpresent
|
||||||
"fusse";"fusses";"fût";"fussions";"fussiez";"fussent";--# notpresent
|
"fusse";"fusses";"fût";"fussions";"fussiez";"fussent";--# notpresent
|
||||||
@@ -314,4 +312,4 @@ instance DiffFre of DiffRomance - [
|
|||||||
|
|
||||||
verbHyphen : Verb -> Str = \v -> v.s ! (VInfin True) ; --- kluge: use this field to store - or -t-
|
verbHyphen : Verb -> Str = \v -> v.s ! (VInfin True) ; --- kluge: use this field to store - or -t-
|
||||||
|
|
||||||
}
|
} ;
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ instance DiffIta of DiffRomance - [contractInf] = open CommonRomance, PhonoIta,
|
|||||||
|
|
||||||
auxPassive : Verb = venire_V ;
|
auxPassive : Verb = venire_V ;
|
||||||
|
|
||||||
copula = verbBesch (essere_1 "essere") ** {vtyp = VEsse ; p = []} ;
|
copula, essere_V = verbBesch (essere_1 "essere") ** {vtyp = VEsse ; p = []} ;
|
||||||
avere_V = verbBesch (avere_2 "avere") ** {vtyp = VHabere ; p = []} ;
|
avere_V = verbBesch (avere_2 "avere") ** {vtyp = VHabere ; p = []} ;
|
||||||
venire_V = verbBesch (venire_110 "venire") ** {vtyp = VEsse ; p = []} ;
|
venire_V = verbBesch (venire_110 "venire") ** {vtyp = VEsse ; p = []} ;
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
concrete ConstructionPor of Construction = CatPor **
|
concrete ConstructionPor of Construction = CatPor **
|
||||||
open SyntaxPor, SymbolicPor, ParadigmsPor, BeschPor,
|
open SyntaxPor, SymbolicPor, ParadigmsPor, BeschPor,
|
||||||
(L = LexiconPor), (B = DiffPor), (R = ResPor),
|
(L = LexiconPor), (D = DiffPor), (R = ResPor),
|
||||||
(S = SyntaxPor), (C = CommonRomance), CommonRomance,
|
(S = SyntaxPor), (C = CommonRomance), CommonRomance,
|
||||||
Prelude in {
|
Prelude in {
|
||||||
flags coding=utf8 ;
|
flags coding=utf8 ;
|
||||||
@@ -22,13 +22,13 @@ lin
|
|||||||
|
|
||||||
what_name_QCl x = mkQCl how_IAdv (mkCl (lin NP x) (reflV (mkV "chamar"))) ;
|
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_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
|
-- some more things
|
||||||
weather_adjCl ap = mkCl (mkVP (mkVA (mkV (fazer_Besch "fazer"))) (lin AP ap)) ;
|
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_right_VP = mkVP (mkVA D.stare_V) (mkAP (mkA "certo")) ;
|
||||||
is_wrong_VP = mkVP (mkVA B.estar_V) (mkAP (mkA "errado")) ;
|
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))))
|
n_units_AP card cn a = mkAP (lin AdA (mkUtt (mkNP <lin Card card : Card> (lin CN cn))))
|
||||||
(lin A a) ;
|
(lin A a) ;
|
||||||
@@ -225,4 +225,4 @@ lin thai_Language = mkLanguage "tailandês" ;
|
|||||||
lin turkish_Language = mkLanguage "turco" ;
|
lin turkish_Language = mkLanguage "turco" ;
|
||||||
lin urdu_Language = mkLanguage "urdu" ;
|
lin urdu_Language = mkLanguage "urdu" ;
|
||||||
|
|
||||||
}
|
} ;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:../prelude
|
--# -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 ;
|
flags optimize=noexpand ;
|
||||||
coding=utf8 ;
|
coding=utf8 ;
|
||||||
@@ -8,7 +8,7 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
|||||||
param
|
param
|
||||||
Prepos = P_de | P_a | P_em | P_por ;
|
Prepos = P_de | P_a | P_em | P_por ;
|
||||||
|
|
||||||
VType = VHabere | VRefl ;
|
VType = VTer | VHaver | VRefl ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
partAgr : VType -> Bool ;
|
partAgr : VType -> Bool ;
|
||||||
@@ -61,7 +61,7 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
|||||||
++ bindHyphenIf hasClit ++ clit ++ compl ;
|
++ bindHyphenIf hasClit ++ clit ++ compl ;
|
||||||
RNeg _ => neg.p1 ++ refl.pron ++ clit ++ subj ++ compl
|
RNeg _ => neg.p1 ++ refl.pron ++ clit ++ subj ++ compl
|
||||||
} where {
|
} where {
|
||||||
pe = case isPol of {True => P2 ; _ => P3} ;
|
pe : Person = case <isPol,p> of {<_,P1> => P1 ; <True,_> => P2 ; <_,_> => P3} ;
|
||||||
refl = case vp.s.vtyp of {
|
refl = case vp.s.vtyp of {
|
||||||
VRefl => {pron = reflPron n pe Acc ; isRefl = True} ;
|
VRefl => {pron = reflPron n pe Acc ; isRefl = True} ;
|
||||||
_ => {pron = [] ; isRefl = False}
|
_ => {pron = [] ; isRefl = False}
|
||||||
@@ -87,8 +87,8 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
|||||||
oper
|
oper
|
||||||
CopulaType = Copula ;
|
CopulaType = Copula ;
|
||||||
selectCopula coptyp = case coptyp of {
|
selectCopula coptyp = case coptyp of {
|
||||||
SerCop => copula ;
|
SerCop => essere_V ;
|
||||||
EstarCop => estar_V ;
|
EstarCop => stare_V ;
|
||||||
FicarCop => ficar_V
|
FicarCop => ficar_V
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -159,7 +159,12 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
|||||||
possCase = \_,_,c -> prepCase c ;
|
possCase = \_,_,c -> prepCase c ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
auxVerb : VType -> (VF => Str) = \_ -> haver_V.s ;
|
auxVerb : VType -> (VF => Str) ;
|
||||||
|
auxVerb vt = case vt of {
|
||||||
|
VTer => ter_V.s ;
|
||||||
|
VHaver => haver_V.s ;
|
||||||
|
_ => ter_V.s
|
||||||
|
} ;
|
||||||
|
|
||||||
negation : RPolarity => (Str * Str) = table {
|
negation : RPolarity => (Str * Str) = table {
|
||||||
RPos => <[],[]> ;
|
RPos => <[],[]> ;
|
||||||
@@ -263,14 +268,15 @@ instance DiffPor of DiffRomance - [iAdvQuestionInv,chooseTA,otherInv,partAgr,vpA
|
|||||||
<_, Pl,P3> => cases3 "os" "seus" "eles"
|
<_, 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") ;
|
||||||
|
|
||||||
|
ter_V : Verb = verboV (ter_Besch "ter") ;
|
||||||
haver_V : Verb = verboV (haver_Besch "haver") ;
|
haver_V : Verb = verboV (haver_Besch "haver") ;
|
||||||
|
|
||||||
ficar_V : Verb = verboV (ficar_Besch "ficar") ;
|
ficar_V : Verb = verboV (ficar_Besch "ficar") ;
|
||||||
|
|
||||||
verboV : Verbum -> Verb ;
|
verboV : Verbum -> Verb ;
|
||||||
-- make a verb of type haver
|
-- make a verb of type haver
|
||||||
verboV v = verbBesch v ** {vtyp = VHabere ; p = [] ; lock_V = <>} ;
|
verboV v = verbBesch v ** {vtyp = VTer ; p = [] } ;
|
||||||
|
|
||||||
}
|
} ;
|
||||||
|
|||||||
@@ -1,132 +1,52 @@
|
|||||||
--# -path=alltenses:../common:../abstract
|
--# -path=alltenses:../common:../abstract:../romance
|
||||||
|
concrete ExtendPor of Extend = CatPor ** ExtendRomanceFunctor -
|
||||||
concrete ExtendPor of Extend =
|
|
||||||
CatPor ** ExtendFunctor -
|
|
||||||
[
|
[
|
||||||
AdAdV,
|
CompoundAP,
|
||||||
AdjAsCN,
|
CompoundN,
|
||||||
AdjAsNP,
|
ExistsNP,
|
||||||
ApposNP,
|
GenRP,
|
||||||
BaseVPS,
|
GenRP,
|
||||||
ByVP,
|
ICompAP,
|
||||||
CompBareCN,
|
InOrderToVP,
|
||||||
ComplBareVS,
|
WithoutVP,
|
||||||
ComplSlashPartLast,
|
iFem_Pron,
|
||||||
CompoundAP,
|
theyFem_Pron,
|
||||||
CompoundN,
|
weFem_Pron,
|
||||||
CompVP,
|
youFem_Pron,
|
||||||
ConjVPS,
|
youPlFem_Pron,
|
||||||
ConsVPS,
|
youPolFem_Pron,
|
||||||
--EmptyRelSlash,
|
youPolPlFem_Pron,
|
||||||
ExistsNP,
|
youPolPl_Pron
|
||||||
GenIP,
|
] -- don't forget to put the names of your own
|
||||||
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
|
|
||||||
-- definitions here
|
-- definitions here
|
||||||
with
|
with
|
||||||
(Grammar = GrammarPor), (Syntax = SyntaxPor) **
|
(Grammar = GrammarPor), (Syntax = SyntaxPor), (ResRomance = ResPor) **
|
||||||
open
|
open
|
||||||
GrammarPor,
|
|
||||||
ResPor,
|
|
||||||
MorphoPor,
|
MorphoPor,
|
||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
ParadigmsPor,
|
ParadigmsPor,
|
||||||
|
(L = LexiconPor),
|
||||||
(S = StructuralPor) in {
|
(S = StructuralPor) in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
GenNP np =
|
ExistsNP np =
|
||||||
let denp = (np.s ! ResPor.genitive).ton in {
|
mkClause [] True False np.a
|
||||||
s = \\_,_,_,_ => [] ;
|
(insertComplement (\\_ => (np.s ! Nom).ton)
|
||||||
sp = \\_,_,_ => denp ;
|
(predV exist_V)) ;
|
||||||
s2 = denp ;
|
|
||||||
isNeg = False ;
|
GenRP nu cn = {
|
||||||
|
s = \\_b,_aagr,_c => cujo ! g ! n ++ num ++ cn.s ! n ;
|
||||||
|
a = aagr g n ;
|
||||||
|
hasAgr = True
|
||||||
|
} where {
|
||||||
|
cujo = genNumForms "cujo" "cuja" "cujos" "cujas" ;
|
||||||
|
g = cn.g ;
|
||||||
|
n = nu.n ;
|
||||||
|
num = if_then_Str nu.isNum (nu.s ! g) []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
GenIP ip = {s = \\_,_,c => ip.s ! c} ;
|
|
||||||
|
|
||||||
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
|
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 = {
|
ICompAP ap = {
|
||||||
s =\\a => "o quão" ++ ap.s ! (genNum2Aform a.g a.n) ;
|
s =\\a => "o quão" ++ ap.s ! (genNum2Aform a.g a.n) ;
|
||||||
cop = serCopula
|
cop = serCopula
|
||||||
@@ -136,63 +56,9 @@ concrete ExtendPor of Extend =
|
|||||||
s = "o quão" ++ adv.s
|
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
|
oper
|
||||||
pastPartAP : VPSlash -> Str -> AP ;
|
exist_V : V ;
|
||||||
pastPartAP vps agent = lin AP {
|
exist_V = mkV "existir" ;
|
||||||
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 ;
|
|
||||||
} ;
|
|
||||||
|
|
||||||
lin
|
lin
|
||||||
CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english
|
CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english
|
||||||
@@ -210,75 +76,15 @@ concrete ExtendPor of Extend =
|
|||||||
copTyp = adj.copTyp
|
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 = {
|
WithoutVP vp = {
|
||||||
s = "sem" ++ gerundStr vp
|
s = "sem" ++ infStr vp
|
||||||
} ;
|
|
||||||
|
|
||||||
ByVP vp = {
|
|
||||||
s = "by" ++ gerundStr vp
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InOrderToVP 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
|
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 ;
|
iFem_Pron = pronAgr S.i_Pron Fem Sg P1 ;
|
||||||
weFem_Pron = pronAgr S.we_Pron Fem Pl P1 ;
|
weFem_Pron = pronAgr S.we_Pron Fem Pl P1 ;
|
||||||
youFem_Pron = pronAgr S.youSg_Pron Fem Sg P3 ;
|
youFem_Pron = pronAgr S.youSg_Pron Fem Sg P3 ;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ concrete IdiomPor of Idiom = CatPor **
|
|||||||
in
|
in
|
||||||
vp.s.s ! VGer ++ clpr.p1 ++ obj
|
vp.s.s ! VGer ++ clpr.p1 ++ obj
|
||||||
)
|
)
|
||||||
(predV B.estar_V) ;
|
(predV B.stare_V) ;
|
||||||
|
|
||||||
ImpPl1 vp = {s =
|
ImpPl1 vp = {s =
|
||||||
mkImperative False P1 vp ! RPos ! Masc ! Pl ; --- fem
|
mkImperative False P1 vp ! RPos ! Masc ! Pl ; --- fem
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ lin
|
|||||||
kill_V2 = mkV2 (mkV "matar" "morto") ;
|
kill_V2 = mkV2 (mkV "matar" "morto") ;
|
||||||
know_V2 = mkV2 (mkV "conhecer") ;
|
know_V2 = mkV2 (mkV "conhecer") ;
|
||||||
learn_V2 = mkV2 (mkV "aprender") ;
|
learn_V2 = mkV2 (mkV "aprender") ;
|
||||||
leave_V2 = mkV2 (mkV "partir") ;
|
leave_V2 = mkV2 (mkV "partir") genitive ;
|
||||||
like_V2 = mkV2 (mkV "gostar") genitive ;
|
like_V2 = mkV2 (mkV "gostar") genitive ;
|
||||||
listen_V2 = mkV2 (mkV "escutar") ;
|
listen_V2 = mkV2 (mkV "escutar") ;
|
||||||
lose_V2 = mkV2 (mkV (perder_Besch "perder")) ;
|
lose_V2 = mkV2 (mkV (perder_Besch "perder")) ;
|
||||||
|
|||||||
@@ -298,6 +298,18 @@ oper
|
|||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
|
|
||||||
|
VType : Type ; -- verb is reflexive / verb uses auxiliar X
|
||||||
|
VType = MorphoPor.VType ;
|
||||||
|
|
||||||
|
auxTer : VType ; -- "ter" as auxiliary verb
|
||||||
|
auxTer = VTer ;
|
||||||
|
|
||||||
|
auxHaver : VType ; -- "haver" as auxiliary verb
|
||||||
|
auxHaver = VHaver ;
|
||||||
|
|
||||||
|
auxRefl : VType ; -- verb is reflexive
|
||||||
|
auxRefl = VRefl ;
|
||||||
|
|
||||||
regV : Str -> V ; --%
|
regV : Str -> V ; --%
|
||||||
regV s = case s of {
|
regV s = case s of {
|
||||||
chamar + "-se" => reflV (regV' chamar) ;
|
chamar + "-se" => reflV (regV' chamar) ;
|
||||||
@@ -362,6 +374,9 @@ oper
|
|||||||
mkV : V -> Str -> V -- particle verb
|
mkV : V -> Str -> V -- particle verb
|
||||||
= \v,p -> v ** {p = p} ;
|
= \v,p -> v ** {p = p} ;
|
||||||
|
|
||||||
|
mkV : V -> VType -> V -- choose auxiliary verb or make verb reflexive
|
||||||
|
= \v,vt -> v ** {vtyp = vt} ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- To form reflexive verbs:
|
-- To form reflexive verbs:
|
||||||
|
|||||||
@@ -189,4 +189,9 @@ oper
|
|||||||
<RPres,Simul> => <verb ! VFin (VPres m) n p, []>
|
<RPres,Simul> => <verb ! VFin (VPres m) n p, []>
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
essere_V : Verb ;
|
||||||
|
stare_V : Verb ;
|
||||||
|
stare_V = essere_V ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
267
src/romance/ExtendRomanceFunctor.gf
Normal file
267
src/romance/ExtendRomanceFunctor.gf
Normal file
@@ -0,0 +1,267 @@
|
|||||||
|
incomplete concrete ExtendRomanceFunctor of Extend =
|
||||||
|
Cat ** open Grammar, ResRomance in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
RNP = Grammar.NP ;
|
||||||
|
RNPList = Grammar.ListNP ;
|
||||||
|
|
||||||
|
---- 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 ;
|
||||||
|
|
||||||
|
BaseVPI = variants {} ;
|
||||||
|
ConsVPI = variants {} ;
|
||||||
|
BaseVPS2 = variants {} ;
|
||||||
|
ConsVPS2 = variants {} ;
|
||||||
|
BaseVPI2 = variants {} ;
|
||||||
|
ConsVPI2 = variants {} ;
|
||||||
|
|
||||||
|
--GenNP = variants {} ;
|
||||||
|
GenNP np =
|
||||||
|
let denp = (np.s ! ResRomance.genitive).ton in {
|
||||||
|
s = \\_,_,_,_ => [] ;
|
||||||
|
sp = \\_,_,_ => denp ;
|
||||||
|
s2 = denp ;
|
||||||
|
isNeg = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GenIP ip = {s = \\_,_,c => ip.s ! c} ;
|
||||||
|
GenRP = variants {} ; -- Num -> CN -> RP ; -- whose car
|
||||||
|
|
||||||
|
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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
StrandQuestSlash = QuestSlash ; -- whom does John live with ; DEFAULT with whom does John live
|
||||||
|
StrandRelSlash = RelSlash ; -- that he lives in ; DEFAULT in which he lives
|
||||||
|
|
||||||
|
EmptyRelSlash = variants {} ;
|
||||||
|
-- --TODO debug this definition
|
||||||
|
-- EmptyRelSlash cls = {
|
||||||
|
-- s = \\agr,t,a,p,m => cls.s ! agr ! DDir ! t ! a ! p ! m ++ cls.c2.s ;
|
||||||
|
-- c = Nom
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
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 ;
|
||||||
|
|
||||||
|
MkVPI vp = variants {} ; -- Temp -> Pol -> VP -> VPI ; -- to sleep / hasn't slept
|
||||||
|
ConjVPI = variants {} ; -- Conj -> [VPI] -> VPI ; -- has walked and won't sleep
|
||||||
|
ComplVPIVV = variants {} ; -- VV -> VPI -> VP ; -- want to sleep and to walk
|
||||||
|
MkVPS2 = variants {} ; -- : Temp -> Pol -> VPSlash -> VPS2 ; -- has loved
|
||||||
|
ConjVPS2 = variants {} ; -- : Conj -> [VPS2] -> VPS2 ; -- has loved and now hates
|
||||||
|
ComplVPS2 = variants {} ; -- : VPS2 -> NP -> VPS ; -- has loved and now hates that person
|
||||||
|
MkVPI2 = variants {} ; -- : Ant -> Pol -> VPSlash -> VPI2 ; -- to have loved
|
||||||
|
ConjVPI2 = variants {} ; -- : Conj -> [VPI2] -> VPI2 ; -- to love and have hated
|
||||||
|
ComplVPI2 = variants {} ; -- : VPI2 -> NP -> VPI ; -- to love and hate that person
|
||||||
|
|
||||||
|
lin
|
||||||
|
ProDrop p = p ** {
|
||||||
|
s = table {
|
||||||
|
Nom => let pn = p.s ! Nom
|
||||||
|
in {c1 = pn.c1 ; c2 = pn.c2 ; comp = [] ; ton = pn.ton} ;
|
||||||
|
c => p.s ! c
|
||||||
|
} ;
|
||||||
|
isNeg = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ICompAP = variants {} ; -- AP -> IComp ; -- "how old"
|
||||||
|
IAdvAdv = variants {} ; -- Adv -> IAdv ; -- "how often"
|
||||||
|
|
||||||
|
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} ;
|
||||||
|
|
||||||
|
FocusObj = variants {} ; -- NP -> SSlash -> Utt ; -- her I love
|
||||||
|
FocusAdv = variants {} ; -- Adv -> S -> Utt ; -- today I will sleep
|
||||||
|
FocusAdV = variants {} ; -- AdV -> S -> Utt ; -- never will I sleep
|
||||||
|
FocusAP = variants {} ; -- AP -> NP -> Utt ; -- green was the tree
|
||||||
|
|
||||||
|
lin
|
||||||
|
EmbedPresPart = variants {} ; -- VP -> SC ; -- looking at Mary (is fun)
|
||||||
|
|
||||||
|
PresPartAP vp = {
|
||||||
|
s = \\af => gerVP vp (aform2aagr af ** {p = P3}) ;
|
||||||
|
isPre = False ;
|
||||||
|
copTyp = serCopula
|
||||||
|
} ;
|
||||||
|
|
||||||
|
PassVPSlash vps = passVPSlash vps [] ;
|
||||||
|
PassAgentVPSlash vps np = passVPSlash vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
||||||
|
|
||||||
|
PastPartAP vps = pastPartAP vps [] ;
|
||||||
|
PastPartAgentAP vps np = pastPartAP vps (let by = <Grammar.by8agent_Prep : Prep> in by.s ++ (np.s ! by.c).ton) ;
|
||||||
|
|
||||||
|
ExistsNP = variants {} ;
|
||||||
|
|
||||||
|
NominalizeVPSlashNP = variants {} ; -- VPSlash -> NP -> NP ;
|
||||||
|
|
||||||
|
ExistCN cn = ExistNP (DetCN (DetQuant IndefArt NumSg) cn) ;
|
||||||
|
ExistMassCN cn = ExistNP (MassNP cn) ;
|
||||||
|
ExistPluralCN cn = ExistNP (DetCN (DetQuant IndefArt NumPl) cn) ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ComplBareVS = ComplVS ; -- VS -> S -> VP ; -- say she runs ; DEFAULT say that she runs
|
||||||
|
SlashBareV2S = SlashV2S ; -- V2S -> S -> VPSlash ; -- answer (to him) it is good ; DEFAULT answer that it is good
|
||||||
|
ComplDirectVS vs utt = AdvVP (UseV <lin V vs : V>) (lin Adv {s = ":" ++ quoted utt.s}) ; -- DEFAULT complement added as Adv in quotes
|
||||||
|
ComplDirectVQ vq utt = AdvVP (UseV <lin V vq : V>) (lin Adv {s = ":" ++ quoted utt.s}) ; -- DEFAULT complement added as Adv in quotes
|
||||||
|
FrontComplDirectVS = variants {} ; -- NP -> VS -> Utt -> Cl ; -- "I am here", she said
|
||||||
|
FrontComplDirectVQ = variants {} ; -- NP -> VQ -> Utt -> Cl ; -- "where", she asked
|
||||||
|
PredAPVP ap vp = ImpersCl (UseComp (CompAP (SentAP ap (EmbedVP vp)))) ; -- DEFAULT it is (good to walk)
|
||||||
|
|
||||||
|
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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
ReflRNP = variants {} ; -- VPSlash -> RNP -> VP ; -- love my family and myself
|
||||||
|
ReflPron = variants {} ; -- RNP ; -- myself
|
||||||
|
ReflPoss = variants {} ; -- Num -> CN -> RNP ; -- my car(s)
|
||||||
|
PredetRNP = variants {} ; -- Predet -> RNP -> RNP ; -- all my brothers
|
||||||
|
ConjRNP = variants {} ; -- Conj -> RNPList -> RNP ; -- my family, John and myself
|
||||||
|
Base_rr_RNP = variants {} ; -- RNP -> RNP -> RNPList ; -- my family, myself
|
||||||
|
Base_nr_RNP = variants {} ; -- NP -> RNP -> RNPList ; -- John, myself
|
||||||
|
Base_rn_RNP = variants {} ; -- RNP -> NP -> RNPList ; -- myself, John
|
||||||
|
Cons_rr_RNP = variants {} ; -- RNP -> RNPList -> RNPList ; -- my family, myself, John
|
||||||
|
Cons_nr_RNP = variants {} ; -- NP -> RNPList -> RNPList ; -- John, my family, myself
|
||||||
|
ComplGenVV = variants {} ; -- VV -> Ant -> Pol -> VP -> VP ; -- want not to have slept
|
||||||
|
ComplSlashPartLast = ComplSlash ;
|
||||||
|
|
||||||
|
CompoundN = variants {} ; -- N -> N -> N ; -- control system / controls system / control-system
|
||||||
|
CompoundAP = variants {} ; -- N -> A -> AP ; -- language independent / language-independent
|
||||||
|
|
||||||
|
lin
|
||||||
|
GerundNP vp = let
|
||||||
|
neutrAgr = Ag Masc Sg P3
|
||||||
|
in heavyNP {
|
||||||
|
s = \\_ => gerVP vp neutrAgr ;
|
||||||
|
a = neutrAgr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundCN vp = {
|
||||||
|
s = \\n => gerVP vp {g = Masc ; n = n ; p = P3} ;
|
||||||
|
g = Masc
|
||||||
|
} ;
|
||||||
|
|
||||||
|
GerundAdv vp = {
|
||||||
|
s = gerundStr vp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
PurposeVP vp = {
|
||||||
|
s = infVP vp (Ag Masc Sg P3)
|
||||||
|
} ;
|
||||||
|
|
||||||
|
WithoutVP = variants {} ; -- VP -> Adv ; -- without publishing the document
|
||||||
|
|
||||||
|
ByVP vp = {
|
||||||
|
s = gerundStr vp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InOrderToVP = variants {} ; -- VP -> Adv ; -- (in order) to publish the document
|
||||||
|
|
||||||
|
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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
CompS = variants {} ; -- S -> Comp ; -- (the fact is) that she sleeps
|
||||||
|
CompQS = variants {} ; -- QS -> Comp ; -- (the question is) who sleeps
|
||||||
|
|
||||||
|
--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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
DetNPMasc = DetNP ;
|
||||||
|
DetNPFem = DetNP ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
iFem_Pron = i_Pron ; -- DEFAULT I (masc)
|
||||||
|
youFem_Pron = youSg_Pron ; -- DEFAULT you (masc)
|
||||||
|
weFem_Pron = we_Pron ; -- DEFAULT we (masc)
|
||||||
|
youPlFem_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
||||||
|
theyFem_Pron = they_Pron ; -- DEFAULT they (masc)
|
||||||
|
youPolFem_Pron = youPol_Pron ; -- DEFAULT you polite (masc)
|
||||||
|
youPolPl_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
||||||
|
youPolPlFem_Pron = youPl_Pron ; -- DEFAULT you plural (masc)
|
||||||
|
|
||||||
|
lin
|
||||||
|
UseComp_estar comp = insertComplement comp.s (predV stare_V) ;
|
||||||
|
UncontractedNeg = {s = [] ; p = RNeg False} ;
|
||||||
|
UttAccNP = UttNP ; -- him (accusative) ; DEFAULT he
|
||||||
|
UttDatNP np = UttAccNP (lin NP np) ; -- him(dative) ; DEFAULT he
|
||||||
|
UttAccIP = UttIP ; -- whom (accusative) ; DEFAULT who
|
||||||
|
UttDatIP ip = UttAccIP (lin IP ip) ; -- whom (dative) ; DEFAULT who
|
||||||
|
UttVPShort = UttVP ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
quoted : Str -> Str = \s -> "\"" ++ s ++ "\"" ; ---- TODO bind ; move to Prelude?
|
||||||
|
|
||||||
|
oper
|
||||||
|
gerundStr : VP -> Str ;
|
||||||
|
gerundStr vp = gerVP vp (Ag Masc Sg P3) ;
|
||||||
|
|
||||||
|
infStr : VP -> Str ;
|
||||||
|
infStr vp = infVP vp (Ag Masc Sg P3) ;
|
||||||
|
|
||||||
|
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 ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} ;
|
||||||
42470
src/spanish/DictSpa.gf
Normal file
42470
src/spanish/DictSpa.gf
Normal file
File diff suppressed because it is too large
Load Diff
42430
src/spanish/DictSpaAbs.gf
Normal file
42430
src/spanish/DictSpaAbs.gf
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../romance:../abstract:../common:prelude
|
--# -path=.:../romance:../abstract:../common:prelude
|
||||||
|
|
||||||
instance DiffSpa of DiffRomance - [iAdvQuestionInv,otherInv,partAgr,vpAgrSubj,vpAgrClits,contractInf] = open CommonRomance, PhonoSpa, BeschSpa, Prelude in {
|
instance DiffSpa of DiffRomance - [iAdvQuestionInv,otherInv,partAgr,stare_V,vpAgrSubj,vpAgrClits,contractInf] = open CommonRomance, PhonoSpa, BeschSpa, Prelude in {
|
||||||
|
|
||||||
flags optimize=noexpand ;
|
flags optimize=noexpand ;
|
||||||
coding=utf8 ;
|
coding=utf8 ;
|
||||||
@@ -207,11 +207,9 @@ instance DiffSpa of DiffRomance - [iAdvQuestionInv,otherInv,partAgr,vpAgrSubj,vp
|
|||||||
_ => False
|
_ => False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
auxPassive : Verb = verbBeschH (estar_2 "estar") ;
|
copula, essere_V : Verb = verbBeschH (ser_1 "ser") ;
|
||||||
|
|
||||||
copula : Verb = verbBeschH (ser_1 "ser") ;
|
estar_V, stare_V, auxPassive : Verb = verbBeschH (estar_2 "estar") ;
|
||||||
|
|
||||||
estar_V : Verb = verbBeschH (estar_2 "estar") ;
|
|
||||||
|
|
||||||
haber_V : Verb = verbBeschH (haber_3 "haber") ;
|
haber_V : Verb = verbBeschH (haber_3 "haber") ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,25 +1,38 @@
|
|||||||
--# -path=alltenses:../common:../abstract
|
--# -path=alltenses:../common:../abstract:../romance
|
||||||
|
concrete ExtendSpa of Extend = CatSpa ** ExtendRomanceFunctor -
|
||||||
concrete ExtendSpa of Extend =
|
[
|
||||||
CatSpa ** ExtendFunctor -
|
CompVP,
|
||||||
[
|
CompoundAP,
|
||||||
iFem_Pron, youFem_Pron, weFem_Pron, youPlFem_Pron, theyFem_Pron, youPolFem_Pron, youPolPl_Pron, youPolPlFem_Pron,
|
CompoundN,
|
||||||
ProDrop
|
ExistsNP,
|
||||||
] -- put the names of your own definitions here
|
GenRP,
|
||||||
|
GenRP,
|
||||||
|
IAdvAdv,
|
||||||
|
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
|
with
|
||||||
(Grammar = GrammarSpa) **
|
(Grammar = GrammarSpa), (Syntax = SyntaxSpa), (ResRomance = ResSpa) **
|
||||||
open
|
open
|
||||||
GrammarSpa,
|
GrammarSpa,
|
||||||
ResSpa,
|
ResSpa,
|
||||||
MorphoSpa,
|
MorphoSpa,
|
||||||
Coordination,
|
Coordination,
|
||||||
Prelude,
|
Prelude,
|
||||||
ParadigmsSpa in {
|
ParadigmsSpa in {
|
||||||
-- put your own definitions here
|
-- put your own definitions here
|
||||||
|
|
||||||
lin
|
lin
|
||||||
UseComp_estar comp = insertComplement comp.s (predV estar_V) ;
|
|
||||||
|
|
||||||
iFem_Pron = mkPronoun
|
iFem_Pron = mkPronoun
|
||||||
"yo" "me" "me" "mí"
|
"yo" "me" "me" "mí"
|
||||||
"mi" "mi" "mis" "mis"
|
"mi" "mi" "mis" "mis"
|
||||||
@@ -56,17 +69,49 @@ concrete ExtendSpa of Extend =
|
|||||||
"su" "su" "sus" "sus"
|
"su" "su" "sus" "sus"
|
||||||
Fem Pl P3 ;
|
Fem Pl P3 ;
|
||||||
|
|
||||||
ProDrop p = {
|
ICompAP ap = {
|
||||||
s = table {
|
s =\\a => "que tan" ++ ap.s ! (genNum2Aform a.g a.n) ;
|
||||||
Nom => let pn = p.s ! Nom in {c1 = pn.c1 ; c2 = pn.c2 ; comp = [] ; ton = pn.ton} ;
|
cop = serCopula
|
||||||
c => p.s ! c
|
|
||||||
} ;
|
|
||||||
a = p.a ;
|
|
||||||
poss = p.poss ;
|
|
||||||
hasClit = p.hasClit ;
|
|
||||||
isPol = p.isPol ;
|
|
||||||
isNeg = False
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
IAdvAdv adv = {
|
||||||
|
s = "que tan" ++ adv.s
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
ExistsNP np =
|
||||||
|
mkClause [] True False np.a
|
||||||
|
(insertComplement (\\_ => (np.s ! Nom).ton)
|
||||||
|
(predV (mkV "existir"))) ;
|
||||||
|
|
||||||
|
CompoundN noun noun2 = { -- order is different because that's needed for correct translation from english
|
||||||
|
s = \\n => noun2.s ! n
|
||||||
|
++ variants {"de" ; genForms "do" "da" ! noun.g}
|
||||||
|
++ noun.s ! Sg ;
|
||||||
|
g = noun2.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
CompoundAP noun adj = {
|
||||||
|
s = \\af => case (aform2aagr af) of {
|
||||||
|
{n = n} => adj.s ! Posit ! (genNum2Aform noun.g n) ++ "de" ++ noun.s ! n
|
||||||
|
} ;
|
||||||
|
isPre = adj.isPre ;
|
||||||
|
copTyp = adj.copTyp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
WithoutVP vp = {
|
||||||
|
s = "sin" ++ infStr vp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
InOrderToVP vp = {
|
||||||
|
s = "para" ++ infStr vp
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--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
|
||||||
|
} ;
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|||||||
@@ -5545,10 +5545,10 @@ lin abrir_V = verboV
|
|||||||
{- VPB (Imper C.Pl C.P1) => -} "abramos" ;
|
{- VPB (Imper C.Pl C.P1) => -} "abramos" ;
|
||||||
{- VPB (Imper C.Pl C.P2) => -} "abrid" ;
|
{- VPB (Imper C.Pl C.P2) => -} "abrid" ;
|
||||||
{- VPB (Imper C.Pl C.P3) => -} "abran" ;
|
{- VPB (Imper C.Pl C.P3) => -} "abran" ;
|
||||||
{- VPB (Pass C.Sg Masc) => -} "abrido" ;
|
{- VPB (Pass C.Sg Masc) => -} "abierto" ;
|
||||||
{- VPB (Pass C.Sg Fem) => -} "abrida" ;
|
{- VPB (Pass C.Sg Fem) => -} "abierta" ;
|
||||||
{- VPB (Pass C.Pl Masc) => -} "abridos" ;
|
{- VPB (Pass C.Pl Masc) => -} "abiertos" ;
|
||||||
{- VPB (Pass C.Pl Fem) => -} "abridas"
|
{- VPB (Pass C.Pl Fem) => -} "abiertas"
|
||||||
]
|
]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -6049,10 +6049,10 @@ lin entreabrir_V = verboV
|
|||||||
{- VPB (Imper C.Pl C.P1) => -} "entreabramos" ;
|
{- VPB (Imper C.Pl C.P1) => -} "entreabramos" ;
|
||||||
{- VPB (Imper C.Pl C.P2) => -} "entreabrid" ;
|
{- VPB (Imper C.Pl C.P2) => -} "entreabrid" ;
|
||||||
{- VPB (Imper C.Pl C.P3) => -} "entreabran" ;
|
{- VPB (Imper C.Pl C.P3) => -} "entreabran" ;
|
||||||
{- VPB (Pass C.Sg Masc) => -} "entreabrido" ;
|
{- VPB (Pass C.Sg Masc) => -} "entreabierto" ;
|
||||||
{- VPB (Pass C.Sg Fem) => -} "entreabrida" ;
|
{- VPB (Pass C.Sg Fem) => -} "entreabierta" ;
|
||||||
{- VPB (Pass C.Pl Masc) => -} "entreabridos" ;
|
{- VPB (Pass C.Pl Masc) => -} "entreabiertos" ;
|
||||||
{- VPB (Pass C.Pl Fem) => -} "entreabridas"
|
{- VPB (Pass C.Pl Fem) => -} "entreabiertas"
|
||||||
]
|
]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -6481,10 +6481,10 @@ lin reabrir_V = verboV
|
|||||||
{- VPB (Imper C.Pl C.P1) => -} "reabramos" ;
|
{- VPB (Imper C.Pl C.P1) => -} "reabramos" ;
|
||||||
{- VPB (Imper C.Pl C.P2) => -} "reabrid" ;
|
{- VPB (Imper C.Pl C.P2) => -} "reabrid" ;
|
||||||
{- VPB (Imper C.Pl C.P3) => -} "reabran" ;
|
{- VPB (Imper C.Pl C.P3) => -} "reabran" ;
|
||||||
{- VPB (Pass C.Sg Masc) => -} "reabrido" ;
|
{- VPB (Pass C.Sg Masc) => -} "reabierto" ;
|
||||||
{- VPB (Pass C.Sg Fem) => -} "reabrida" ;
|
{- VPB (Pass C.Sg Fem) => -} "reabierta" ;
|
||||||
{- VPB (Pass C.Pl Masc) => -} "reabridos" ;
|
{- VPB (Pass C.Pl Masc) => -} "reabiertos" ;
|
||||||
{- VPB (Pass C.Pl Fem) => -} "reabridas"
|
{- VPB (Pass C.Pl Fem) => -} "reabiertas"
|
||||||
]
|
]
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -78345,4 +78345,3 @@ lin llover_V = verboV
|
|||||||
]
|
]
|
||||||
} ;
|
} ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ lin
|
|||||||
lamp_N = regN "lámpara" ;
|
lamp_N = regN "lámpara" ;
|
||||||
learn_V2 = dirV2 (regV "aprender") ;
|
learn_V2 = dirV2 (regV "aprender") ;
|
||||||
leather_N = regN "cuero" ;
|
leather_N = regN "cuero" ;
|
||||||
leave_V2 = dirV2 (regV "partir") ; -- irse, dejar
|
leave_V2 = mkV2 (mkV "partir") genitive ; -- irse, dejar
|
||||||
like_V2 = dirV2 (regV "gustar") ;
|
like_V2 = dirV2 (regV "gustar") ;
|
||||||
listen_V2 = dirV2 (regV "escuchar") ;
|
listen_V2 = dirV2 (regV "escuchar") ;
|
||||||
live_V = verboV (vivir_7 "vivir") ;
|
live_V = verboV (vivir_7 "vivir") ;
|
||||||
|
|||||||
102
src/spanish/README.md
Normal file
102
src/spanish/README.md
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
# Spanish
|
||||||
|
|
||||||
|
## Language information
|
||||||
|
* English name: Spanish
|
||||||
|
* Autonym: español
|
||||||
|
* ISO code: Spa
|
||||||
|
|
||||||
|
## Authors
|
||||||
|
|
||||||
|
* Aarne Ranta
|
||||||
|
|
||||||
|
With contributions from Inger Andersson, Bruno Cuconato, Inari Listenmaa, and Therese Söderberg.
|
||||||
|
|
||||||
|
## Implementation information
|
||||||
|
The Spanish Resource Grammar is built using the Romance functor at
|
||||||
|
[romance](../romance/), and it mostly follows Spanish spoken in Spain.
|
||||||
|
|
||||||
|
Romance instantiations differ mostly in their morphological modules
|
||||||
|
and in the constructions defined in the =Diff*= modules. Some relevant features:
|
||||||
|
|
||||||
|
* two copulas, ser and estar
|
||||||
|
* prepositions that contract with articles are *de* and *a*, called `genitive` and `dative` respectively. When forming new prepositions, e.g. *después de* use `mkPrep "después" genitive` to get correct contractions.
|
||||||
|
* no inversion in question clauses, except for `QuestIComp` and `QuestIAdv`.
|
||||||
|
|
||||||
|
### Known issues
|
||||||
|
|
||||||
|
* Verbs with dative subject don't actually have it. Example:
|
||||||
|
|
||||||
|
```
|
||||||
|
Lang> p "I like grammars" | l
|
||||||
|
I like grammars
|
||||||
|
yo gusto gramáticas
|
||||||
|
```
|
||||||
|
|
||||||
|
This is not a massive problem per se, the application grammarian just needs to know this is the case. If your application grammar has a function like the following:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
fun Like : NP -> NP -> Cl ;
|
||||||
|
```
|
||||||
|
|
||||||
|
then you just need to linearise it as follows:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
lin Like subj obj = mkCl obj like_V2 subj ;
|
||||||
|
```
|
||||||
|
|
||||||
|
(Why don't we have it? Verbs like *gustar* inflect according to the logical *object* of the sentence; this would mean we'd need 2-dimensional inflection tables for verbs, and while that's a cool thing, it's also expensive and not needed for anything else.)
|
||||||
|
|
||||||
|
* Contractions with *con* and pronouns: *con* + *mí*/*ti*/… should be *conmigo*/*contigo*/…, but the contraction is not implemented.
|
||||||
|
|
||||||
|
* Clitic pronouns and their combinations:
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
-- PredVP (UsePron i_Pron) (ComplSlash (SlashVV want_VV (Slash2V3 give_V3 (UsePron he_Pron))) (UsePron it_Pron))
|
||||||
|
LangEng: i want to give him it
|
||||||
|
LangSpa: yo lo quiero dar &+ le -- should be dárselo
|
||||||
|
-- PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (Slash3V3 give_V3 (UsePron it_Pron)) (UsePron he_Pron)))
|
||||||
|
LangEng: i want to give him it
|
||||||
|
LangSpa: yo quiero dar &+ lo le -- should be dárselo
|
||||||
|
```
|
||||||
|
|
||||||
|
* Accents in imperatives and infinitives with clitics
|
||||||
|
|
||||||
|
```haskell
|
||||||
|
--ImpVP (ComplSlash (Slash2V3 give_V3 (UsePron i_Pron)) (UsePron it_Pron))
|
||||||
|
LangEng: give me it
|
||||||
|
LangSpa: da &+ lo me
|
||||||
|
```
|
||||||
|
|
||||||
|
Ignoring the clitic combination (should be *dámelo*), the verb form *da* should get an accent *dá* to show the correct syllable stress.
|
||||||
|
|
||||||
|
## Data
|
||||||
|
|
||||||
|
### Besch & Irreg
|
||||||
|
The [BeschSpa](BeschSpa.gf) and [IrregSpa](IrregSpa.gf) modules contain the complete inflection tables for all different
|
||||||
|
Spanish verb types. Based on the Functional Morphology [implementation](http://www.cse.chalmers.se/alumni/markus/FM/download/FM_SPA_1.1.tgz) by Inger Andersson and Therese Söderberg.
|
||||||
|
|
||||||
|
|
||||||
|
### DictSpa
|
||||||
|
This module contains nouns, adjectives and verbs taken from
|
||||||
|
[Open Multilingual Wordnet](http://compling.hss.ntu.edu.sg/omw/) and [DictionarySpa](https://github.com/GrammaticalFramework/wide-coverage/blob/master/translator/DictionarySpa.gf) (mostly from Wiktionary).
|
||||||
|
|
||||||
|
#### Multiwords
|
||||||
|
Some thousands of multiwords are manually checked. As of February 2019, around 4000 are unchecked. Those are marked in [DictSpa](DictSpa.gf) with `-- to-check segmentation`.
|
||||||
|
|
||||||
|
#### Morphology
|
||||||
|
WIP.
|
||||||
|
* Where there was a non-1-arg paradigm in the old resources, that is retained.
|
||||||
|
* All verbs that overlap with IrregSpa use the IrregSpa definition.
|
||||||
|
* Most of the manually checked multiwords are also checked for morphology, but naturally, errors do occur.
|
||||||
|
|
||||||
|
## History and applications
|
||||||
|
|
||||||
|
Some applications include:
|
||||||
|
|
||||||
|
* [MOLTO phrasebook](http://www.molto-project.eu/sites/default/files/everyday.pdf)
|
||||||
|
* GF Mathematical Grammar Library ([paper](http://www.molto-project.eu/sites/default/files/gf-mgl.pdf), [demo](http://cloud.grammaticalframework.org/minibar/minibar.html))
|
||||||
|
* GF [Wide-Coverage translator](http://cloud.grammaticalframework.org/wc.html)
|
||||||
|
|
||||||
|
## Maintainers
|
||||||
|
Inari Listenmaa ([@inariksit](https://github.com/inariksit))
|
||||||
|
Bruno Cuconato ([@odanoburu](https://github.com/odanoburu))
|
||||||
Reference in New Issue
Block a user