mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(May) Word order with determiners and relative clauses
This commit is contained in:
@@ -11,7 +11,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
|
|||||||
s = \\poss => case det.poss of {
|
s = \\poss => case det.poss of {
|
||||||
Bare => cn.s ! NF det.n poss ;
|
Bare => cn.s ! NF det.n poss ;
|
||||||
_ => cn.s ! NF det.n det.poss -- TODO check if this make sense
|
_ => cn.s ! NF det.n det.poss -- TODO check if this make sense
|
||||||
} ++ det.s ;
|
} ++ det.s ++ cn.heavyMod ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : PN -> NP ;
|
-- : PN -> NP ;
|
||||||
@@ -52,7 +52,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
|
|||||||
|
|
||||||
-- MassNP : CN -> NP ;
|
-- MassNP : CN -> NP ;
|
||||||
MassNP cn = emptyNP ** {
|
MassNP cn = emptyNP ** {
|
||||||
s = \\poss => cn.s ! NF Sg poss
|
s = \\poss => cn.s ! NF Sg poss ++ cn.heavyMod
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
@@ -130,7 +130,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
|
|||||||
UseN,UseN2 = ResMay.useN ;
|
UseN,UseN2 = ResMay.useN ;
|
||||||
|
|
||||||
-- : N2 -> NP -> CN ;
|
-- : N2 -> NP -> CN ;
|
||||||
ComplN2 n2 np = {
|
ComplN2 n2 np = useN n2 ** {
|
||||||
s = \\nf =>
|
s = \\nf =>
|
||||||
case <n2.c2.isPoss, np.a, nf> of {
|
case <n2.c2.isPoss, np.a, nf> of {
|
||||||
<True, IsPron p, NF num _>
|
<True, IsPron p, NF num _>
|
||||||
@@ -154,7 +154,7 @@ concrete NounMay of Noun = CatMay ** open ResMay, Prelude in {
|
|||||||
|
|
||||||
-- : CN -> RS -> CN ;
|
-- : CN -> RS -> CN ;
|
||||||
RelCN cn rs = cn ** {
|
RelCN cn rs = cn ** {
|
||||||
s = \\nf => cn.s ! nf ++ rs.s ! P3
|
heavyMod = cn.heavyMod ++ rs.s ! P3
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ oper
|
|||||||
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
|
Noun3 : Type = Noun2 ** {c3 : Preposition} ;
|
||||||
|
|
||||||
CNoun : Type = Noun ** {
|
CNoun : Type = Noun ** {
|
||||||
|
heavyMod : Str ; -- heavy stuff like relative clauses after determiner
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PNoun : Type = Noun ;
|
PNoun : Type = Noun ;
|
||||||
@@ -22,7 +23,9 @@ oper
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
useN : Noun -> CNoun = \n -> n ;
|
useN : Noun -> CNoun = \n -> n ** {
|
||||||
|
heavyMod = []
|
||||||
|
} ;
|
||||||
|
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
-- Pronoun
|
-- Pronoun
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV go_V))))
|
--------------------------------------------------------------
|
||||||
LangEng: a cat that goes
|
-- Basics
|
||||||
LangMay: kucing yang pergi
|
|
||||||
|
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||||
|
LangEng: a cat that walks
|
||||||
|
LangMay: kucing yang jalan
|
||||||
|
|
||||||
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
Lang: DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||||
LangEng: a cat that drinks milk
|
LangEng: a cat that drinks milk
|
||||||
@@ -10,10 +13,23 @@ Lang: MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash Id
|
|||||||
LangEng: milk that the cat drinks
|
LangEng: milk that the cat drinks
|
||||||
LangMay: susu yang kucing minum
|
LangMay: susu yang kucing minum
|
||||||
|
|
||||||
|
-- NB. if you feel tempted to rephrase because nobody says this in real life, that's not the point here.
|
||||||
|
-- We can find another RGL tree that produces the more natural variant. This tree produces this variant.
|
||||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashPrep (PredVP (DetCN (DetQuant DefArt NumSg) (UseN dog_N)) (UseV walk_V)) with_Prep))))
|
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashPrep (PredVP (DetCN (DetQuant DefArt NumSg) (UseN dog_N)) (UseV walk_V)) with_Prep))))
|
||||||
LangEng: the cat that the dog walks with
|
LangEng: the cat that the dog walks with
|
||||||
LangMay: kucing yang anjing jalan dengannya
|
LangMay: kucing yang anjing jalan dengannya
|
||||||
|
|
||||||
|
--------------------------------------------------------------
|
||||||
|
-- Determiner placement
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant this_Quant NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))
|
||||||
|
LangEng: this cat that walks
|
||||||
|
LangMay: kucing ini yang jalan
|
||||||
|
|
||||||
|
Lang: DetCN (DetQuant (PossPron i_Pron) NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))
|
||||||
|
LangEng: my cat that drinks milk
|
||||||
|
LangMay: kucing saya yang minum susu
|
||||||
|
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
-- Complex example: "the book that his/her father gave him/her"
|
-- Complex example: "the book that his/her father gave him/her"
|
||||||
|
|
||||||
@@ -25,15 +41,11 @@ LangMay: bapanya memberi buku kepadanya
|
|||||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash2V3 give_V3 (UsePron she_Pron))))))
|
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash2V3 give_V3 (UsePron she_Pron))))))
|
||||||
LangMay: buku yang bapanya beri kepadanya
|
LangMay: buku yang bapanya beri kepadanya
|
||||||
|
|
||||||
-- 3. A book that her father gave to me
|
|
||||||
Lang: DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant DefArt NumSg) (ComplN2 father_N2 (UsePron she_Pron))) (Slash3V3 give_V3 (UsePron i_Pron))))))
|
|
||||||
LangMay: buku yang bapanya beri kepadaku
|
|
||||||
|
|
||||||
-- The preposition "kepada" comes from the definition of give_V3 in LexiconMay.gf.
|
-- The preposition "kepada" comes from the definition of give_V3 in LexiconMay.gf.
|
||||||
-- If "buku yang bapanya beri kepadaku" is correct in the general sense, but sometimes
|
-- If "buku yang bapanya beri kepadanya" is correct in general, but sometimes
|
||||||
-- we want to say "buku yang bapanya beri", we can create a coercion function
|
-- we want to say "buku yang bapanya beri", we can create a coercion function
|
||||||
-- from V3 to V2: just drop the indirect object preposition.
|
-- from V3 to V2: just drop the indirect object preposition.
|
||||||
-- This is easy to do in an application grammar.
|
-- That is easy to do in an application grammar.
|
||||||
|
|
||||||
-- If we want to do this consistently: always drop the indirect object in a relative clause,
|
-- If we want to do this consistently: always drop the indirect object in a relative clause,
|
||||||
-- i.e. never say "buku yang bapanya beri kepada(ku/mu/nya)"
|
-- i.e. never say "buku yang bapanya beri kepada(ku/mu/nya)"
|
||||||
@@ -49,4 +61,4 @@ LangMay: saya mahu baca buku yang bapaku baca
|
|||||||
|
|
||||||
-- bonus tree: we can also generate "bapa saya", not just "bapaku"
|
-- bonus tree: we can also generate "bapa saya", not just "bapaku"
|
||||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (SlashV2a read_V2)))))))))
|
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant DefArt NumSg) (RelCN (UseN book_N) (UseRCl (TTAnt TPast ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN2 father_N2)) (SlashV2a read_V2)))))))))
|
||||||
LangMay: saya mahu baca buku yang bapa saya baca
|
LangMay: saya mahu baca buku yang bapa saya baca
|
||||||
Reference in New Issue
Block a user