mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-31 10:48:55 -06:00
Make adjectives depend on agreement; Fix reflexives
This commit is contained in:
@@ -9,22 +9,30 @@ concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in {
|
|||||||
|
|
||||||
-- : A -> AP ;
|
-- : A -> AP ;
|
||||||
PositA a = a ** {
|
PositA a = a ** {
|
||||||
s = a.s ! AF Posit ;
|
s = \\agr => a.s ! AF Posit ;
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
-- : A -> NP -> AP ; -- euskara ingelesa baino errazagoa da.
|
-- : A -> NP -> AP ; -- euskara ingelesa baino errazagoa da.
|
||||||
ComparA a np = a ** {
|
ComparA a np = a ** {
|
||||||
s = np.s ! Abs ++ "baino" ++ a.s ! AF Compar ;
|
s = \\agr => np.s ! Abs ++ "baino" ++ a.s ! AF Compar ;
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
-- : A2 -> NP -> AP ; -- married to her
|
-- : A2 -> NP -> AP ; -- married to her
|
||||||
ComplA2 a2 np = a2 ** {
|
ComplA2 a2 np = a2 ** {
|
||||||
s = applyPost a2.compl np ++ a2.s ! AF Posit ;
|
s = \\agr => applyPost a2.compl np ++ a2.s ! AF Posit ;
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
-- : A2 -> AP ; -- married to itself
|
-- : A2 -> AP ; -- married to itself
|
||||||
ReflA2 a2 = a2 ** {
|
ReflA2 a2 = a2 ** {
|
||||||
s = applyPost a2.compl buru_NP ++ a2.s ! AF Posit ;
|
s = \\agr =>
|
||||||
|
let neure : Str = reflPron ! agr ;
|
||||||
|
neureBuru : NounPhrase = empty_NP **
|
||||||
|
{ s = \\cas => neure ++ "buru"
|
||||||
|
++ artDef ! getNum agr ! cas ! FinalVow ;
|
||||||
|
-- stem = neure ++ "buru" ;
|
||||||
|
agr = agr } -- neure buruekin eskondua naiz /
|
||||||
|
-- geure buruekin eskonduak gara
|
||||||
|
in applyPost a2.compl neureBuru ++ a2.s ! AF Posit ;
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
-- : A2 -> AP ; -- married
|
-- : A2 -> AP ; -- married
|
||||||
@@ -32,18 +40,19 @@ concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in {
|
|||||||
|
|
||||||
-- : A -> AP ; -- warmer
|
-- : A -> AP ; -- warmer
|
||||||
UseComparA a = a ** {
|
UseComparA a = a ** {
|
||||||
s = a.s ! AF Compar ;
|
s = \\agr => a.s ! AF Compar ;
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
|
|
||||||
-- : CAdv -> AP -> NP -> AP ; -- as cool as John
|
-- : CAdv -> AP -> NP -> AP ; -- as cool as John
|
||||||
CAdvAP adv ap np = ap ** {
|
CAdvAP adv ap np = ap ** {
|
||||||
s = np.s ! Abs ++ adv.s ++ ap.s } ;
|
s = \\agr => np.s ! Abs ++ adv.s ++ ap.s ! agr } ;
|
||||||
|
|
||||||
-- The superlative use is covered in $Ord$.
|
-- The superlative use is covered in $Ord$.
|
||||||
|
|
||||||
-- : Ord -> AP ; -- warmest
|
-- : Ord -> AP ; -- warmest
|
||||||
AdjOrd ord = ord ** {
|
AdjOrd ord = ord ** {
|
||||||
|
s = \\agr => ord.s ;
|
||||||
ph = FinalCons ; --always ends in -en
|
ph = FinalCons ; --always ends in -en
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
@@ -57,8 +66,8 @@ concrete AdjectiveEus of Adjective = CatEus ** open ResEus, Prelude in {
|
|||||||
|
|
||||||
-- : AdA -> AP -> AP ;
|
-- : AdA -> AP -> AP ;
|
||||||
AdAP ada ap = ap ** {
|
AdAP ada ap = ap ** {
|
||||||
s = ada.s ++ ap.s ;
|
s = \\agr => ada.s ++ ap.s ! agr ;
|
||||||
typ = Bare } ;
|
typ = Bare } ;
|
||||||
|
|
||||||
|
|
||||||
-- It can also be postmodified by an adverb, typically a prepositional phrase.
|
-- It can also be postmodified by an adverb, typically a prepositional phrase.
|
||||||
|
|||||||
@@ -71,12 +71,12 @@ lin
|
|||||||
-- APs and CNs. FIXME: crude first attempt, doesn't work properly.
|
-- APs and CNs. FIXME: crude first attempt, doesn't work properly.
|
||||||
-- ConjCN gives `*nesk edo neskek'
|
-- ConjCN gives `*nesk edo neskek'
|
||||||
lincat
|
lincat
|
||||||
[AP] = {s1,s2 : Str ; ph : Phono ; typ : APType } ;
|
[AP] = {s1,s2 : Agr => Str ; ph : Phono ; typ : APType } ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseAP x y = twoSS x y ** y ; --choose all the other fields from second argument
|
BaseAP x y = twoTable Agr x y ** y ; --choose all the other fields from second argument
|
||||||
ConsAP as a = consrSS comma as a ** as ;
|
ConsAP as a = consrTable Agr comma as a ** as ;
|
||||||
ConjAP co as = conjunctDistrSS co as ** as ;
|
ConjAP co as = conjunctDistrTable Agr co as ** as ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
[CN] = { s1,s2 : Agr => Str } ** CNLight ;
|
[CN] = { s1,s2 : Agr => Str } ** CNLight ;
|
||||||
|
|||||||
@@ -227,6 +227,7 @@ lin louse_N = mkN "zorri" ; --Apertium
|
|||||||
lin love_N = mkN "maitasun" ; -- | mkN "amodio" ; --Apertium
|
lin love_N = mkN "maitasun" ; -- | mkN "amodio" ; --Apertium
|
||||||
lin love_V2 = ukanV "maite" ;
|
lin love_V2 = ukanV "maite" ;
|
||||||
lin man_N = mkN "gizon" animate ; --Apertium
|
lin man_N = mkN "gizon" animate ; --Apertium
|
||||||
|
lin married_A2 = mkA2 "eskondu" (mkPrep [] sociative) ;
|
||||||
lin meat_N = mkN "haragi" ; -- | mkN "mami" ; --Apertium
|
lin meat_N = mkN "haragi" ; -- | mkN "mami" ; --Apertium
|
||||||
lin milk_N = mkN "esne" ; --Apertium
|
lin milk_N = mkN "esne" ; --Apertium
|
||||||
lin moon_N = mkN "ilargi" ; --Apertium
|
lin moon_N = mkN "ilargi" ; --Apertium
|
||||||
|
|||||||
@@ -191,9 +191,9 @@ concrete NounEus of Noun = CatEus ** open ResEus, Prelude in {
|
|||||||
let a : Str = artIndef ! Abs ! cn.ph ; --`a' for FinalA, [] for other
|
let a : Str = artIndef ! Abs ! cn.ph ; --`a' for FinalA, [] for other
|
||||||
result : {s : Agr => Str ; ph : Phono} =
|
result : {s : Agr => Str ; ph : Phono} =
|
||||||
case ap.typ of {
|
case ap.typ of {
|
||||||
Ko => { s = \\agr => ap.s ++ cn.s ! agr ;
|
Ko => { s = \\agr => ap.s ! Hau ++ cn.s ! agr ;
|
||||||
ph = cn.ph } ;
|
ph = cn.ph } ;
|
||||||
Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ;
|
Bare => { s = \\agr => cn.s ! agr ++ a ++ ap.s ! Hau ;
|
||||||
ph = ap.ph }
|
ph = ap.ph }
|
||||||
} ;
|
} ;
|
||||||
in cn ** { s = result.s ;
|
in cn ** { s = result.s ;
|
||||||
@@ -252,7 +252,7 @@ concrete NounEus of Noun = CatEus ** open ResEus, Prelude in {
|
|||||||
--3 Conjoinable determiners and ones with adjectives
|
--3 Conjoinable determiners and ones with adjectives
|
||||||
|
|
||||||
-- : DAP -> AP -> DAP ; -- the large (one)
|
-- : DAP -> AP -> DAP ; -- the large (one)
|
||||||
AdjDAP dap ap = dap ** { s = \\cas,ph => ap.s ++ dap.s ! cas ! ph } ;
|
AdjDAP dap ap = dap ** { s = \\cas,ph => ap.s ! Hau ++ dap.s ! cas ! ph } ;
|
||||||
|
|
||||||
-- : Det -> DAP ; -- this (or that)
|
-- : Det -> DAP ; -- this (or that)
|
||||||
DetDAP det = det ;
|
DetDAP det = det ;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ oper
|
|||||||
mkA : Str -> A -> A = \s,a -> irregAdvAdj s a
|
mkA : Str -> A -> A = \s,a -> irregAdvAdj s a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- mkA2 : Str -> A2 = \s -> lin A2 (mkAdj s) ;
|
mkA2 : Str -> Prep -> A2 = \s,pp -> lin A2 (regAdj s ** { compl = pp }) ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ concrete PhraseEus of Phrase = CatEus ** open Prelude, ResEus in {
|
|||||||
UttAdv adv = adv ;
|
UttAdv adv = adv ;
|
||||||
UttCN n = {s = n.s ! Hau ++ artDef ! Sg ! Abs ! n.ph } ;
|
UttCN n = {s = n.s ! Hau ++ artDef ! Sg ! Abs ! n.ph } ;
|
||||||
UttCard n = n ;
|
UttCard n = n ;
|
||||||
UttAP ap = ap ;
|
UttAP ap = { s = ap.s ! Hau } ;
|
||||||
UttInterj i = i ;
|
UttInterj i = i ;
|
||||||
|
|
||||||
NoPConj = {s = []} ;
|
NoPConj = {s = []} ;
|
||||||
|
|||||||
@@ -199,10 +199,6 @@ oper
|
|||||||
--- { Abs => "hargle"; Erg => "bargle" }
|
--- { Abs => "hargle"; Erg => "bargle" }
|
||||||
-- the field .agr. is of type Agr.
|
-- the field .agr. is of type Agr.
|
||||||
|
|
||||||
buru_NP : NounPhrase =
|
|
||||||
empty_NP ** { s = \\_ => "buru" ;
|
|
||||||
stem = "buru" } ;
|
|
||||||
|
|
||||||
empty_NP : NounPhrase = { s = \\_ => [] ;
|
empty_NP : NounPhrase = { s = \\_ => [] ;
|
||||||
stem = [] ;
|
stem = [] ;
|
||||||
agr = Hau ;
|
agr = Hau ;
|
||||||
@@ -252,15 +248,23 @@ oper
|
|||||||
inanPron : (x1,_,_,_,x5 : Str) -> Agr -> Pronoun = \zer,zeri,zerk,zere,zertaz,a ->
|
inanPron : (x1,_,_,_,x5 : Str) -> Agr -> Pronoun = \zer,zeri,zerk,zere,zertaz,a ->
|
||||||
persPron zer zeri zerk zere zertaz a ** { anim = Inan } ;
|
persPron zer zeri zerk zere zertaz a ** { anim = Inan } ;
|
||||||
|
|
||||||
|
reflPron : Agr => Str = table {
|
||||||
|
Ni => "neure" ;
|
||||||
|
Hi _ => "heure" ;
|
||||||
|
Gu => "geure" ;
|
||||||
|
Zu => "zeure" ;
|
||||||
|
Zuek => "zeuen" ;
|
||||||
|
hau => "haren" } ;
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
-- Adjective and AP
|
-- Adjective and AP
|
||||||
|
|
||||||
Adjective : Type = {s : AForm => Str ; ph : Phono} ;
|
Adjective : Type = { s : AForm => Str ; ph : Phono } ;
|
||||||
|
|
||||||
Adjective2 : Type = Adjective ** { compl : Postposizio } ;
|
Adjective2 : Type = Adjective ** { compl : Postposizio } ;
|
||||||
|
|
||||||
AdjPhrase : Type = {s : Str ; ph : Phono ; typ : APType} ;
|
AdjPhrase : Type = { s : Agr => Str ;
|
||||||
|
ph : Phono ;
|
||||||
|
typ : APType} ;
|
||||||
|
|
||||||
regAdj : Str -> Adjective = \s ->
|
regAdj : Str -> Adjective = \s ->
|
||||||
let stem : Str = case last s of {
|
let stem : Str = case last s of {
|
||||||
|
|||||||
@@ -90,7 +90,9 @@ lin
|
|||||||
-- copula-preceded complements.
|
-- copula-preceded complements.
|
||||||
|
|
||||||
-- : VPSlash -> VP ;
|
-- : VPSlash -> VP ;
|
||||||
ReflVP vps = complSlash vps buru_NP ; ------ TODO
|
ReflVP vps =
|
||||||
|
let neureBurua : Agr => Str = \\a => reflPron ! a ++ "burua" ;
|
||||||
|
in vps ** insertComp neureBurua <vps : VerbPhrase> ;
|
||||||
|
|
||||||
-- : Comp -> VP ;
|
-- : Comp -> VP ;
|
||||||
UseComp comp = insertComp comp.s (copulaVP comp.copula) ;
|
UseComp comp = insertComp comp.s (copulaVP comp.copula) ;
|
||||||
@@ -138,7 +140,7 @@ lin
|
|||||||
-- Complement : Type = {s : Agr => Str ; copula : SyntVerb1 } ;
|
-- Complement : Type = {s : Agr => Str ; copula : SyntVerb1 } ;
|
||||||
|
|
||||||
-- : AP -> Comp ;
|
-- : AP -> Comp ;
|
||||||
CompAP ap = { s = \\agr => ap.s ++ artDef ! getNum agr ! Abs ! ap.ph ;
|
CompAP ap = { s = \\agr => ap.s ! agr ++ artDef ! getNum agr ! Abs ! ap.ph ;
|
||||||
copula = Izan };
|
copula = Izan };
|
||||||
|
|
||||||
-- : CN -> Comp ;
|
-- : CN -> Comp ;
|
||||||
|
|||||||
Reference in New Issue
Block a user