mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 00:52:51 -06:00
stat; type of imperatives in lib/resource
This commit is contained in:
@@ -146,7 +146,7 @@ fun
|
||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||
QuestAdv : IAdv -> Cl -> QCl ; -- "why do you walk"
|
||||
|
||||
PosImpVP, NegImpVP : VPI -> Imp ; -- "(don't) be a man"
|
||||
PosImpVP, NegImpVP : VCl -> Imp ; -- "(don't) be a man"
|
||||
|
||||
----rename these ??
|
||||
IndicPhrase : S -> Phr ; -- "I walk."
|
||||
|
||||
@@ -1278,13 +1278,13 @@ oper
|
||||
|
||||
Imperative = SS1 Number ;
|
||||
|
||||
imperVerbPhrase : Bool -> VerbPhrase -> Imperative = \b,walk ->
|
||||
imperVerbPhrase : Bool -> VerbClause -> Imperative = \b,walk ->
|
||||
{s = \\n =>
|
||||
let
|
||||
a = toAgr n P2 human ;
|
||||
dont = if_then_Str b [] "don't"
|
||||
in
|
||||
dont ++ walk.s ! VIInfinit ! a
|
||||
dont ++ walk.s ! b ! Simul ! VIInfinit ! a
|
||||
} ;
|
||||
|
||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||
|
||||
@@ -47,8 +47,8 @@ lincat
|
||||
|
||||
V = Verb1 ;
|
||||
-- = {s : VForm => Str}
|
||||
---- VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
||||
VPI = {s : Bool => VIForm => Str ; sc : Case} ;
|
||||
VPI = {s : VIForm => Number => Str ; sc : Case} ;
|
||||
VCl = {s : Bool => Anteriority => VIForm => Number => Str ; sc : Case} ;
|
||||
----- VP = Verb ** {s2 : VForm => Str ; c : ComplCase} ;
|
||||
---- VG = {s,s2 : Bool => VForm => Str ; c : ComplCase} ;
|
||||
V2 = TransVerb ;
|
||||
@@ -67,6 +67,7 @@ lincat
|
||||
|
||||
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
||||
Tense = {s : Str ; t : Tense} ;
|
||||
Pol = {s : Str ; p : Bool} ;
|
||||
Ant = {s : Str ; a : Anteriority} ;
|
||||
|
||||
PP = {s : Str} ;
|
||||
|
||||
@@ -39,7 +39,7 @@ lin
|
||||
|
||||
DetNP = detNounPhrase ;
|
||||
NDetNP = numDetNounPhrase ;
|
||||
---- NDetNum = justNumDetNounPhrase ;
|
||||
NDetNum d n = numDetNounPhrase d n emptyCommNounPhrase ;
|
||||
MassNP = partNounPhrase singular ;
|
||||
|
||||
AppN2 = appFunComm ;
|
||||
@@ -81,7 +81,7 @@ lin
|
||||
|
||||
---- ComplA2S = predAdjSent2 ;
|
||||
|
||||
---- AdjPart = adjPastPart ;
|
||||
AdjPart verb = {s = \\a => verb.s ! PastPartPass a} ;
|
||||
|
||||
---- UseV2V x = verb2aux x ** {isAux = False} ;
|
||||
|
||||
@@ -92,7 +92,7 @@ lin
|
||||
|
||||
UseCl tp cl = {s = tp.s ++ cl.s ! tp.b ! VFinite SDecl tp.t tp.a} ;
|
||||
UseQCl tp cl = {s = tp.s ++ cl.s ! tp.b ! VFinite SQuest tp.t tp.a} ;
|
||||
---- UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! a} ;
|
||||
UseRCl tp cl = {s = \\n => tp.s ++ cl.s ! tp.b ! VFinite SDecl tp.t tp.a ! n} ;
|
||||
|
||||
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
||||
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;
|
||||
@@ -101,6 +101,9 @@ lin
|
||||
TPast = {s = [] ; t = Past} ;
|
||||
TFuture = {s = [] ; t = Future} ;
|
||||
TConditional = {s = [] ; t = Conditional} ;
|
||||
PPos = {s = [] ; p = True} ;
|
||||
PNeg = {s = [] ; p = False} ;
|
||||
|
||||
|
||||
ASimul = {s = [] ; a = Simul} ;
|
||||
AAnter = {s = [] ; a = Anter} ;
|
||||
|
||||
@@ -42,6 +42,8 @@ oper
|
||||
|
||||
CommNounPhrase = {s : Bool => Number => Case => Str ; g : Gender} ;
|
||||
|
||||
emptyCommNounPhrase : CommNounPhrase = {s = \\_,_,_ => [] ; g = NonHuman} ;
|
||||
|
||||
noun2CommNounPhrase : CommNoun -> CommNounPhrase = \man ->
|
||||
useCN man ** {g = man.g} ;
|
||||
|
||||
@@ -323,7 +325,6 @@ oper
|
||||
adj2adjPhrase : Adjective -> AdjPhrase = \uusi ->
|
||||
{s = \\_ => uusi.s} ;
|
||||
|
||||
|
||||
--3 Comparison adjectives
|
||||
--
|
||||
-- Each of the comparison forms has a characteristic use:
|
||||
@@ -503,8 +504,8 @@ oper
|
||||
SType = SDecl | SQuest ;
|
||||
|
||||
VIForm =
|
||||
VIInfinit Anteriority
|
||||
| VIImperat Number
|
||||
VIInfinit
|
||||
| VIImperat
|
||||
| VIInf3Iness
|
||||
| VIInf3Elat
|
||||
| VIInf3Illat
|
||||
@@ -517,7 +518,8 @@ oper
|
||||
|
||||
oper
|
||||
Clause : Type = {s : Bool => SForm => Str} ;
|
||||
VerbPhraseInf : Type = {s : Bool => VIForm => Str ; sc : Case} ;
|
||||
VerbPhraseInf : Type = {s : VIForm => Number => Str ; sc : Case} ;
|
||||
VerbClauseInf : Type = {s : Bool => Anteriority => VIForm => Number => Str ; sc : Case} ;
|
||||
|
||||
Sats : Type = {
|
||||
subj : Str ;
|
||||
@@ -527,7 +529,7 @@ oper
|
||||
} ;
|
||||
obj : Bool => SVIForm => Str ;
|
||||
comp : Str ;
|
||||
vpi : VerbPhraseInf
|
||||
vpi : Bool => VerbPhraseInf
|
||||
} ;
|
||||
|
||||
sats2clause : Sats -> Clause = \sats ->
|
||||
@@ -546,7 +548,8 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
sats2verbPhrase : {s : Str ; a : Anteriority} -> Sats -> VerbPhraseInf = \a,sats ->
|
||||
{-
|
||||
sats2verbClause : {s : Str ; a : Anteriority} -> Sats -> VerbPhraseInf = \a,sats ->
|
||||
{s = \\b,vi =>
|
||||
let
|
||||
inf = sats.vpi.s ! b ! vi ;
|
||||
@@ -556,7 +559,7 @@ oper
|
||||
a.s ++ inf ++ obj ++ comp ;
|
||||
sc = sats.vpi.sc
|
||||
} ;
|
||||
|
||||
-}
|
||||
questPart : Str -> Str = \s -> glueParticle s "ko" ; --- "kö"
|
||||
|
||||
mkSats : NounPhrase -> Verb1 -> Sats = \subj,verb ->
|
||||
@@ -572,12 +575,12 @@ oper
|
||||
pred = \\b,sf => vi b (SCl sf) ;
|
||||
obj = \\_,_ => [] ;
|
||||
comp = [] ;
|
||||
vpi = {
|
||||
s = \\b,f => let vp = vi b (SVI f) in vp.fin ++ vp.inf ;
|
||||
vpi = \\b => {
|
||||
s = \\f,n => let vp = vi b (SVI f) in vp.fin ++ vp.inf ;
|
||||
sc = sc
|
||||
}
|
||||
} ;
|
||||
|
||||
{- ----
|
||||
progressiveSats : NounPhrase -> VerbPhraseInf -> Sats = \subj,vp ->
|
||||
let
|
||||
np = case vp.sc of {
|
||||
@@ -590,12 +593,12 @@ oper
|
||||
pred = \\b,sf => vi b (SCl sf) ;
|
||||
obj = \\_,_ => [] ;
|
||||
comp = vp.s ! True ! VIInf3Iness ;
|
||||
vpi = {
|
||||
s = \\b,f => let vv = vi b (SVI f) in vv.fin ++ vv.inf ;
|
||||
vpi = \\b => {
|
||||
s = \\f => let vv = vi b (SVI f) in vv.fin ++ vv.inf ;
|
||||
sc = Nom
|
||||
}
|
||||
} ;
|
||||
|
||||
-}
|
||||
mkSatsObject : NounPhrase -> TransVerb -> NounPhrase -> Sats = \subj,verb,obj ->
|
||||
insertObject (mkSats subj verb) verb.c verb.s3 verb.p obj ;
|
||||
|
||||
@@ -691,7 +694,7 @@ oper
|
||||
SCl (VFinite _ Conditional a) => ei a (Cond n p) (Cond Sg P3) ;
|
||||
SCl (VFinite _ Present a) => ei a (Pres n p) (Imper Sg) ;
|
||||
SCl (VFinite _ Future a) => fut a (Pres n p) (Imper Sg) ;
|
||||
SVI (VIImperat n ) => älä n ;
|
||||
SVI (VIImperat ) => älä n ;
|
||||
SVI i => inf i Simul ---- Anter
|
||||
} ;
|
||||
|
||||
@@ -1133,8 +1136,8 @@ oper
|
||||
|
||||
Imperative = SS1 Number ;
|
||||
|
||||
imperVerbPhrase : Bool -> VerbPhraseInf -> Imperative = \b,ui ->
|
||||
{s = \\n => ui.s ! b ! VIImperat n} ;
|
||||
imperVerbPhrase : Bool -> VerbClauseInf -> Imperative = \b,ui ->
|
||||
{s = ui.s ! b ! Simul ! VIImperat} ;
|
||||
|
||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||
ss (I.s ! n ++ exclPunct) ;
|
||||
|
||||
@@ -927,8 +927,8 @@ oper
|
||||
|
||||
Imperative = {s : Gender => Number => Str} ;
|
||||
|
||||
imperVerbPhrase : Bool -> VerbPhrase -> Imperative = \b,dormir ->
|
||||
{s = \\g,n => dormir.s ! VIImperat b n ! g ! n ! P2
|
||||
imperVerbPhrase : Bool -> VerbClause -> Imperative = \b,dormir ->
|
||||
{s = \\g,n => dormir.s ! b ! Simul ! VIImperat b n ! g ! n ! P2
|
||||
} ;
|
||||
|
||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||
|
||||
@@ -1427,9 +1427,9 @@ oper
|
||||
|
||||
Imperative = {s : Number => Str} ;
|
||||
|
||||
imperVerbPhrase : Bool -> VerbPhrase -> Imperative = \b,titta ->
|
||||
imperVerbPhrase : Bool -> VerbClause -> Imperative = \b,titta ->
|
||||
{s = \\n =>
|
||||
titta.s ! VIImperat b ! utrum ! n ! P2
|
||||
titta.s ! b ! Simul ! VIImperat b ! utrum ! n ! P2
|
||||
} ;
|
||||
|
||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||
|
||||
Reference in New Issue
Block a user