(Kor) Use obj in imp, overriding V2's subject case

This commit is contained in:
Inari Listenmaa
2023-05-29 19:30:40 +02:00
parent fcfb60b6e5
commit 70cbbe689d
4 changed files with 18 additions and 11 deletions

View File

@@ -108,6 +108,9 @@ param
| Imperative | Imperative
| Propositive ; | Propositive ;
ObjectForm = -- sometimes need to override V2's object case for Imp
DeclObj
| ImpObj ;
-- TODO: include Aspect and SentenceType. -- TODO: include Aspect and SentenceType.
-- These are all Generic and Declarative. -- These are all Generic and Declarative.

View File

@@ -8,7 +8,7 @@ lin
-- : RP -> VP -> RCl ; -- : RP -> VP -> RCl ;
RelVP rp vp = vp ** { -- TODO no tenses yet in the grammar RelVP rp vp = vp ** { -- TODO no tenses yet in the grammar
s = \\t,a,p,cltyp => s = \\t,a,p,cltyp =>
rp.s ++ vp.adv ++ vp.nObj ++ rp.s ++ vp.adv ++ vp.nObj ! DeclObj ++
case cltyp of { case cltyp of {
WithConj => vp.s ! VStem p ; WithConj => vp.s ! VStem p ;
_ => vp.s ! VAttr p } ; _ => vp.s ! VAttr p } ;

View File

@@ -320,17 +320,14 @@ oper
BaseVP : Type = { BaseVP : Type = {
adv, adv,
nObj, vComp : Str ;
vComp : Str nObj : ObjectForm => Str ; -- may need diff form for imperative vs. declarative sentences
-- {subjunc : Str ; -- inflected verb complement
-- inf : Str ; -- infinitive verb complement
-- subcl : Str} -- clause complement
} ; } ;
baseVP : BaseVP = { baseVP : BaseVP = {
adv, adv,
nObj,
vComp = [] ; vComp = [] ;
nObj = \\_ => []
} ; } ;
VerbPhrase : Type = BaseVerb ** Complement ** BaseVP ; VerbPhrase : Type = BaseVerb ** Complement ** BaseVP ;
@@ -342,7 +339,9 @@ oper
useVc : Verb2 -> VPSlash = \v2 -> baseVP ** v2 ; useVc : Verb2 -> VPSlash = \v2 -> baseVP ** v2 ;
insertComp : VPSlash -> NounPhrase -> VerbPhrase = \v2,np -> useV v2 ** { insertComp : VPSlash -> NounPhrase -> VerbPhrase = \v2,np -> useV v2 ** {
nObj = np.s ! v2.c2 ++ v2.p2.s ! np.p nObj = table {
DeclObj => np.s ! v2.c2 ++ v2.p2.s ! np.p ;
ImpObj => np.s ! Object ++ v2.p2.s ! np.p } -- use 을/를 always for imperative
} ; } ;
insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s ++ vp.adv} ; insertAdv : VerbPhrase -> SS -> VerbPhrase = \vp,adv -> vp ** {adv = adv.s ++ vp.adv} ;
@@ -378,7 +377,7 @@ oper
WithConj => VStem p ; WithConj => VStem p ;
Statement st => VF st p } -- TODO: more tenses Statement st => VF st p } -- TODO: more tenses
in np in np
++ vp.nObj -- an object, not copula complement ++ vp.nObj ! DeclObj -- an object, not copula complement
++ vp.adv ++ vp.adv
++ vp.s ! vf ++ vp.s ! vf
} ; } ;
@@ -387,6 +386,11 @@ oper
-- linrefs -- linrefs
linVerb : Verb -> Str = \v -> v.s ! linVF ; linVerb : Verb -> Str = \v -> v.s ! linVF ;
linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ++ vp.adv ++ vp.s ! vf ; linVP : VForm -> VerbPhrase -> Str = \vf,vp -> vp.nObj ! DeclObj ++ vp.adv ++ vp.s ! vf ;
linImp : Polarity -> VerbPhrase -> Str = \pol,vp ->
let vf : VForm = case pol of {
Pos => VF Polite Pos ;
Neg => VImpNeg }
in vp.nObj ! ImpObj ++ vp.adv ++ vp.s ! vf ;
linAP : AdjPhrase -> Str = \ap -> ap.compar ++ ap.s ! linVF ; linAP : AdjPhrase -> Str = \ap -> ap.compar ++ ap.s ! linVF ;
} }

View File

@@ -32,7 +32,7 @@ lin
-} -}
--2 Imperatives --2 Imperatives
-- : VP -> Imp ; -- : VP -> Imp ;
ImpVP vp = {s = \\pol => linVP (VF Polite pol) vp} ; ImpVP vp = {s = \\pol => linImp pol vp} ;
--2 Embedded sentences --2 Embedded sentences