mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-23 09:52:55 -06:00
Tense to Common ; Idiom ; Text
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
concrete CatEng of Cat = TenseX ** open ResEng, Prelude in {
|
||||
concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
@@ -6,7 +6,7 @@ concrete CatEng of Cat = TenseX ** open ResEng, Prelude in {
|
||||
|
||||
-- Phrase
|
||||
|
||||
Text, Phr, Utt, Voc = {s : Str} ;
|
||||
Utt, Voc = {s : Str} ;
|
||||
|
||||
-- Tensed/Untensed
|
||||
|
||||
@@ -35,9 +35,10 @@ concrete CatEng of Cat = TenseX ** open ResEng, Prelude in {
|
||||
-- Verb
|
||||
|
||||
VP = {
|
||||
s : Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ;
|
||||
ad : Str ;
|
||||
s2 : Agr => Str
|
||||
s : Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ;
|
||||
prp : Str ; -- present participle
|
||||
ad : Str ;
|
||||
s2 : Agr => Str
|
||||
} ;
|
||||
Comp = {s : Agr => Str} ;
|
||||
SC = {s : Str} ;
|
||||
|
||||
@@ -4,9 +4,11 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
lin
|
||||
ExistNP np =
|
||||
mkClause "there" (agrP3 Sg) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
|
||||
ImpersVP vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
-- ProgrVP : VP -> VP ; -- sleeping
|
||||
mkClause "there" (agrP3 np.a.n) (insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
|
||||
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@ concrete LangEng of Lang =
|
||||
LexiconEng
|
||||
** {
|
||||
|
||||
flags startcat = Phr ;
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -162,9 +162,10 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
Tense => Anteriority => Polarity => Order => Agr => {fin, inf : Str} ;
|
||||
|
||||
VP : Type = {
|
||||
s : VerbForms ;
|
||||
ad : Str ;
|
||||
s2 : Agr => Str
|
||||
s : VerbForms ;
|
||||
prp : Str ; -- present participle
|
||||
ad : Str ;
|
||||
s2 : Agr => Str
|
||||
} ;
|
||||
|
||||
--- The order gets wrong with AdV, but works around a parser
|
||||
@@ -200,6 +201,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
|
||||
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
|
||||
} ;
|
||||
prp = verb.s ! VPresPart ;
|
||||
ad = [] ;
|
||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
||||
} ;
|
||||
@@ -230,12 +232,14 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
<Cond,Anter,Pos,_> => vf "would" ("have" ++ part) ;
|
||||
<Cond,Anter,Neg,_> => vf "wouldn't" ("have" ++ part)
|
||||
} ;
|
||||
prp = verb.prpart ;
|
||||
ad = [] ;
|
||||
s2 = \\_ => []
|
||||
} ;
|
||||
|
||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
ad = vp.ad ;
|
||||
s2 = \\a => vp.s2 ! a ++ obj ! a
|
||||
} ;
|
||||
@@ -244,6 +248,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
ad = vp.ad ++ adv ;
|
||||
s2 = \\a => vp.s2 ! a
|
||||
} ;
|
||||
@@ -264,7 +269,8 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
Neg => \\_ => verbs ! VVPastNeg
|
||||
} ;
|
||||
inf = verbs ! VVF VInf ;
|
||||
ppart = verbs ! VVF VPPart
|
||||
ppart = verbs ! VVF VPPart ;
|
||||
prpart = verbs ! VVF VPresPart ;
|
||||
} ;
|
||||
_ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False}
|
||||
} ;
|
||||
@@ -287,7 +293,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
does = agrVerb "does" "do" ;
|
||||
doesnt = agrVerb "doesn't" "don't" ;
|
||||
|
||||
Aux = {pres,past : Polarity => Agr => Str ; inf,ppart : Str} ;
|
||||
Aux = {pres,past : Polarity => Agr => Str ; inf,ppart,prpart : Str} ;
|
||||
|
||||
auxBe : Aux = {
|
||||
pres = \\b,a => case <b,a> of {
|
||||
@@ -300,7 +306,8 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
_ => (posneg b "were")
|
||||
} ;
|
||||
inf = "be" ;
|
||||
ppart = "been"
|
||||
ppart = "been" ;
|
||||
prpart = "being"
|
||||
} ;
|
||||
|
||||
posneg : Polarity -> Str -> Str = \p,s -> case p of {
|
||||
|
||||
Reference in New Issue
Block a user