mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 08:58:55 -06:00
(May) Add PassV2 + new tests
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
--# -path=.:../abstract:../common:../prelude:../api
|
||||
concrete LangMay of Lang =
|
||||
GrammarMay,
|
||||
LexiconMay,
|
||||
|
||||
@@ -217,7 +217,7 @@ lin learn_V2 = mkV2 (mkV "ajar" Ber) emptyPrep ;
|
||||
-- lin lose_V2 = mkV2 "" ;
|
||||
-- lin louse_N = mkN "" ;
|
||||
-- lin love_N = mkN "" ;
|
||||
-- lin love_V2 = mkV2 "" ;
|
||||
lin love_V2 = mkV2 "cinta" ;
|
||||
|
||||
----
|
||||
-- M
|
||||
|
||||
@@ -109,13 +109,15 @@ oper
|
||||
} ;
|
||||
|
||||
mkV2 = overload {
|
||||
mkV2 : Str -> V2 = \v2 -> lin V2 ((mkVerb v2 Meng) ** {c2 = emptyPrep}) ;
|
||||
mkV2 : V -> Prep -> V2 = \v,p -> lin V2 (v ** {c2 = p})
|
||||
mkV2 : Str -> V2 = \v2 -> lin V2 (mkVerb2 (mkVerb v2 Meng) emptyPrep) ;
|
||||
mkV2 : V -> Prep -> V2 = \v,p -> lin V2 (mkVerb2 v p)
|
||||
} ;
|
||||
|
||||
mkV3 = overload {
|
||||
mkV3 : V -> V3 = \v -> lin V3 (v ** {c2,c3 = emptyPrep}) ;
|
||||
mkV3 : V -> (p,q : Prep) -> V3 = \v,p,q -> lin V3 (v ** {c2 = p ; c3 = q})
|
||||
mkV3 : V -> V3 = \v ->
|
||||
lin V3 (mkVerb3 v emptyPrep emptyPrep) ;
|
||||
mkV3 : V -> (p,q : Prep) -> V3 = \v,p,q ->
|
||||
lin V3 (mkVerb3 v p q)
|
||||
} ;
|
||||
|
||||
-- mkVV = overload {
|
||||
|
||||
@@ -119,12 +119,13 @@ param
|
||||
param
|
||||
VForm =
|
||||
Root -- infinitive, imperative, …
|
||||
| Active ;
|
||||
| Active
|
||||
;
|
||||
|
||||
Prefix =
|
||||
Meng
|
||||
| Ber
|
||||
; -- TODO more
|
||||
; -- TODO more?
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Clauses
|
||||
|
||||
@@ -118,8 +118,14 @@ oper
|
||||
Verb : Type = {
|
||||
s : VForm => Str
|
||||
} ;
|
||||
Verb2 : Type = Verb ** {c2 : Preposition} ;
|
||||
Verb3 : Type = Verb2 ** {c3 : Preposition} ;
|
||||
Verb2 : Type = Verb ** {
|
||||
c2 : Preposition ;
|
||||
passive : Str
|
||||
} ;
|
||||
|
||||
Verb3 : Type = Verb2 ** {
|
||||
c3 : Preposition
|
||||
} ;
|
||||
|
||||
-- VV : Type = Verb ** {vvtype : VVForm} ;
|
||||
|
||||
@@ -128,7 +134,15 @@ oper
|
||||
Root => str ;
|
||||
Active => prefix p str
|
||||
}
|
||||
} ;
|
||||
} ;
|
||||
|
||||
mkVerb2 : Verb -> Preposition -> Verb2 = \v,pr -> v ** {
|
||||
c2 = pr ;
|
||||
passive = "di" + v.s ! Root -- TODO check
|
||||
} ;
|
||||
|
||||
mkVerb3 : Verb -> (p,q : Preposition) -> Verb3 = \v,p,q ->
|
||||
mkVerb2 v p ** {c3 = q} ;
|
||||
|
||||
copula : Verb = {s = \\_ => "ada"} ; -- TODO
|
||||
------------------
|
||||
|
||||
@@ -9,7 +9,10 @@ lin
|
||||
UseV = ResMay.useV ;
|
||||
|
||||
-- : V2 -> VP ; -- be loved
|
||||
-- PassV2 = ResMay.passV2 ;
|
||||
PassV2 v2 = {
|
||||
s = \\_ => v2.passive
|
||||
-- Root => v2.s ! Root ; -- TODO: passive + verbal complements = ???
|
||||
} ;
|
||||
|
||||
-- : VPSlash -> VP ;
|
||||
-- ReflVP = ResMay.insertRefl ;
|
||||
@@ -40,7 +43,7 @@ lin
|
||||
SlashV2a v2 = v2 ;
|
||||
|
||||
-- : V3 -> NP -> VPSlash ; -- give it (to her)
|
||||
Slash2V3 v3 dobj = {
|
||||
Slash2V3 v3 dobj = v3 ** {
|
||||
s = \\vf => v3.s ! vf ++ v3.c2.s ++ dobj.s ;
|
||||
c2 = v3.c3 -- Now the VPSlash is missing only the indirect object
|
||||
} ;
|
||||
|
||||
7
src/malay/unittest/passive.gftest
Normal file
7
src/malay/unittest/passive.gftest
Normal file
@@ -0,0 +1,7 @@
|
||||
Lang: UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN dog_N)) (PassV2 love_V2))
|
||||
LangEng: the dog is loved
|
||||
LangMay: anjing dicinta
|
||||
|
||||
Lang: UseCl (TTAnt TPres ASimul) PNeg (PredVP (DetCN (DetQuant DefArt NumSg) (UseN dog_N)) (PassV2 love_V2))
|
||||
LangEng: the dog isn't loved
|
||||
LangMay: anjing tidak dicinta
|
||||
Reference in New Issue
Block a user