mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
(May) ImpersCl, AdvVP + tests about verbal prefixes
This commit is contained in:
@@ -6,13 +6,17 @@ concrete IdiomMay of Idiom = CatMay ** open Prelude, ResMay, VerbMay, NounMay, S
|
||||
-- This module defines constructions that are formed in fixed ways,
|
||||
-- often different even in closely related languages.
|
||||
|
||||
{- lin
|
||||
lin
|
||||
|
||||
|
||||
-- ImpersCl : VP -> Cl ; -- it is hot
|
||||
-- GenericCl : VP -> Cl ; -- one sleeps
|
||||
ImpersCl,
|
||||
GenericCl = \vp -> predVP impersNP (passVP vp) ;
|
||||
-- ImpersCl : VP -> Cl ; -- it is hot
|
||||
ImpersCl vp = {
|
||||
subj = [] ;
|
||||
pred = \\vf,pol => vp.s ! Root ! pol -- force no prefix -- TODO check if legit?
|
||||
} ;
|
||||
{-
|
||||
-- GenericCl : VP -> Cl ; -- one sleeps
|
||||
GenericCl = \vp -> predVP impersNP (passVP vp) ;
|
||||
|
||||
CleftNP : NP -> RS -> Cl ; -- it is I who did it
|
||||
CleftAdv : Adv -> S -> Cl ; -- it is here she slept
|
||||
|
||||
@@ -274,8 +274,8 @@ lin person_N = mkN "orang" ;
|
||||
-- lin queen_N = mkN "" ;
|
||||
-- lin question_N = mkN "" ;
|
||||
-- lin radio_N = mkN "" ;
|
||||
-- lin rain_N = mkN "" ;
|
||||
-- lin rain_V0 = mkV "" ;
|
||||
lin rain_N = mkN "hujan" ;
|
||||
lin rain_V0 = mkV "hujan" ;
|
||||
lin read_V2 = mkV2 "baca" ;
|
||||
-- lin ready_A = mkA "" ;
|
||||
-- lin reason_N = mkN "" ;
|
||||
@@ -301,8 +301,8 @@ lin read_V2 = mkV2 "baca" ;
|
||||
-- lin salt_N = mkN "" ;
|
||||
-- lin sand_N = mkN "" ;
|
||||
-- lin say_VS = mkVS "" ;
|
||||
-- lin school_N = mkN "" ;
|
||||
-- lin science_N = mkN "" ;
|
||||
lin school_N = mkN "sekolah" ;
|
||||
lin science_N = mkN "sains" ;
|
||||
-- lin scratch_V2 = mkV2 "" ;
|
||||
-- lin sea_N = mkN "" ;
|
||||
-- lin see_V2 = mkV2 "" ;
|
||||
|
||||
@@ -84,10 +84,13 @@ lin
|
||||
|
||||
-- : Comp -> VP ;
|
||||
UseComp comp = comp ;
|
||||
{-
|
||||
-- : VP -> Adv -> VP ; -- sleep here
|
||||
AdvVP = insertAdv ;
|
||||
|
||||
-- : VP -> Adv -> VP ; -- sleep here
|
||||
AdvVP vp adv = vp ** {
|
||||
s = \\vf,pol => vp.s ! vf ! pol ++ adv.s
|
||||
} ;
|
||||
|
||||
{-
|
||||
-- : VPSlash -> Adv -> VPSlash ; -- use (it) here
|
||||
AdvVPSlash = insertAdv ;
|
||||
|
||||
|
||||
104
src/malay/unittest/verbal_affixes.gftest
Normal file
104
src/malay/unittest/verbal_affixes.gftest
Normal file
@@ -0,0 +1,104 @@
|
||||
-- Trying to decide when to use the verbal affixes like meng-, ber-, -i etc.
|
||||
-- I understand that this goes beyond mere syntax, so any rules are necessarily incomplete.
|
||||
-- I want to find out what's a good API to use in applications, where you need finer control of when to use prefixes.
|
||||
|
||||
----------------------------------------
|
||||
-- Simple declarative sentences
|
||||
|
||||
-- Intransitive verbs
|
||||
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (UseV walk_V)))
|
||||
LangEng: my cat walks
|
||||
LangMay: kucing saya berjalan
|
||||
|
||||
-- As a verbal complement
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant (PossPron i_Pron) NumSg) (UseN cat_N)) (ComplVV want_VV (UseV walk_V))))
|
||||
LangEng: my cat wants to walk
|
||||
LangMay: kucing saya mahu jalan
|
||||
|
||||
-- Transitive verbs
|
||||
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant this_Quant NumSg) (UseN book_N)))))
|
||||
LangEng: I read this book
|
||||
LangMay: saya membaca buku ini
|
||||
|
||||
-- As a verbal complement
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplVV want_VV (ComplSlash (SlashV2a read_V2) (DetCN (DetQuant this_Quant NumSg) (UseN book_N))))))
|
||||
LangEng: I want to read this book
|
||||
LangMay: saya mahu baca buku ini
|
||||
|
||||
-- How about words like mengajar and belajar? Is the prefix more important here?
|
||||
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplSlash (SlashV2a learn_V2) (MassNP (UseN science_N))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N))))))
|
||||
LangEng: I learn science in the school
|
||||
LangMay: saya belajar sains di sekolah
|
||||
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplSlash (SlashV2a teach_V2) (MassNP (UseN science_N))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N))))))
|
||||
LangEng: I teach science in the school
|
||||
LangMay: saya mengajar sains di sekolah
|
||||
|
||||
-- The way the grammar is currently defined, we'd get the same output for both "I want to learn/study science". Is this correct, or should one or both of the verbs keep the ber/meng prefix in this context?
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV want_VV (ComplSlash (SlashV2a teach_V2) (MassNP (UseN science_N)))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N))))))
|
||||
LangEng: I want to teach science in the school
|
||||
LangMay: saya mahu ajar sains di sekolah
|
||||
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (AdvVP (ComplVV want_VV (ComplSlash (SlashV2a learn_V2) (MassNP (UseN science_N)))) (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN school_N))))))
|
||||
LangEng: I want to learn science in the school
|
||||
LangMay: saya mahu ajar sains di sekolah
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Relative clauses
|
||||
|
||||
-- Intransitive verbs
|
||||
|
||||
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
|
||||
|
||||
-- In a context
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (UseV walk_V))))))))
|
||||
LangEng: I buy a cat that walks
|
||||
LangMay: saya membeli kucing yang jalan
|
||||
|
||||
-- Transitive verbs
|
||||
|
||||
-- The subject of the verb phrase is the head (cat drinks milk -> *cat* that drinks milk)
|
||||
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
|
||||
LangMay: kucing yang minum susu
|
||||
|
||||
-- The object of the verb phrase is the head (cat drinks milk -> *milk* that cat drinks)
|
||||
Lang: MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)) (SlashV2a drink_V2)))))
|
||||
LangEng: milk that a cat drinks
|
||||
LangMay: susu yang kucing minum
|
||||
|
||||
-- Both in context
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a buy_V2) (DetCN (DetQuant IndefArt NumSg) (RelCN (UseN cat_N) (UseRCl (TTAnt TPres ASimul) PPos (RelVP IdRP (ComplSlash (SlashV2a drink_V2) (MassNP (UseN milk_N))))))))))
|
||||
LangEng: I buy a cat that drinks milk
|
||||
LangMay: saya membeli kucing yang minum susu
|
||||
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (UsePron i_Pron) (ComplSlash (SlashV2a buy_V2) (MassNP (RelCN (UseN milk_N) (UseRCl (TTAnt TPres ASimul) PPos (RelSlash IdRP (SlashVP (DetCN (DetQuant IndefArt NumSg) (UseN cat_N)) (SlashV2a drink_V2)))))))))
|
||||
LangEng: I buy milk that a cat drinks
|
||||
LangMay: saya membeli susu yang kucing minum
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Generic constructions like "it rains": prefix or not?
|
||||
|
||||
-- On its own
|
||||
Lang: UttS (UseCl (TTAnt TPres ASimul) PPos (ImpersCl (AdvVP (UseV rain_V0) now_Adv)))
|
||||
LangEng: it rains now
|
||||
LangMay: hujan sekarang
|
||||
|
||||
-- In a context
|
||||
Lang: UttS (AdvS (SubjS if_Subj (UseCl (TTAnt TPast ASimul) PNeg (ImpersCl (UseV rain_V0)))) (ExtAdvS now_Adv (UseCl (TTAnt TCond ASimul) PPos (PredVP (UsePron i_Pron) (UseV walk_V)))))
|
||||
LangEng: if it didn't rain now , I would walk
|
||||
LangMay: sekiranya tidak hujan sekarang , saya akan berjalan
|
||||
|
||||
----------------------------------------
|
||||
-- Imperative
|
||||
|
||||
|
||||
----------------------------------------
|
||||
-- Questions
|
||||
Reference in New Issue
Block a user