mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Eng) Automatic whitespace removal
This commit is contained in:
@@ -21,22 +21,22 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
CAdvAP ad ap np = {
|
CAdvAP ad ap np = {
|
||||||
s = \\a => ad.s ! Pos ++ ap.s ! a ++ ad.p ++ np.s ! npNom ;
|
s = \\a => ad.s ! Pos ++ ap.s ! a ++ ad.p ++ np.s ! npNom ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ComplA2 a np = {
|
ComplA2 a np = {
|
||||||
s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ;
|
s = \\_ => a.s ! AAdj Posit Nom ++ a.c2 ++ np.s ! NPAcc ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ReflA2 a = {
|
ReflA2 a = {
|
||||||
s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ;
|
s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ reflPron ! ag ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SentAP ap sc = {
|
SentAP ap sc = {
|
||||||
s = \\a => ap.s ! a ++ sc.s ;
|
s = \\a => ap.s ! a ++ sc.s ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -10,44 +10,44 @@ concrete BackwardEng of Backward = CatEng ** open ResEng in {
|
|||||||
-- from Verb 19/4/2008
|
-- from Verb 19/4/2008
|
||||||
|
|
||||||
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
||||||
ComplV3 v np np2 =
|
ComplV3 v np np2 =
|
||||||
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
||||||
ComplV2V v np vp =
|
ComplV2V v np vp =
|
||||||
insertObj (\\a => infVP v.isAux vp False Simul CPos a)
|
insertObj (\\a => infVP v.isAux vp False Simul CPos a)
|
||||||
(insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
(insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
||||||
ComplV2S v np s =
|
ComplV2S v np s =
|
||||||
insertObj (\\_ => conjThat ++ s.s)
|
insertObj (\\_ => conjThat ++ s.s)
|
||||||
(insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
(insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
||||||
ComplV2Q v np q =
|
ComplV2Q v np q =
|
||||||
insertObj (\\_ => q.s ! QIndir)
|
insertObj (\\_ => q.s ! QIndir)
|
||||||
(insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
(insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ;
|
||||||
ComplV2A v np ap =
|
ComplV2A v np ap =
|
||||||
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
||||||
|
|
||||||
ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
||||||
|
|
||||||
-- from Sentence 19/4/2008
|
-- from Sentence 19/4/2008
|
||||||
|
|
||||||
SlashV2 np v2 =
|
SlashV2 np v2 =
|
||||||
mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
|
mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
|
||||||
|
|
||||||
SlashVVV2 np vv v2 =
|
SlashVVV2 np vv v2 =
|
||||||
mkClause (np.s ! Nom) np.a
|
mkClause (np.s ! Nom) np.a
|
||||||
(insertObj (\\a => infVP vv.isAux (predV v2) False Simul CPos a) (predVV vv)) **
|
(insertObj (\\a => infVP vv.isAux (predV v2) False Simul CPos a) (predVV vv)) **
|
||||||
{c2 = v2.c2} ;
|
{c2 = v2.c2} ;
|
||||||
|
|
||||||
-- from Noun 19/4/2008
|
-- from Noun 19/4/2008
|
||||||
|
|
||||||
NumInt n = {s = n.s ; n = Pl} ;
|
NumInt n = {s = n.s ; n = Pl} ;
|
||||||
OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED
|
OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED
|
||||||
|
|
||||||
DetSg quant ord = {
|
DetSg quant ord = {
|
||||||
s = quant.s ! Sg ++ ord.s ;
|
s = quant.s ! Sg ++ ord.s ;
|
||||||
n = Sg
|
n = Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetPl quant num ord = {
|
DetPl quant num ord = {
|
||||||
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ concrete BackwardEng of Backward = CatEng ** open ResEng in {
|
|||||||
|
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
s = table {
|
s = table {
|
||||||
Sg => artIndef ;
|
Sg => artIndef ;
|
||||||
Pl => []
|
Pl => []
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -28,14 +28,14 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ;
|
QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ;
|
||||||
IP = {s : NPCase => Str ; n : Number} ;
|
IP = {s : NPCase => Str ; n : Number} ;
|
||||||
IComp = {s : Str} ;
|
IComp = {s : Str} ;
|
||||||
IDet = {s : Str ; n : Number} ;
|
IDet = {s : Str ; n : Number} ;
|
||||||
IQuant = {s : Number => Str} ;
|
IQuant = {s : Number => Str} ;
|
||||||
|
|
||||||
-- Relative
|
-- Relative
|
||||||
|
|
||||||
RCl = {
|
RCl = {
|
||||||
s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ;
|
s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ;
|
||||||
c : NPCase
|
c : NPCase
|
||||||
} ;
|
} ;
|
||||||
RP = {s : RCase => Str ; a : RAgr} ;
|
RP = {s : RCase => Str ; a : RAgr} ;
|
||||||
@@ -44,11 +44,11 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
VP = ResEng.VP ;
|
VP = ResEng.VP ;
|
||||||
VPSlash = ResEng.SlashVP ;
|
VPSlash = ResEng.SlashVP ;
|
||||||
Comp = {s : Agr => Str} ;
|
Comp = {s : Agr => Str} ;
|
||||||
|
|
||||||
-- Adjective
|
-- Adjective
|
||||||
|
|
||||||
AP = {s : Agr => Str ; isPre : Bool} ;
|
AP = {s : Agr => Str ; isPre : Bool} ;
|
||||||
|
|
||||||
-- Noun
|
-- Noun
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ concrete CompatibilityEng of Compatibility = CatEng ** open Prelude, ResEng in {
|
|||||||
-- from Noun 19/4/2008
|
-- from Noun 19/4/2008
|
||||||
|
|
||||||
lin
|
lin
|
||||||
NumInt n = {s,sp = \\_ => addGenitiveS n.s ; n = Pl ; hasCard = True} ;
|
NumInt n = {s,sp = \\_ => addGenitiveS n.s ; n = Pl ; hasCard = True} ;
|
||||||
OrdInt n = {s = \\c => n.s ++ (regGenitiveS "th")!c } ;
|
OrdInt n = {s = \\c => n.s ++ (regGenitiveS "th")!c } ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
-- Note: this results in a space before 's, but there's
|
-- Note: this results in a space before 's, but there's
|
||||||
-- not mauch we can do about that.
|
-- not mauch we can do about that.
|
||||||
addGenitiveS : Str -> Case => Str = \s ->
|
addGenitiveS : Str -> Case => Str = \s ->
|
||||||
table { Gen => s ++ "'s"; _ => s } ;
|
table { Gen => s ++ "'s"; _ => s } ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete ConjunctionEng of Conjunction =
|
concrete ConjunctionEng of Conjunction =
|
||||||
CatEng ** open ResEng, Coordination, Prelude in {
|
CatEng ** open ResEng, Coordination, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
@@ -22,11 +22,11 @@ concrete ConjunctionEng of Conjunction =
|
|||||||
c = ss.c
|
c = ss.c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ConjIAdv = conjunctDistrSS ;
|
ConjIAdv = conjunctDistrSS ;
|
||||||
|
|
||||||
ConjCN co ns = conjunctDistrTable2 Number Case co ns ** {g = Neutr} ; --- gender?
|
ConjCN co ns = conjunctDistrTable2 Number Case co ns ** {g = Neutr} ; --- gender?
|
||||||
|
|
||||||
ConjDet c xs = let cxs = (conjunctDistrSS c xs).s in {s = cxs ; sp = \\_,_,_ => cxs ++ "one" ; hasNum = False ; n = xs.n} ;
|
ConjDet c xs = let cxs = (conjunctDistrSS c xs).s in {s = cxs ; sp = \\_,_,_ => cxs ++ "one" ; hasNum = False ; n = xs.n} ;
|
||||||
|
|
||||||
-- These fun's are generated from the list cat's.
|
-- These fun's are generated from the list cat's.
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ lin
|
|||||||
|
|
||||||
InflectionV3 v = {
|
InflectionV3 v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
v.c2 ++ pp "arg1" ++
|
v.c2 ++ pp "arg1" ++
|
||||||
@@ -93,7 +93,7 @@ lin
|
|||||||
|
|
||||||
InflectionV2V v = {
|
InflectionV2V v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
v.c2 ++ pp "object" ++
|
v.c2 ++ pp "object" ++
|
||||||
@@ -107,7 +107,7 @@ lin
|
|||||||
|
|
||||||
InflectionV2S v = {
|
InflectionV2S v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
v.c2 ++ pp "object" ++
|
v.c2 ++ pp "object" ++
|
||||||
@@ -117,7 +117,7 @@ lin
|
|||||||
|
|
||||||
InflectionV2Q v = {
|
InflectionV2Q v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
pp "question") ;
|
pp "question") ;
|
||||||
@@ -126,7 +126,7 @@ lin
|
|||||||
|
|
||||||
InflectionV2A v = {
|
InflectionV2A v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
v.c2 ++ pp "object" ++
|
v.c2 ++ pp "object" ++
|
||||||
@@ -136,7 +136,7 @@ lin
|
|||||||
|
|
||||||
InflectionVV v = {
|
InflectionVV v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VVF VInf ++ v.p ++
|
v.s ! VVF VInf ++ v.p ++
|
||||||
case v.typ of {
|
case v.typ of {
|
||||||
@@ -155,7 +155,7 @@ lin
|
|||||||
|
|
||||||
InflectionVS v = {
|
InflectionVS v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
"that" ++ pp "sentence") ;
|
"that" ++ pp "sentence") ;
|
||||||
@@ -164,7 +164,7 @@ lin
|
|||||||
|
|
||||||
InflectionVQ v = {
|
InflectionVQ v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
pp "question") ;
|
pp "question") ;
|
||||||
@@ -173,7 +173,7 @@ lin
|
|||||||
|
|
||||||
InflectionVA v = {
|
InflectionVA v = {
|
||||||
t = "v" ;
|
t = "v" ;
|
||||||
s1= heading1 "Verb" ++
|
s1= heading1 "Verb" ++
|
||||||
paragraph (pp "subject" ++
|
paragraph (pp "subject" ++
|
||||||
v.s ! VInf ++ v.p ++
|
v.s ! VInf ++ v.p ++
|
||||||
pp "adjective") ;
|
pp "adjective") ;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
-- documentation of English in any language instantiating Terminology
|
-- documentation of English in any language instantiating Terminology
|
||||||
|
|
||||||
incomplete concrete DocumentationEngFunctor of Documentation = CatEng ** open
|
incomplete concrete DocumentationEngFunctor of Documentation = CatEng ** open
|
||||||
Terminology,
|
Terminology,
|
||||||
ResEng,
|
ResEng,
|
||||||
ParadigmsEng,
|
ParadigmsEng,
|
||||||
@@ -16,18 +16,18 @@ in {
|
|||||||
|
|
||||||
lincat
|
lincat
|
||||||
Inflection = {s1,s2 : Str} ;
|
Inflection = {s1,s2 : Str} ;
|
||||||
Document = {s : Str} ;
|
Document = {s : Str} ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
tdf : Str -> Str = \s -> td (intag "i" s) ;
|
tdf : Str -> Str = \s -> td (intag "i" s) ;
|
||||||
heading : N -> Str = \n -> (nounHeading n).s ;
|
heading : N -> Str = \n -> (nounHeading n).s ;
|
||||||
lin
|
lin
|
||||||
InflectionN noun = {
|
InflectionN noun = {
|
||||||
s1 = heading1 (heading noun_Category) ;
|
s1 = heading1 (heading noun_Category) ;
|
||||||
s2 = frameTable (
|
s2 = frameTable (
|
||||||
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
|
||||||
tr (th (heading nominative_Parameter) ++ tdf (noun.s ! Sg ! Nom) ++ tdf (noun.s ! Pl ! Nom)) ++
|
tr (th (heading nominative_Parameter) ++ tdf (noun.s ! Sg ! Nom) ++ tdf (noun.s ! Pl ! Nom)) ++
|
||||||
tr (th (heading genitive_Parameter) ++ tdf (noun.s ! Sg ! Gen) ++ tdf (noun.s ! Pl ! Gen))
|
tr (th (heading genitive_Parameter) ++ tdf (noun.s ! Sg ! Gen) ++ tdf (noun.s ! Pl ! Gen))
|
||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -38,23 +38,24 @@ lin
|
|||||||
tr (th (heading comparative_Parameter) ++ tdf (adj.s ! AAdj Compar Nom)) ++
|
tr (th (heading comparative_Parameter) ++ tdf (adj.s ! AAdj Compar Nom)) ++
|
||||||
tr (th (heading superlative_Parameter) ++ tdf (adj.s ! AAdj Superl Nom)) ++
|
tr (th (heading superlative_Parameter) ++ tdf (adj.s ! AAdj Superl Nom)) ++
|
||||||
tr (th (heading adverb_Category) ++ tdf (adj.s ! AAdv))
|
tr (th (heading adverb_Category) ++ tdf (adj.s ! AAdv))
|
||||||
|
tr (th (heading adverb_Category) ++ tdf (adj.s ! AAdv))
|
||||||
)
|
)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV v = {
|
InflectionV v = {
|
||||||
s1= heading1 (heading verb_Category) ++
|
s1= heading1 (heading verb_Category) ++
|
||||||
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (verbExample (S.mkCl S.she_NP (lin V v)))) ;
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (verbExample (S.mkCl S.she_NP (lin V v)))) ;
|
||||||
s2= inflVerb v
|
s2= inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2 v = {
|
InflectionV2 v = {
|
||||||
s1= heading1 (heading verb_Category) ++
|
s1= heading1 (heading verb_Category) ++
|
||||||
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (verbExample (S.mkCl S.she_NP (lin V2 v) S.something_NP))) ;
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (verbExample (S.mkCl S.she_NP (lin V2 v) S.something_NP))) ;
|
||||||
s2= inflVerb v
|
s2= inflVerb v
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
InflectionV2V v = {
|
InflectionV2V v = {
|
||||||
s1= heading1 (heading verb_Category) ++
|
s1= heading1 (heading verb_Category) ++
|
||||||
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V))))) ;
|
paragraph (intag "b" (heading exampleGr_N ++ ":") ++ intag "i" (verbExample (S.mkCl S.she_NP (lin V2V v) S.we_NP (S.mkVP (L.sleep_V))))) ;
|
||||||
s2= inflVerb v
|
s2= inflVerb v
|
||||||
} ;
|
} ;
|
||||||
@@ -63,7 +64,7 @@ lin
|
|||||||
|
|
||||||
MkDocument b i e = ss (i.s1 ++ "<p style=\"font-size:20px\">"++b.s++"</p>" ++ i.s2 ++ paragraph e.s) ;
|
MkDocument b i e = ss (i.s1 ++ "<p style=\"font-size:20px\">"++b.s++"</p>" ++ i.s2 ++ paragraph e.s) ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
verbExample : CatEng.Cl -> Str = \cl -> (S.mkUtt cl).s ;
|
verbExample : CatEng.Cl -> Str = \cl -> (S.mkUtt cl).s ;
|
||||||
|
|
||||||
inflVerb : Verb -> Str = \verb ->
|
inflVerb : Verb -> Str = \verb ->
|
||||||
@@ -72,7 +73,7 @@ oper
|
|||||||
tr (th (heading present_Parameter) ++ tdf (verb.s ! VPres)) ++
|
tr (th (heading present_Parameter) ++ tdf (verb.s ! VPres)) ++
|
||||||
tr (th (heading past_Parameter) ++ tdf (verb.s ! VPast)) ++ --# notpresent
|
tr (th (heading past_Parameter) ++ tdf (verb.s ! VPast)) ++ --# notpresent
|
||||||
tr (th (heading past_Parameter ++ heading participle_Parameter) ++ tdf (verb.s ! VPPart)) ++
|
tr (th (heading past_Parameter ++ heading participle_Parameter) ++ tdf (verb.s ! VPPart)) ++
|
||||||
tr (th (heading present_Parameter ++ heading participle_Parameter) ++ tdf (verb.s ! VPresPart))
|
tr (th (heading present_Parameter ++ heading participle_Parameter) ++ tdf (verb.s ! VPresPart))
|
||||||
) ;
|
) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ lin BaseImp = twoTable2 CPolarity ImpForm ;
|
|||||||
AdvRAP ap prep rnp = {s = \\a => ap.s ! a ++ prep.s ++ rnp.s ! a ; isPre = False} ;
|
AdvRAP ap prep rnp = {s = \\a => ap.s ! a ++ prep.s ++ rnp.s ! a ; isPre = False} ;
|
||||||
|
|
||||||
ReflA2RNP a rnp = {
|
ReflA2RNP a rnp = {
|
||||||
s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ rnp.s ! ag ;
|
s = \\ag => a.s ! AAdj Posit Nom ++ a.c2 ++ rnp.s ! ag ;
|
||||||
isPre = False
|
isPre = False
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
concrete ExtraEng of ExtraEngAbs = CatEng **
|
concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||||
open ResEng, Coordination, Prelude, MorphoEng, ParadigmsEng in {
|
open ResEng, Coordination, Prelude, MorphoEng, ParadigmsEng in {
|
||||||
|
|
||||||
lin
|
lin
|
||||||
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen; isDef = True} ;
|
GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen; isDef = True} ;
|
||||||
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
GenIP ip = {s = \\_ => ip.s ! NCase Gen} ;
|
||||||
GenRP nu cn = {
|
GenRP nu cn = {
|
||||||
s = \\c => "whose" ++ nu.s ! False ! Nom ++
|
s = \\c => "whose" ++ nu.s ! False ! Nom ++
|
||||||
case c of {
|
case c of {
|
||||||
RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
|
RC _ (NCase Gen) => cn.s ! nu.n ! Gen ;
|
||||||
_ => cn.s ! nu.n ! Nom
|
_ => cn.s ! nu.n ! Nom
|
||||||
@@ -14,12 +14,12 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
PiedPipingRelSlash rp slash = {
|
PiedPipingRelSlash rp slash = {
|
||||||
s = \\t,a,p,agr =>
|
s = \\t,a,p,agr =>
|
||||||
slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! oDir ;
|
slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! oDir ;
|
||||||
c = NPAcc
|
c = NPAcc
|
||||||
} ;
|
} ;
|
||||||
StrandRelSlash rp slash = {
|
StrandRelSlash rp slash = {
|
||||||
s = \\t,a,p,ag =>
|
s = \\t,a,p,ag =>
|
||||||
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
||||||
c = NPAcc
|
c = NPAcc
|
||||||
} ;
|
} ;
|
||||||
@@ -28,11 +28,11 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
c = NPAcc
|
c = NPAcc
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PiedPipingQuestSlash ip slash =
|
PiedPipingQuestSlash ip slash =
|
||||||
mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ;
|
mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ;
|
||||||
|
|
||||||
StrandQuestSlash ip slash =
|
StrandQuestSlash ip slash =
|
||||||
{s = \\t,a,b,q =>
|
{s = \\t,a,b,q =>
|
||||||
(mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
(mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
ConjVPI = conjunctDistrTable2 VVType Agr ;
|
ConjVPI = conjunctDistrTable2 VVType Agr ;
|
||||||
ComplVPIVV vv vpi =
|
ComplVPIVV vv vpi =
|
||||||
insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
|
insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
@@ -73,8 +73,8 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
PredVPS np vpi = {s = np.s ! npNom ++ vpi.s ! np.a} ;
|
PredVPS np vpi = {s = np.s ! npNom ++ vpi.s ! np.a} ;
|
||||||
|
|
||||||
MkVPS t p vp = {
|
MkVPS t p vp = {
|
||||||
s = \\a =>
|
s = \\a =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
|
verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ;
|
||||||
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
verbf = verb.aux ++ verb.adv ++ verb.fin ++ verb.inf ;
|
||||||
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
|
in t.s ++ p.s ++ vp.ad ! a ++ verbf ++ vp.p ++ vp.s2 ! a ++ vp.ext
|
||||||
@@ -110,7 +110,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
may_VV = lin VV {
|
may_VV = lin VV {
|
||||||
s = table {
|
s = table {
|
||||||
VVF VInf => ["be allowed to"] ;
|
VVF VInf => ["be allowed to"] ;
|
||||||
VVF VPres => "may" ;
|
VVF VPres => "may" ;
|
||||||
VVF VPPart => ["been allowed to"] ;
|
VVF VPPart => ["been allowed to"] ;
|
||||||
@@ -124,21 +124,21 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
shall_VV = lin VV {
|
shall_VV = lin VV {
|
||||||
s = table {
|
s = table {
|
||||||
VVF VInf => ["be obliged to"] ; ---
|
VVF VInf => ["be obliged to"] ; ---
|
||||||
VVF VPres => "shall" ;
|
VVF VPres => "shall" ;
|
||||||
VVF VPPart => ["been obliged to"] ;
|
VVF VPPart => ["been obliged to"] ;
|
||||||
VVF VPresPart => ["being obliged to"] ;
|
VVF VPresPart => ["being obliged to"] ;
|
||||||
VVF VPast => "should" ; --# notpresent
|
VVF VPast => "should" ; --# notpresent
|
||||||
VVPastNeg => "shouldn't" ; --# notpresent
|
VVPastNeg => "shouldn't" ; --# notpresent
|
||||||
VVPresNeg => "shan't"
|
VVPresNeg => "shan't"
|
||||||
} ;
|
} ;
|
||||||
p = [] ;
|
p = [] ;
|
||||||
typ = VVAux
|
typ = VVAux
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ought_VV = lin VV {
|
ought_VV = lin VV {
|
||||||
s = table {
|
s = table {
|
||||||
VVF VInf => ["be obliged to"] ; ---
|
VVF VInf => ["be obliged to"] ; ---
|
||||||
VVF VPres => "ought to" ;
|
VVF VPres => "ought to" ;
|
||||||
VVF VPPart => ["been obliged to"] ;
|
VVF VPPart => ["been obliged to"] ;
|
||||||
@@ -152,37 +152,37 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
used_VV = lin VV {
|
used_VV = lin VV {
|
||||||
s = table {
|
s = table {
|
||||||
VVF VInf => Predef.nonExist ; ---
|
VVF VInf => Predef.nonExist ; ---
|
||||||
VVF VPres => Predef.nonExist ;
|
VVF VPres => Predef.nonExist ;
|
||||||
VVF VPPart => ["used to"] ;
|
VVF VPPart => ["used to"] ;
|
||||||
VVF VPresPart => ["being used to"] ;
|
VVF VPresPart => ["being used to"] ;
|
||||||
VVF VPast => "used to" ; --# notpresent
|
VVF VPast => "used to" ; --# notpresent
|
||||||
VVPastNeg => "used not to" ; --# notpresent
|
VVPastNeg => "used not to" ; --# notpresent
|
||||||
VVPresNeg => Predef.nonExist
|
VVPresNeg => Predef.nonExist
|
||||||
} ;
|
} ;
|
||||||
p = [] ;
|
p = [] ;
|
||||||
typ = VVAux
|
typ = VVAux
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
NominalizeVPSlashNP vpslash np =
|
NominalizeVPSlashNP vpslash np =
|
||||||
let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ;
|
let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ;
|
||||||
a = AgP3Sg Neutr
|
a = AgP3Sg Neutr
|
||||||
in
|
in
|
||||||
lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ;
|
lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
UncNeg = {s = [] ; p = CNeg False} ;
|
UncNeg = {s = [] ; p = CNeg False} ;
|
||||||
|
|
||||||
oper passVPSlash : VPSlash -> Str -> ResEng.VP =
|
oper passVPSlash : VPSlash -> Str -> ResEng.VP =
|
||||||
\vps,ag ->
|
\vps,ag ->
|
||||||
let
|
let
|
||||||
be = predAux auxBe ;
|
be = predAux auxBe ;
|
||||||
ppt = vps.ptp
|
ppt = vps.ptp
|
||||||
in {
|
in {
|
||||||
s = be.s ;
|
s = be.s ;
|
||||||
p = [] ;
|
p = [] ;
|
||||||
prp = be.prp ;
|
prp = be.prp ;
|
||||||
ptp = be.ptp ;
|
ptp = be.ptp ;
|
||||||
inf = be.inf ;
|
inf = be.inf ;
|
||||||
@@ -192,7 +192,7 @@ lin
|
|||||||
ext = vps.ext
|
ext = vps.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
PassVPSlash vps = passVPSlash vps [] ;
|
PassVPSlash vps = passVPSlash vps [] ;
|
||||||
PassAgentVPSlash vps np = passVPSlash vps ("by" ++ np.s ! NPAcc) ;
|
PassAgentVPSlash vps np = passVPSlash vps ("by" ++ np.s ! NPAcc) ;
|
||||||
|
|
||||||
@@ -202,8 +202,8 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
--- AR 22/5/2013
|
--- AR 22/5/2013
|
||||||
ExistsNP np =
|
ExistsNP np =
|
||||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||||
(insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ;
|
(insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ;
|
||||||
|
|
||||||
PurposeVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ; --- agr
|
PurposeVP vp = {s = infVP VVInf vp False Simul CPos (agrP3 Sg)} ; --- agr
|
||||||
@@ -238,8 +238,8 @@ lin
|
|||||||
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ;
|
||||||
|
|
||||||
FrontExtPredVP np vp = {
|
FrontExtPredVP np vp = {
|
||||||
s = \\t,a,b,o =>
|
s = \\t,a,b,o =>
|
||||||
let
|
let
|
||||||
subj = np.s ! npNom ;
|
subj = np.s ! npNom ;
|
||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||||
@@ -252,8 +252,8 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
InvFrontExtPredVP np vp = {
|
InvFrontExtPredVP np vp = {
|
||||||
s = \\t,a,b,o =>
|
s = \\t,a,b,o =>
|
||||||
let
|
let
|
||||||
subj = np.s ! npNom ;
|
subj = np.s ! npNom ;
|
||||||
agr = np.a ;
|
agr = np.a ;
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||||
@@ -269,7 +269,7 @@ lin
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
unc : CPolarity -> CPolarity = \x -> case x of {
|
unc : CPolarity -> CPolarity = \x -> case x of {
|
||||||
CNeg _ => CNeg False ;
|
CNeg _ => CNeg False ;
|
||||||
_ => x
|
_ => x
|
||||||
} ;
|
} ;
|
||||||
-------
|
-------
|
||||||
@@ -285,7 +285,7 @@ lin
|
|||||||
RNP = {s : Agr => Str} ;
|
RNP = {s : Agr => Str} ;
|
||||||
RNPList = {s1,s2 : Agr => Str} ;
|
RNPList = {s1,s2 : Agr => Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
|
||||||
ReflPron = {s = reflPron} ;
|
ReflPron = {s = reflPron} ;
|
||||||
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
|
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! True ! Nom ++ cn.s ! num.n ! Nom} ;
|
||||||
@@ -299,7 +299,7 @@ lin
|
|||||||
Cons_rr_RNP x xs = consrTable Agr comma x xs ;
|
Cons_rr_RNP x xs = consrTable Agr comma x xs ;
|
||||||
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
|
Cons_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ;
|
||||||
|
|
||||||
|
|
||||||
---- TODO: RNPList construction
|
---- TODO: RNPList construction
|
||||||
|
|
||||||
|
|
||||||
@@ -307,7 +307,7 @@ lin
|
|||||||
|
|
||||||
that_RP =
|
that_RP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
||||||
RC Neutr _ => "that" ;
|
RC Neutr _ => "that" ;
|
||||||
RC _ NPAcc => "that" ;
|
RC _ NPAcc => "that" ;
|
||||||
RC _ (NCase Nom) => "that" ;
|
RC _ (NCase Nom) => "that" ;
|
||||||
@@ -319,7 +319,7 @@ lin
|
|||||||
|
|
||||||
which_who_RP =
|
which_who_RP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
||||||
RC Neutr _ => "which" ;
|
RC Neutr _ => "which" ;
|
||||||
RC _ NPAcc => "whom" ;
|
RC _ NPAcc => "whom" ;
|
||||||
RC _ (NCase Nom) => "who" ;
|
RC _ (NCase Nom) => "who" ;
|
||||||
@@ -328,18 +328,18 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
who_RP =
|
who_RP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
||||||
_ => "who"
|
_ => "who"
|
||||||
} ;
|
} ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
which_RP =
|
which_RP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
||||||
_ => "which"
|
_ => "which"
|
||||||
} ;
|
} ;
|
||||||
a = RNoAg
|
a = RNoAg
|
||||||
@@ -347,7 +347,7 @@ lin
|
|||||||
|
|
||||||
emptyRP =
|
emptyRP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
||||||
RC _ NPAcc => [] ;
|
RC _ NPAcc => [] ;
|
||||||
RC _ (NCase Nom) => "that" ;
|
RC _ (NCase Nom) => "that" ;
|
||||||
RPrep Neutr => "which" ;
|
RPrep Neutr => "which" ;
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
abstract ExtraEngAbs = Extra - [ProDrop] ** {
|
abstract ExtraEngAbs = Extra - [ProDrop] ** {
|
||||||
|
|
||||||
-- uncontracted negative polarity; contracted is the default for PNeg
|
-- uncontracted negative polarity; contracted is the default for PNeg
|
||||||
fun
|
fun
|
||||||
UncNeg : Pol ;
|
UncNeg : Pol ;
|
||||||
|
|
||||||
-- freely compounded nouns
|
-- freely compounded nouns
|
||||||
|
|
||||||
CompoundCN : CN -> CN -> CN ; -- rock album
|
CompoundCN : CN -> CN -> CN ; -- rock album
|
||||||
|
|
||||||
which_who_RP : RP ; -- "which" / "who" as a relative pronoun (used to be the default for IdRP)
|
which_who_RP : RP ; -- "which" / "who" as a relative pronoun (used to be the default for IdRP)
|
||||||
that_RP : RP ; -- "that" as a relational pronoun (since 5/6/2016 default for IdRP)
|
that_RP : RP ; -- "that" as a relational pronoun (since 5/6/2016 default for IdRP)
|
||||||
which_RP : RP ; -- force "which"
|
which_RP : RP ; -- force "which"
|
||||||
who_RP : RP ; -- force "who" ; in Acc, also "who": "the girl who I saw"
|
who_RP : RP ; -- force "who" ; in Acc, also "who": "the girl who I saw"
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--# -path=.:../abstract:../common:prelude
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
concrete GrammarEng of Grammar =
|
concrete GrammarEng of Grammar =
|
||||||
NounEng,
|
NounEng,
|
||||||
VerbEng,
|
VerbEng,
|
||||||
AdjectiveEng,
|
AdjectiveEng,
|
||||||
AdverbEng,
|
AdverbEng,
|
||||||
NumeralEng,
|
NumeralEng,
|
||||||
|
|||||||
@@ -6,28 +6,28 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
|||||||
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||||
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||||
|
|
||||||
CleftNP np rs = mkClause "it" (agrP3 Sg)
|
CleftNP np rs = mkClause "it" (agrP3 Sg)
|
||||||
(insertObj (\\_ => rs.s ! np.a)
|
(insertObj (\\_ => rs.s ! np.a)
|
||||||
(insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
(insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
||||||
|
|
||||||
CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
||||||
(insertObj (\\_ => conjThat ++ s.s)
|
(insertObj (\\_ => conjThat ++ s.s)
|
||||||
(insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
(insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
||||||
|
|
||||||
ExistNP np =
|
ExistNP np =
|
||||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||||
(insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
|
(insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ;
|
||||||
|
|
||||||
ExistIP ip =
|
ExistIP ip =
|
||||||
mkQuestion (ss (ip.s ! npNom))
|
mkQuestion (ss (ip.s ! npNom))
|
||||||
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
||||||
|
|
||||||
ExistNPAdv np adv =
|
ExistNPAdv np adv =
|
||||||
mkClause "there" (agrP3 (fromAgr np.a).n)
|
mkClause "there" (agrP3 (fromAgr np.a).n)
|
||||||
(insertObj (\\_ => np.s ! NPAcc ++ adv.s) (predAux auxBe)) ;
|
(insertObj (\\_ => np.s ! NPAcc ++ adv.s) (predAux auxBe)) ;
|
||||||
|
|
||||||
ExistIPAdv ip adv =
|
ExistIPAdv ip adv =
|
||||||
mkQuestion (ss (ip.s ! npNom))
|
mkQuestion (ss (ip.s ! npNom))
|
||||||
(mkClause "there" (agrP3 ip.n) (insertObj (\\_ => adv.s) (predAux auxBe))) ;
|
(mkClause "there" (agrP3 ip.n) (insertObj (\\_ => adv.s) (predAux auxBe))) ;
|
||||||
|
|
||||||
ProgrVP vp = insertObj (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) (predAux auxBe) ;
|
ProgrVP vp = insertObj (\\a => vp.ad ! a ++ vp.prp ++ vp.p ++ vp.s2 ! a) (predAux auxBe) ;
|
||||||
@@ -39,7 +39,7 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
|||||||
SelfAdvVP vp = insertObj reflPron vp ;
|
SelfAdvVP vp = insertObj reflPron vp ;
|
||||||
SelfAdVVP vp = insertAdVAgr reflPron vp ;
|
SelfAdVVP vp = insertAdVAgr reflPron vp ;
|
||||||
SelfNP np = {
|
SelfNP np = {
|
||||||
s = \\c => np.s ! c ++ reflPron ! np.a ;
|
s = \\c => np.s ! c ++ reflPron ! np.a ;
|
||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../abstract:../common:../api:../prelude
|
--# -path=.:../abstract:../common:../api:../prelude
|
||||||
|
|
||||||
concrete LangEng of Lang =
|
concrete LangEng of Lang =
|
||||||
GrammarEng,
|
GrammarEng,
|
||||||
LexiconEng
|
LexiconEng
|
||||||
,ConstructionEng
|
,ConstructionEng
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
resource MakeStructuralEng = open CatEng, ParadigmsEng, ResEng, MorphoEng, Prelude in {
|
resource MakeStructuralEng = open CatEng, ParadigmsEng, ResEng, MorphoEng, Prelude in {
|
||||||
|
|
||||||
oper
|
oper
|
||||||
mkSubj : Str -> Subj = \x ->
|
mkSubj : Str -> Subj = \x ->
|
||||||
lin Subj {s = x} ;
|
lin Subj {s = x} ;
|
||||||
mkNP : Str -> ParadigmsEng.Number -> NP = \s,n ->
|
mkNP : Str -> ParadigmsEng.Number -> NP = \s,n ->
|
||||||
lin NP (regNP s n) ;
|
lin NP (regNP s n) ;
|
||||||
@@ -11,7 +11,7 @@ oper
|
|||||||
lin IDet {s = s ; n = n} ;
|
lin IDet {s = s ; n = n} ;
|
||||||
mkIQuant : Str -> Str -> IQuant = \s,n ->
|
mkIQuant : Str -> Str -> IQuant = \s,n ->
|
||||||
lin IQuant {s = table {Sg => s ; Pl => n}} ;
|
lin IQuant {s = table {Sg => s ; Pl => n}} ;
|
||||||
|
|
||||||
mkDet = overload {
|
mkDet = overload {
|
||||||
mkDet : Str -> Det = \s ->
|
mkDet : Str -> Det = \s ->
|
||||||
lin Det (mkDeterminer singular s) ;
|
lin Det (mkDeterminer singular s) ;
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
|
|||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
mkDeterminer : Number -> Str ->
|
mkDeterminer : Number -> Str ->
|
||||||
{s : Str ; sp : Gender => Bool => NPCase => Str; n : Number ; hasNum : Bool} = \n,s -> mkDeterminerSpec n s s s False ; --- was True!?
|
{s : Str ; sp : Gender => Bool => NPCase => Str; n : Number ; hasNum : Bool} = \n,s -> mkDeterminerSpec n s s s False ; --- was True!?
|
||||||
|
|
||||||
mkDeterminerSpec : Number -> Str -> Str -> Str -> Bool ->
|
mkDeterminerSpec : Number -> Str -> Str -> Str -> Bool ->
|
||||||
@@ -30,7 +30,7 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
|
|||||||
--2 Pronouns
|
--2 Pronouns
|
||||||
|
|
||||||
|
|
||||||
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
|
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
|
||||||
{s : NPCase => Str ; sp : Case => Str ; a : Agr} =
|
{s : NPCase => Str ; sp : Case => Str ; a : Agr} =
|
||||||
\i,me,my,mine,n,p,g -> {
|
\i,me,my,mine,n,p,g -> {
|
||||||
s = table {
|
s = table {
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
|||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
DetCN det cn = {
|
DetCN det cn = {
|
||||||
s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ;
|
s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ;
|
||||||
a = agrgP3 det.n cn.g
|
a = agrgP3 det.n cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -48,8 +48,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuantOrd quant num ord = {
|
DetQuantOrd quant num ord = {
|
||||||
s = quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom ++ ord.s ! Nom;
|
s = quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom ++ ord.s ! Nom;
|
||||||
sp = \\g,_,c => quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom ++ ord.s ! npcase2case c ;
|
sp = \\g,_,c => quant.s ! num.hasCard ! num.n ++ num.s ! quant.isDef ! Nom ++ ord.s ! npcase2case c ;
|
||||||
n = num.n ;
|
n = num.n ;
|
||||||
hasNum = True
|
hasNum = True
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
concrete NumeralEng of Numeral = CatEng [Numeral,Digits] ** open Prelude, ResEng in {
|
concrete NumeralEng of Numeral = CatEng [Numeral,Digits] ** open Prelude, ResEng in {
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Digit = {s : DForm => CardOrd => Case => Str} ;
|
Digit = {s : DForm => CardOrd => Case => Str} ;
|
||||||
Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ;
|
Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ;
|
||||||
Sub100 = {s : CardOrd => Case => Str ; n : Number} ;
|
Sub100 = {s : CardOrd => Case => Str ; n : Number} ;
|
||||||
@@ -44,7 +44,7 @@ lin pot3plus n m = {
|
|||||||
|
|
||||||
-- numerals as sequences of digits
|
-- numerals as sequences of digits
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
Dig = TDigit ;
|
Dig = TDigit ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
|
|||||||
@@ -4,12 +4,12 @@
|
|||||||
--
|
--
|
||||||
-- Aarne Ranta 2003--2005
|
-- Aarne Ranta 2003--2005
|
||||||
--
|
--
|
||||||
-- This is an API for the user of the resource grammar
|
-- This is an API for the user of the resource grammar
|
||||||
-- for adding lexical items. It gives functions for forming
|
-- for adding lexical items. It gives functions for forming
|
||||||
-- expressions of open categories: nouns, adjectives, verbs.
|
-- expressions of open categories: nouns, adjectives, verbs.
|
||||||
--
|
--
|
||||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||||
-- accessed through the resource syntax API, $Structural.gf$.
|
-- accessed through the resource syntax API, $Structural.gf$.
|
||||||
--
|
--
|
||||||
-- The main difference with $MorphoEng.gf$ is that the types
|
-- The main difference with $MorphoEng.gf$ is that the types
|
||||||
-- referred to are compiled resource grammar types. We have moreover
|
-- referred to are compiled resource grammar types. We have moreover
|
||||||
@@ -21,22 +21,22 @@
|
|||||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||||
-- escape to construct the most irregular words of type $C$.
|
-- escape to construct the most irregular words of type $C$.
|
||||||
-- However, this function should only seldom be needed: we have a
|
-- However, this function should only seldom be needed: we have a
|
||||||
-- separate module [``IrregEng`` ../../english/IrregEng.gf],
|
-- separate module [``IrregEng`` ../../english/IrregEng.gf],
|
||||||
-- which covers irregular verbss.
|
-- which covers irregular verbss.
|
||||||
|
|
||||||
resource ParadigmsEng = open
|
resource ParadigmsEng = open
|
||||||
(Predef=Predef),
|
(Predef=Predef),
|
||||||
Prelude,
|
Prelude,
|
||||||
MorphoEng,
|
MorphoEng,
|
||||||
ResEng,
|
ResEng,
|
||||||
CatEng
|
CatEng
|
||||||
in {
|
in {
|
||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
-- To abstract over gender names, we define the following identifiers.
|
-- To abstract over gender names, we define the following identifiers.
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Gender : Type ;
|
Gender : Type ;
|
||||||
|
|
||||||
human : Gender ;
|
human : Gender ;
|
||||||
nonhuman : Gender ;
|
nonhuman : Gender ;
|
||||||
@@ -45,9 +45,9 @@ oper
|
|||||||
|
|
||||||
-- To abstract over number names, we define the following.
|
-- To abstract over number names, we define the following.
|
||||||
|
|
||||||
Number : Type ;
|
Number : Type ;
|
||||||
|
|
||||||
singular : Number ;
|
singular : Number ;
|
||||||
plural : Number ;
|
plural : Number ;
|
||||||
|
|
||||||
-- To abstract over case names, we define the following.
|
-- To abstract over case names, we define the following.
|
||||||
@@ -74,10 +74,10 @@ oper
|
|||||||
mkN : overload {
|
mkN : overload {
|
||||||
|
|
||||||
-- The regular function captures the variants for nouns ending with
|
-- The regular function captures the variants for nouns ending with
|
||||||
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
||||||
-- "fly - flies" (but "toy - toys"),
|
-- "fly - flies" (but "toy - toys"),
|
||||||
|
|
||||||
mkN : (flash : Str) -> N ; -- plural s, incl. flash-flashes, fly-flies
|
mkN : (flash : Str) -> N ; -- plural s, incl. flash-flashes, fly-flies
|
||||||
|
|
||||||
-- In practice the worst case is to give singular and plural nominative.
|
-- In practice the worst case is to give singular and plural nominative.
|
||||||
|
|
||||||
@@ -91,7 +91,7 @@ oper
|
|||||||
|
|
||||||
mkN : Gender -> N -> N ; -- default nonhuman
|
mkN : Gender -> N -> N ; -- default nonhuman
|
||||||
|
|
||||||
--3 Compound nouns
|
--3 Compound nouns
|
||||||
--
|
--
|
||||||
-- A compound noun is an uninflected string attached to an inflected noun,
|
-- A compound noun is an uninflected string attached to an inflected noun,
|
||||||
-- such as "baby boom", "chief executive officer".
|
-- such as "baby boom", "chief executive officer".
|
||||||
@@ -106,17 +106,17 @@ oper
|
|||||||
verbalN : V -> N ; -- e.g. sing -> singing
|
verbalN : V -> N ; -- e.g. sing -> singing
|
||||||
|
|
||||||
|
|
||||||
--3 Relational nouns
|
--3 Relational nouns
|
||||||
|
|
||||||
mkN2 : overload {
|
mkN2 : overload {
|
||||||
mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --%
|
mkN2 : Str -> N2 ; -- reg. noun, prep. "of" --%
|
||||||
mkN2 : N -> N2 ; -- e.g. wife of (default prep. to)
|
mkN2 : N -> N2 ; -- e.g. wife of (default prep. to)
|
||||||
mkN2 : N -> Str -> N2 ; -- access to --%
|
mkN2 : N -> Str -> N2 ; -- access to --%
|
||||||
mkN2 : N -> Prep -> N2 ; -- e.g. access to
|
mkN2 : N -> Prep -> N2 ; -- e.g. access to
|
||||||
mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --%
|
mkN2 : Str -> Str -> N2 ; -- access to (regular noun) --%
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Use the function $mkPrep$ or see the section on prepositions below to
|
-- Use the function $mkPrep$ or see the section on prepositions below to
|
||||||
-- form other prepositions.
|
-- form other prepositions.
|
||||||
--
|
--
|
||||||
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||||
@@ -168,8 +168,8 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Regular comparison is formed by "more - most" for words with two vowels separated
|
-- Regular comparison is formed by "more - most" for words with two vowels separated
|
||||||
-- and terminated by some other letters. To force this or the opposite,
|
-- and terminated by some other letters. To force this or the opposite,
|
||||||
-- the following can be used:
|
-- the following can be used:
|
||||||
|
|
||||||
compoundA : A -> A ; -- force comparison with more/most
|
compoundA : A -> A ; -- force comparison with more/most
|
||||||
simpleA : A -> A ; -- force comparison with -er,-est
|
simpleA : A -> A ; -- force comparison with -er,-est
|
||||||
@@ -179,7 +179,7 @@ oper
|
|||||||
--3 Two-place adjectives
|
--3 Two-place adjectives
|
||||||
|
|
||||||
mkA2 : overload {
|
mkA2 : overload {
|
||||||
mkA2 : A -> Prep -> A2 ; -- absent from
|
mkA2 : A -> Prep -> A2 ; -- absent from
|
||||||
mkA2 : A -> Str -> A2 ; -- absent from --%
|
mkA2 : A -> Str -> A2 ; -- absent from --%
|
||||||
mkA2 : Str -> Prep -> A2 ; -- absent from --%
|
mkA2 : Str -> Prep -> A2 ; -- absent from --%
|
||||||
mkA2 : Str -> Str -> A2 -- absent from --%
|
mkA2 : Str -> Str -> A2 -- absent from --%
|
||||||
@@ -235,7 +235,7 @@ oper
|
|||||||
|
|
||||||
-- The regular verb function recognizes the special cases where the last
|
-- The regular verb function recognizes the special cases where the last
|
||||||
-- character is "y" ("cry-cries" but "buy-buys") or a sibilant
|
-- character is "y" ("cry-cries" but "buy-buys") or a sibilant
|
||||||
-- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches",
|
-- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches",
|
||||||
-- "fix - fixes").
|
-- "fix - fixes").
|
||||||
|
|
||||||
mkV : (cry : Str) -> V ; -- regular, incl. cry-cries, kiss-kisses etc
|
mkV : (cry : Str) -> V ; -- regular, incl. cry-cries, kiss-kisses etc
|
||||||
@@ -247,13 +247,13 @@ oper
|
|||||||
mkV : (stop, stopped : Str) -> V ; -- reg. with consonant duplication
|
mkV : (stop, stopped : Str) -> V ; -- reg. with consonant duplication
|
||||||
|
|
||||||
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
||||||
-- In practice, it is enough to give three forms,
|
-- In practice, it is enough to give three forms,
|
||||||
-- e.g. "drink - drank - drunk".
|
-- e.g. "drink - drank - drunk".
|
||||||
|
|
||||||
mkV : (drink, drank, drunk : Str) -> V ; -- ordinary irregular
|
mkV : (drink, drank, drunk : Str) -> V ; -- ordinary irregular
|
||||||
|
|
||||||
-- Irregular verbs with duplicated consonant in the present participle.
|
-- Irregular verbs with duplicated consonant in the present participle.
|
||||||
|
|
||||||
mkV : (run, ran, run, running : Str) -> V ; -- irregular with duplication --%
|
mkV : (run, ran, run, running : Str) -> V ; -- irregular with duplication --%
|
||||||
|
|
||||||
-- Except for "be", the worst case needs five forms: the infinitive and
|
-- Except for "be", the worst case needs five forms: the infinitive and
|
||||||
@@ -360,10 +360,10 @@ mkInterj : Str -> Interj
|
|||||||
-- The definitions should not bother the user of the API. So they are
|
-- The definitions should not bother the user of the API. So they are
|
||||||
-- hidden from the document.
|
-- hidden from the document.
|
||||||
|
|
||||||
Gender = ResEng.Gender ;
|
Gender = ResEng.Gender ;
|
||||||
Number = ResEng.Number ;
|
Number = ResEng.Number ;
|
||||||
Case = ResEng.NPCase ;
|
Case = ResEng.NPCase ;
|
||||||
human = Masc ;
|
human = Masc ;
|
||||||
nonhuman = Neutr ;
|
nonhuman = Neutr ;
|
||||||
masculine = Masc ;
|
masculine = Masc ;
|
||||||
feminine = Fem ;
|
feminine = Fem ;
|
||||||
@@ -376,7 +376,7 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
Preposition : Type = Str ; -- obsolete
|
Preposition : Type = Str ; -- obsolete
|
||||||
|
|
||||||
regN = \ray ->
|
regN = \ray ->
|
||||||
let rays = add_s ray
|
let rays = add_s ray
|
||||||
in
|
in
|
||||||
mk2N ray rays ;
|
mk2N ray rays ;
|
||||||
@@ -392,12 +392,12 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
duplFinal : Str -> Str = \w -> case w of {
|
duplFinal : Str -> Str = \w -> case w of {
|
||||||
_ + ("a" | "e" | "o") + ("a" | "e" | "i" | "o" | "u") + ? => w ; -- waited, needed
|
_ + ("a" | "e" | "o") + ("a" | "e" | "i" | "o" | "u") + ? => w ; -- waited, needed
|
||||||
_ + ("a" | "e" | "i" | "o" | "u") +
|
_ + ("a" | "e" | "i" | "o" | "u") +
|
||||||
c@("b"|"d"|"g"|"m"|"n"|"p"|"r"|"t") => w + c ; -- omitted, manned
|
c@("b"|"d"|"g"|"m"|"n"|"p"|"r"|"t") => w + c ; -- omitted, manned
|
||||||
_ => w
|
_ => w
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mk2N = \man,men ->
|
mk2N = \man,men ->
|
||||||
let mens = case last men of {
|
let mens = case last men of {
|
||||||
"s" => men + "'" ;
|
"s" => men + "'" ;
|
||||||
_ => men + "'s"
|
_ => men + "'s"
|
||||||
@@ -405,7 +405,7 @@ mkInterj : Str -> Interj
|
|||||||
in
|
in
|
||||||
mk4N man men (man + "'s") mens ;
|
mk4N man men (man + "'s") mens ;
|
||||||
|
|
||||||
mk4N = \man,men,man's,men's ->
|
mk4N = \man,men,man's,men's ->
|
||||||
lin N (mkNoun man man's men men's ** {g = Neutr}) ;
|
lin N (mkNoun man man's men men's ** {g = Neutr}) ;
|
||||||
|
|
||||||
genderN g man = lin N {s = man.s ; g = g} ;
|
genderN g man = lin N {s = man.s ; g = g} ;
|
||||||
@@ -432,7 +432,7 @@ mkInterj : Str -> Interj
|
|||||||
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s);
|
mkN2 : N -> Str -> N2 = \n,s -> prepN2 n (mkPrep s);
|
||||||
mkN2 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s);
|
mkN2 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s);
|
||||||
mkN2 : N -> N2 = \n -> prepN2 n (mkPrep "of") ;
|
mkN2 : N -> N2 = \n -> prepN2 n (mkPrep "of") ;
|
||||||
mkN2 : Str -> N2 = \s -> prepN2 (regN s) (mkPrep "of")
|
mkN2 : Str -> N2 = \s -> prepN2 (regN s) (mkPrep "of")
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
prepN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ;
|
prepN2 = \n,p -> lin N2 (n ** {c2 = p.s}) ;
|
||||||
@@ -461,11 +461,11 @@ mkInterj : Str -> Interj
|
|||||||
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = \sg,pl,sg',pl' -> mkQuantifier sg pl sg' pl' sg' pl';
|
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = \sg,pl,sg',pl' -> mkQuantifier sg pl sg' pl' sg' pl';
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkQuantifier : Str -> Str -> Str -> Str -> Str -> Str -> Quant =
|
mkQuantifier : Str -> Str -> Str -> Str -> Str -> Str -> Quant =
|
||||||
\sg,pl,sg1',pl1',sg2',pl2' -> lin Quant {
|
\sg,pl,sg1',pl1',sg2',pl2' -> lin Quant {
|
||||||
s = \\_ => table { Sg => sg ; Pl => pl } ;
|
s = \\_ => table { Sg => sg ; Pl => pl } ;
|
||||||
sp = \\g,_ => table {
|
sp = \\g,_ => table {
|
||||||
Sg => \\c => regGenitiveS (case g of {Masc=>sg1'; Fem=>sg1'; Neutr=>sg2'}) ! npcase2case c ;
|
Sg => \\c => regGenitiveS (case g of {Masc=>sg1'; Fem=>sg1'; Neutr=>sg2'}) ! npcase2case c ;
|
||||||
Pl => \\c => regGenitiveS (case g of {Masc=>pl1'; Fem=>pl1'; Neutr=>pl2'}) ! npcase2case c} ;
|
Pl => \\c => regGenitiveS (case g of {Masc=>pl1'; Fem=>pl1'; Neutr=>pl2'}) ! npcase2case c} ;
|
||||||
isDef = True
|
isDef = True
|
||||||
} ;
|
} ;
|
||||||
@@ -474,8 +474,8 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
mk2A a b = mkAdjective a a a b ;
|
mk2A a b = mkAdjective a a a b ;
|
||||||
regA a = case a of {
|
regA a = case a of {
|
||||||
_ + ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ +
|
_ + ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ +
|
||||||
("a" | "e" | "i" | "o" | "u" | "y") + ? + _ =>
|
("a" | "e" | "i" | "o" | "u" | "y") + ? + _ =>
|
||||||
lin A (compoundADeg (regADeg a)) ;
|
lin A (compoundADeg (regADeg a)) ;
|
||||||
_ => lin A (regADeg a)
|
_ => lin A (regADeg a)
|
||||||
} ;
|
} ;
|
||||||
@@ -486,7 +486,7 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
mkADeg a b c d = mkAdjective a b c d ;
|
mkADeg a b c d = mkAdjective a b c d ;
|
||||||
|
|
||||||
regADeg happy =
|
regADeg happy =
|
||||||
let
|
let
|
||||||
happ = init happy ;
|
happ = init happy ;
|
||||||
y = last happy ;
|
y = last happy ;
|
||||||
@@ -496,7 +496,7 @@ mkInterj : Str -> Interj
|
|||||||
_ => duplFinal happy + "e"
|
_ => duplFinal happy + "e"
|
||||||
} ;
|
} ;
|
||||||
in mkADeg happy (happie + "r") (happie + "st") (adj2adv happy) ;
|
in mkADeg happy (happie + "r") (happie + "st") (adj2adv happy) ;
|
||||||
|
|
||||||
adj2adv : Str -> Str = \happy ->
|
adj2adv : Str -> Str = \happy ->
|
||||||
case happy of {
|
case happy of {
|
||||||
_ + "ble" => init happy + "y" ;
|
_ + "ble" => init happy + "y" ;
|
||||||
@@ -505,8 +505,8 @@ mkInterj : Str -> Interj
|
|||||||
_ => happy + "ly"
|
_ => happy + "ly"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
duplADeg fat =
|
duplADeg fat =
|
||||||
mkADeg fat
|
mkADeg fat
|
||||||
(fat + last fat + "er") (fat + last fat + "est") (adj2adv fat) ;
|
(fat + last fat + "er") (fat + last fat + "est") (adj2adv fat) ;
|
||||||
|
|
||||||
compoundADeg a =
|
compoundADeg a =
|
||||||
@@ -528,7 +528,7 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
|
mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ;
|
||||||
|
|
||||||
regV cry =
|
regV cry =
|
||||||
let
|
let
|
||||||
cries = (regN cry).s ! Pl ! Nom ; -- !
|
cries = (regN cry).s ! Pl ! Nom ; -- !
|
||||||
cried : Str = case cries of {
|
cried : Str = case cries of {
|
||||||
@@ -539,7 +539,7 @@ mkInterj : Str -> Interj
|
|||||||
crying : Str = case cry of {
|
crying : Str = case cry of {
|
||||||
_ + "ee" => cry + "ing" ;
|
_ + "ee" => cry + "ing" ;
|
||||||
d + "ie" => d + "ying" ;
|
d + "ie" => d + "ying" ;
|
||||||
us + "e" => us + "ing" ;
|
us + "e" => us + "ing" ;
|
||||||
ent + "er" => ent + "ering" ;
|
ent + "er" => ent + "ering" ;
|
||||||
_ => duplFinal cry + "ing"
|
_ => duplFinal cry + "ing"
|
||||||
}
|
}
|
||||||
@@ -547,14 +547,14 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
reg2V fit fitted =
|
reg2V fit fitted =
|
||||||
let fitt = Predef.tk 2 fitted ;
|
let fitt = Predef.tk 2 fitted ;
|
||||||
in
|
in
|
||||||
if_then_else V (pbool2bool (Predef.eqStr (last fit) (last fitt)))
|
if_then_else V (pbool2bool (Predef.eqStr (last fit) (last fitt)))
|
||||||
(mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing"))
|
(mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing"))
|
||||||
(regV fit) ;
|
(regV fit) ;
|
||||||
|
|
||||||
regDuplV fit =
|
regDuplV fit =
|
||||||
case last fit of {
|
case last fit of {
|
||||||
("a" | "e" | "i" | "o" | "u" | "y") =>
|
("a" | "e" | "i" | "o" | "u" | "y") =>
|
||||||
Predef.error (["final duplication makes no sense for"] ++ fit) ;
|
Predef.error (["final duplication makes no sense for"] ++ fit) ;
|
||||||
t =>
|
t =>
|
||||||
let fitt = fit + t in
|
let fitt = fit + t in
|
||||||
@@ -567,8 +567,8 @@ mkInterj : Str -> Interj
|
|||||||
irreg4V x y z w = let reg = (regV x).s in
|
irreg4V x y z w = let reg = (regV x).s in
|
||||||
mk5V x (reg ! VPres) y z w ** {s1 = []} ;
|
mk5V x (reg ! VPres) y z w ** {s1 = []} ;
|
||||||
|
|
||||||
irregDuplV fit y z =
|
irregDuplV fit y z =
|
||||||
let
|
let
|
||||||
fitting = (regDuplV fit).s ! VPresPart
|
fitting = (regDuplV fit).s ! VPresPart
|
||||||
in
|
in
|
||||||
mk5V fit (fit + "s") y z fitting ;
|
mk5V fit (fit + "s") y z fitting ;
|
||||||
@@ -585,7 +585,7 @@ mkInterj : Str -> Interj
|
|||||||
prepV2 v p = lin V2 {s = v.s ; p = v.p ; c2 = p.s ; isRefl = v.isRefl} ;
|
prepV2 v p = lin V2 {s = v.s ; p = v.p ; c2 = p.s ; isRefl = v.isRefl} ;
|
||||||
dirV2 v = prepV2 v noPrep ;
|
dirV2 v = prepV2 v noPrep ;
|
||||||
|
|
||||||
prepPrepV3 v p q =
|
prepPrepV3 v p q =
|
||||||
lin V3 {s = v.s ; p = v.p ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ;
|
lin V3 {s = v.s ; p = v.p ; c2 = p.s ; c3 = q.s ; isRefl = v.isRefl} ;
|
||||||
dirV3 v p = prepPrepV3 v noPrep p ;
|
dirV3 v p = prepPrepV3 v noPrep p ;
|
||||||
dirdirV3 v = dirV3 v noPrep ;
|
dirdirV3 v = dirV3 v noPrep ;
|
||||||
@@ -593,22 +593,22 @@ mkInterj : Str -> Interj
|
|||||||
mkVS v = lin VS v ;
|
mkVS v = lin VS v ;
|
||||||
mkVV v = lin VV {
|
mkVV v = lin VV {
|
||||||
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
||||||
p = v.p ;
|
p = v.p ;
|
||||||
typ = VVInf
|
typ = VVInf
|
||||||
} ;
|
} ;
|
||||||
auxVV, infVV = \v -> lin VV {
|
auxVV, infVV = \v -> lin VV {
|
||||||
s = table {
|
s = table {
|
||||||
VVF vf => v.s ! vf ;
|
VVF vf => v.s ! vf ;
|
||||||
VVPresNeg => v.s ! VPres ++ "not" ;
|
VVPresNeg => v.s ! VPres ++ "not" ;
|
||||||
VVPastNeg => v.s ! VPast ++ "not" ; --# notpresent
|
VVPastNeg => v.s ! VPast ++ "not" ; --# notpresent
|
||||||
_ => v.s ! VInf
|
_ => v.s ! VInf
|
||||||
} ;
|
} ;
|
||||||
p = v.p ;
|
p = v.p ;
|
||||||
typ = VVAux
|
typ = VVAux
|
||||||
} ;
|
} ;
|
||||||
ingVV v = lin VV {
|
ingVV v = lin VV {
|
||||||
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ;
|
||||||
p = v.p ;
|
p = v.p ;
|
||||||
typ = VVPresPart
|
typ = VVPresPart
|
||||||
} ;
|
} ;
|
||||||
mkVQ v = lin VQ v ;
|
mkVQ v = lin VQ v ;
|
||||||
@@ -657,7 +657,7 @@ mkInterj : Str -> Interj
|
|||||||
mkN : Str -> N -> N = compoundN
|
mkN : Str -> N -> N = compoundN
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Relational nouns ("daughter of x") need a preposition.
|
-- Relational nouns ("daughter of x") need a preposition.
|
||||||
|
|
||||||
prepN2 : N -> Prep -> N2 ;
|
prepN2 : N -> Prep -> N2 ;
|
||||||
|
|
||||||
@@ -671,7 +671,7 @@ mkInterj : Str -> Interj
|
|||||||
|
|
||||||
mkA = overload {
|
mkA = overload {
|
||||||
mkA : Str -> A = regA ;
|
mkA : Str -> A = regA ;
|
||||||
mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
mkA : (fat,fatter : Str) -> A = \fat,fatter ->
|
||||||
mkAdjective fat fatter (init fatter + "st") (adj2adv fat) ;
|
mkAdjective fat fatter (init fatter + "st") (adj2adv fat) ;
|
||||||
mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
mkA : (good,better,best,well : Str) -> A = \a,b,c,d ->
|
||||||
mkAdjective a b c d
|
mkAdjective a b c d
|
||||||
@@ -680,10 +680,10 @@ mkInterj : Str -> Interj
|
|||||||
invarA s = mkAdjective s s s s ;
|
invarA s = mkAdjective s s s s ;
|
||||||
|
|
||||||
compoundA = compoundADeg ;
|
compoundA = compoundADeg ;
|
||||||
simpleA a =
|
simpleA a =
|
||||||
let ad = (a.s ! AAdj Posit Nom)
|
let ad = (a.s ! AAdj Posit Nom)
|
||||||
in regADeg ad ;
|
in regADeg ad ;
|
||||||
|
|
||||||
irregAdv a adv = lin A {s = table {AAdv => adv; aform => a.s ! aform}; isPre = a.isPre} ;
|
irregAdv a adv = lin A {s = table {AAdv => adv; aform => a.s ! aform}; isPre = a.isPre} ;
|
||||||
|
|
||||||
prepA2 : A -> Prep -> A2 ;
|
prepA2 : A -> Prep -> A2 ;
|
||||||
@@ -726,7 +726,7 @@ mkInterj : Str -> Interj
|
|||||||
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ;
|
mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ;
|
||||||
mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ;
|
mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ;
|
||||||
mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p)
|
mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p)
|
||||||
};
|
};
|
||||||
|
|
||||||
prepPrepV3 : V -> Prep -> Prep -> V3 ;
|
prepPrepV3 : V -> Prep -> Prep -> V3 ;
|
||||||
dirV3 : V -> Prep -> V3 ;
|
dirV3 : V -> Prep -> V3 ;
|
||||||
@@ -748,18 +748,18 @@ mkInterj : Str -> Interj
|
|||||||
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
mkConj : Str -> Str -> Number -> Conj = mk2Conj ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
mk2Conj : Str -> Str -> Number -> Conj = \x,y,n ->
|
||||||
lin Conj (sd2 x y ** {n = n}) ;
|
lin Conj (sd2 x y ** {n = n}) ;
|
||||||
|
|
||||||
---- obsolete
|
---- obsolete
|
||||||
|
|
||||||
-- Comparison adjectives may two more forms.
|
-- Comparison adjectives may two more forms.
|
||||||
|
|
||||||
ADeg : Type ;
|
ADeg : Type ;
|
||||||
|
|
||||||
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||||
|
|
||||||
-- The regular pattern recognizes two common variations:
|
-- The regular pattern recognizes two common variations:
|
||||||
-- "-e" ("rude" - "ruder" - "rudest") and
|
-- "-e" ("rude" - "ruder" - "rudest") and
|
||||||
-- "-y" ("happy - happier - happiest - happily")
|
-- "-y" ("happy - happier - happiest - happily")
|
||||||
|
|
||||||
@@ -780,7 +780,7 @@ mkInterj : Str -> Interj
|
|||||||
adegA : ADeg -> A ;
|
adegA : ADeg -> A ;
|
||||||
|
|
||||||
|
|
||||||
regPN : Str -> PN ;
|
regPN : Str -> PN ;
|
||||||
regGenPN : Str -> Gender -> PN ; -- John, John's
|
regGenPN : Str -> Gender -> PN ; -- John, John's
|
||||||
|
|
||||||
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
QuestCl cl = {
|
QuestCl cl = {
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let cls = cl.s ! t ! a ! p
|
let cls = cl.s ! t ! a ! p
|
||||||
in table {
|
in table {
|
||||||
QDir => cls ! OQuest ;
|
QDir => cls ! OQuest ;
|
||||||
QIndir => "if" ++ cls ! oDir ----
|
QIndir => "if" ++ cls ! oDir ----
|
||||||
@@ -17,15 +17,15 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
|||||||
let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
|
let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
|
||||||
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
|
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
|
||||||
|
|
||||||
QuestSlash ip slash =
|
QuestSlash ip slash =
|
||||||
{s = \\t,a,b,q =>
|
{s = \\t,a,b,q =>
|
||||||
(mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
(mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||||
} ;
|
} ;
|
||||||
--- changed AR 5/6/2016: uses stranding; pied-piping in ExtraEng
|
--- changed AR 5/6/2016: uses stranding; pied-piping in ExtraEng
|
||||||
|
|
||||||
QuestIAdv iadv cl = mkQuestion iadv cl ;
|
QuestIAdv iadv cl = mkQuestion iadv cl ;
|
||||||
|
|
||||||
QuestIComp icomp np =
|
QuestIComp icomp np =
|
||||||
mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ;
|
mkQuestion icomp (mkClause (np.s ! npNom) np.a (predAux auxBe)) ;
|
||||||
|
|
||||||
|
|
||||||
@@ -35,19 +35,19 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
|||||||
s = \\c => ip.s ! c ++ adv.s ;
|
s = \\c => ip.s ! c ++ adv.s ;
|
||||||
n = ip.n
|
n = ip.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdetCN idet cn = {
|
IdetCN idet cn = {
|
||||||
s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ;
|
s = \\c => idet.s ++ cn.s ! idet.n ! npcase2case c ;
|
||||||
n = idet.n
|
n = idet.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdetIP idet = {
|
IdetIP idet = {
|
||||||
s = \\c => idet.s ;
|
s = \\c => idet.s ;
|
||||||
n = idet.n
|
n = idet.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IdetQuant idet num = {
|
IdetQuant idet num = {
|
||||||
s = idet.s ! num.n ++ num.s ! False ! Nom ;
|
s = idet.s ! num.n ++ num.s ! False ! Nom ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -56,14 +56,14 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
|||||||
CompIAdv a = a ;
|
CompIAdv a = a ;
|
||||||
CompIP p = ss (p.s ! npNom) ;
|
CompIP p = ss (p.s ! npNom) ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
QVP = ResEng.VP ;
|
QVP = ResEng.VP ;
|
||||||
lin
|
lin
|
||||||
ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ;
|
ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ;
|
||||||
AdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
|
AdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||||
AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
|
AddAdvQVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||||
|
|
||||||
QuestQVP qp vp =
|
QuestQVP qp vp =
|
||||||
let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
|
let cl = mkClause (qp.s ! npNom) (agrP3 qp.n) vp
|
||||||
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
|
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ----
|
||||||
|
|
||||||
|
|||||||
@@ -5,13 +5,13 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
|||||||
lin
|
lin
|
||||||
|
|
||||||
RelCl cl = {
|
RelCl cl = {
|
||||||
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! oDir ;
|
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! oDir ;
|
||||||
c = npNom
|
c = npNom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
RelVP rp vp = {
|
RelVP rp vp = {
|
||||||
s = \\t,ant,b,ag =>
|
s = \\t,ant,b,ag =>
|
||||||
let
|
let
|
||||||
agr = case rp.a of {
|
agr = case rp.a of {
|
||||||
RNoAg => ag ;
|
RNoAg => ag ;
|
||||||
RAg a => a
|
RAg a => a
|
||||||
@@ -23,11 +23,11 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Pied piping: "that we are looking at". Pied piping and empty
|
-- Pied piping: "that we are looking at". Pied piping and empty
|
||||||
-- relative are defined in $ExtraEng.gf$ ("at which we are looking",
|
-- relative are defined in $ExtraEng.gf$ ("at which we are looking",
|
||||||
-- "we are looking at").
|
-- "we are looking at").
|
||||||
|
|
||||||
RelSlash rp slash = {
|
RelSlash rp slash = {
|
||||||
s = \\t,a,p,ag =>
|
s = \\t,a,p,ag =>
|
||||||
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
rp.s ! RC (fromAgr ag).g NPAcc ++ slash.s ! t ! a ! p ! oDir ++ slash.c2 ;
|
||||||
c = NPAcc
|
c = NPAcc
|
||||||
} ;
|
} ;
|
||||||
@@ -42,7 +42,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
|||||||
|
|
||||||
IdRP =
|
IdRP =
|
||||||
{ s = table {
|
{ s = table {
|
||||||
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ;
|
||||||
RC Neutr _ => "that" ;
|
RC Neutr _ => "that" ;
|
||||||
RC _ NPAcc => "that" ;
|
RC _ NPAcc => "that" ;
|
||||||
RC _ (NCase Nom) => "that" ;
|
RC _ (NCase Nom) => "that" ;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
param
|
param
|
||||||
Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl Gender ;
|
Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl Gender ;
|
||||||
|
|
||||||
param
|
param
|
||||||
Gender = Neutr | Masc | Fem ;
|
Gender = Neutr | Masc | Fem ;
|
||||||
|
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
-- Only these five forms are needed for open-lexicon verbs.
|
-- Only these five forms are needed for open-lexicon verbs.
|
||||||
|
|
||||||
param
|
param
|
||||||
VForm =
|
VForm =
|
||||||
VInf
|
VInf
|
||||||
| VPres
|
| VPres
|
||||||
| VPPart
|
| VPPart
|
||||||
@@ -58,13 +58,13 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
|
|
||||||
-- Auxiliary verbs have special negative forms.
|
-- Auxiliary verbs have special negative forms.
|
||||||
|
|
||||||
VVForm =
|
VVForm =
|
||||||
VVF VForm
|
VVF VForm
|
||||||
| VVPresNeg
|
| VVPresNeg
|
||||||
| VVPastNeg --# notpresent
|
| VVPastNeg --# notpresent
|
||||||
;
|
;
|
||||||
|
|
||||||
-- The order of sentence is needed already in $VP$ because the need of "do" depends on it.
|
-- The order of sentence is needed already in $VP$ because the need of "do" depends on it.
|
||||||
-- $ODir True$ means contracted forms ("'s", "'d", "'ve". "'re").
|
-- $ODir True$ means contracted forms ("'s", "'d", "'ve". "'re").
|
||||||
-- Notice that inverted forms ($OQuest$) don't allow verb contractions: *"'s he arrived".
|
-- Notice that inverted forms ($OQuest$) don't allow verb contractions: *"'s he arrived".
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ param
|
|||||||
AForm = AAdj Degree Case | AAdv ;
|
AForm = AAdj Degree Case | AAdv ;
|
||||||
|
|
||||||
--2 For $Relative$
|
--2 For $Relative$
|
||||||
|
|
||||||
RAgr = RNoAg | RAg Agr ;
|
RAgr = RNoAg | RAg Agr ;
|
||||||
RCase = RPrep Gender | RC Gender NPCase ;
|
RCase = RPrep Gender | RC Gender NPCase ;
|
||||||
|
|
||||||
@@ -95,7 +95,7 @@ param
|
|||||||
--2 Transformations between parameter types
|
--2 Transformations between parameter types
|
||||||
|
|
||||||
oper
|
oper
|
||||||
toAgr : Number -> Person -> Gender -> Agr = \n,p,g ->
|
toAgr : Number -> Person -> Gender -> Agr = \n,p,g ->
|
||||||
case p of {
|
case p of {
|
||||||
P1 => AgP1 n ;
|
P1 => AgP1 n ;
|
||||||
P2 => AgP2 n ;
|
P2 => AgP2 n ;
|
||||||
@@ -116,8 +116,8 @@ param
|
|||||||
|
|
||||||
agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ;
|
agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ;
|
||||||
|
|
||||||
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
conjAgr : Agr -> Agr -> Agr = \a0,b0 ->
|
||||||
let a = fromAgr a0 ; b = fromAgr b0
|
let a = fromAgr a0 ; b = fromAgr b0
|
||||||
in
|
in
|
||||||
toAgr
|
toAgr
|
||||||
(conjNumber a.n b.n)
|
(conjNumber a.n b.n)
|
||||||
@@ -127,7 +127,7 @@ param
|
|||||||
|
|
||||||
-- For each lexical category, here are the worst-case constructors.
|
-- For each lexical category, here are the worst-case constructors.
|
||||||
|
|
||||||
mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} =
|
mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} =
|
||||||
\man,mans,men,mens -> {
|
\man,mans,men,mens -> {
|
||||||
s = table {
|
s = table {
|
||||||
Sg => table {
|
Sg => table {
|
||||||
@@ -152,7 +152,7 @@ param
|
|||||||
isPre = True
|
isPre = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkVerb : (_,_,_,_,_ : Str) -> Verb =
|
mkVerb : (_,_,_,_,_ : Str) -> Verb =
|
||||||
\go,goes,went,gone,going -> {
|
\go,goes,went,gone,going -> {
|
||||||
s = table {
|
s = table {
|
||||||
VInf => go ;
|
VInf => go ;
|
||||||
@@ -167,12 +167,12 @@ param
|
|||||||
|
|
||||||
mkIP : (i,me,my : Str) -> Number -> {s : NPCase => Str ; n : Number} =
|
mkIP : (i,me,my : Str) -> Number -> {s : NPCase => Str ; n : Number} =
|
||||||
\i,me,my,n -> let who = mkNP i me my n P3 Neutr in {
|
\i,me,my,n -> let who = mkNP i me my n P3 Neutr in {
|
||||||
s = who.s ;
|
s = who.s ;
|
||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
|
mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
|
||||||
{s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g ->
|
{s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g ->
|
||||||
{ s = table {
|
{ s = table {
|
||||||
NCase Nom => i ;
|
NCase Nom => i ;
|
||||||
NPAcc => me ;
|
NPAcc => me ;
|
||||||
@@ -184,7 +184,7 @@ param
|
|||||||
regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n ->
|
regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n ->
|
||||||
mkNP that that (that + "'s") n P3 Neutr ;
|
mkNP that that (that + "'s") n P3 Neutr ;
|
||||||
|
|
||||||
regGenitiveS : Str -> Case => Str = \s ->
|
regGenitiveS : Str -> Case => Str = \s ->
|
||||||
table { Gen => genitiveS s; _ => s } ;
|
table { Gen => genitiveS s; _ => s } ;
|
||||||
|
|
||||||
genitiveS : Str -> Str = \dog ->
|
genitiveS : Str -> Str = \dog ->
|
||||||
@@ -199,7 +199,7 @@ param
|
|||||||
|
|
||||||
artIndef = pre {
|
artIndef = pre {
|
||||||
"eu" | "Eu" | "uni" | "up" => "a" ;
|
"eu" | "Eu" | "uni" | "up" => "a" ;
|
||||||
"un" => "an" ;
|
"un" => "an" ;
|
||||||
"a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ;
|
"a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ;
|
||||||
"SMS" | "sms" => "an" ; ---
|
"SMS" | "sms" => "an" ; ---
|
||||||
_ => "a"
|
_ => "a"
|
||||||
@@ -216,7 +216,7 @@ param
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
param
|
param
|
||||||
CPolarity =
|
CPolarity =
|
||||||
CPos
|
CPos
|
||||||
| CNeg Bool ; -- contracted or not
|
| CNeg Bool ; -- contracted or not
|
||||||
|
|
||||||
@@ -227,13 +227,13 @@ param
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
VerbForms : Type =
|
VerbForms : Type =
|
||||||
Tense => Anteriority => CPolarity => Order => Agr =>
|
Tense => Anteriority => CPolarity => Order => Agr =>
|
||||||
{aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept
|
{aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept
|
||||||
|
|
||||||
VP : Type = {
|
VP : Type = {
|
||||||
s : VerbForms ;
|
s : VerbForms ;
|
||||||
p : Str ; -- verb particle
|
p : Str ; -- verb particle
|
||||||
prp : Str ; -- present participle
|
prp : Str ; -- present participle
|
||||||
ptp : Str ; -- past participle
|
ptp : Str ; -- past participle
|
||||||
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
||||||
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
|
ad : Agr => Str ; -- sentence adverb (can be Xself, hence Agr)
|
||||||
@@ -248,13 +248,13 @@ param
|
|||||||
missingAdv : Bool -- The sentence has been through VPSlashPrep, and the only missing thing is just an adverbial and shouldn't affect the agreement.
|
missingAdv : Bool -- The sentence has been through VPSlashPrep, and the only missing thing is just an adverbial and shouldn't affect the agreement.
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb ->
|
predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb ->
|
||||||
predV verb ** {c2 = verb.c2 ; gapInMiddle = True; missingAdv = False} ;
|
predV verb ** {c2 = verb.c2 ; gapInMiddle = True; missingAdv = False} ;
|
||||||
|
|
||||||
cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ;
|
cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ;
|
||||||
|
|
||||||
predV : Verb -> VP = \verb -> {
|
predV : Verb -> VP = \verb -> {
|
||||||
s = \\t,ant,b,ord,agr =>
|
s = \\t,ant,b,ord,agr =>
|
||||||
let
|
let
|
||||||
inf = verb.s ! VInf ;
|
inf = verb.s ! VInf ;
|
||||||
fin = presVerb verb agr ;
|
fin = presVerb verb agr ;
|
||||||
@@ -303,8 +303,8 @@ param
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
predAux : Aux -> VP = \verb -> {
|
predAux : Aux -> VP = \verb -> {
|
||||||
s = \\t,ant,cb,ord,agr =>
|
s = \\t,ant,cb,ord,agr =>
|
||||||
let
|
let
|
||||||
b = case cb of {
|
b = case cb of {
|
||||||
CPos => Pos ;
|
CPos => Pos ;
|
||||||
_ => Neg
|
_ => Neg
|
||||||
@@ -321,7 +321,7 @@ param
|
|||||||
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||||
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
|
<Pres,Anter,CNeg c,ODir True> => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent
|
||||||
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||||
|
|
||||||
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
|
<Past,Anter,CPos,ODir True> => vf (cBind "d") part ; --# notpresent
|
||||||
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||||
<Past,Anter,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") part ; --# notpresent
|
<Past,Anter,CNeg c,ODir True> => vfn c (cBind "d") (cBind "d not") part ; --# notpresent
|
||||||
@@ -349,7 +349,7 @@ param
|
|||||||
<Pres,Simul,CPos, _> => vf fin [] ;
|
<Pres,Simul,CPos, _> => vf fin [] ;
|
||||||
<Pres,Simul,CNeg c,ODir True> => vfn c cfinp fin [] ;
|
<Pres,Simul,CNeg c,ODir True> => vfn c cfinp fin [] ;
|
||||||
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
p = [] ;
|
p = [] ;
|
||||||
prp = verb.prpart ;
|
prp = verb.prpart ;
|
||||||
@@ -360,14 +360,14 @@ param
|
|||||||
isSimple = True ;
|
isSimple = True ;
|
||||||
s2 = \\_ => []
|
s2 = \\_ => []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y ->
|
vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y ->
|
||||||
{aux = [] ; adv = [] ; fin = x ; inf = y} ;
|
{aux = [] ; adv = [] ; fin = x ; inf = y} ;
|
||||||
|
|
||||||
vf : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> vfn True x x y ;
|
vf : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> vfn True x x y ;
|
||||||
|
|
||||||
vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} =
|
vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} =
|
||||||
\contr,x,y,z ->
|
\contr,x,y,z ->
|
||||||
case contr of {
|
case contr of {
|
||||||
True => {aux = y ; adv = [] ; fin = [] ; inf = z} ;
|
True => {aux = y ; adv = [] ; fin = [] ; inf = z} ;
|
||||||
False => {aux = x ; adv = "not" ; fin = [] ; inf = z}
|
False => {aux = x ; adv = "not" ; fin = [] ; inf = z}
|
||||||
@@ -393,9 +393,9 @@ param
|
|||||||
isSimple = False ;
|
isSimple = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp ->
|
insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp ->
|
||||||
insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
|
insertObj obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
|
||||||
insertExtrac : Str -> SlashVP -> SlashVP = \obj,vp ->
|
insertExtrac : Str -> SlashVP -> SlashVP = \obj,vp ->
|
||||||
insertExtra obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
|
insertExtra obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ;
|
||||||
|
|
||||||
--- AR 7/3/2013 move the particle after the object
|
--- AR 7/3/2013 move the particle after the object
|
||||||
@@ -408,7 +408,7 @@ param
|
|||||||
ad = vp.ad ;
|
ad = vp.ad ;
|
||||||
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
|
s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre
|
||||||
isSimple = False ;
|
isSimple = False ;
|
||||||
ext = vp.ext
|
ext = vp.ext
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--- The adverb should be before the finite verb.
|
--- The adverb should be before the finite verb.
|
||||||
@@ -439,7 +439,7 @@ param
|
|||||||
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
|
ext = vp.ext ++ e --- there should be at most one, one might think; but: I would say that it will be raining if I saw clouds
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
||||||
predVV : {s : VVForm => Str ; p : Str ; typ : VVType} -> VP = \verb ->
|
predVV : {s : VVForm => Str ; p : Str ; typ : VVType} -> VP = \verb ->
|
||||||
let verbs = verb.s
|
let verbs = verb.s
|
||||||
@@ -462,14 +462,14 @@ param
|
|||||||
_ => predV {s = \\vf => verbs ! VVF vf ; p = verb.p ; isRefl = False}
|
_ => predV {s = \\vf => verbs ! VVF vf ; p = verb.p ; isRefl = False}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
||||||
agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
||||||
|
|
||||||
infVP : VVType -> VP -> Bool -> Anteriority -> CPolarity -> Agr -> Str = \typ,vp,ad_pos,ant,cb,a ->
|
infVP : VVType -> VP -> Bool -> Anteriority -> CPolarity -> Agr -> Str = \typ,vp,ad_pos,ant,cb,a ->
|
||||||
case cb of {CPos => ""; _ => "not"} ++
|
case cb of {CPos => ""; _ => "not"} ++
|
||||||
case ant of {
|
case ant of {
|
||||||
Simul => case typ of {
|
Simul => case typ of {
|
||||||
VVAux => vp.ad ! a ++ vp.inf ;
|
VVAux => vp.ad ! a ++ vp.inf ;
|
||||||
VVInf => case ad_pos of { ---- this is the "split infinitive"
|
VVInf => case ad_pos of { ---- this is the "split infinitive"
|
||||||
True => vp.ad ! a ++ "to" ++ vp.inf ;
|
True => vp.ad ! a ++ "to" ++ vp.inf ;
|
||||||
False => "to" ++ vp.ad ! a ++ vp.inf
|
False => "to" ++ vp.ad ! a ++ vp.inf
|
||||||
@@ -487,7 +487,7 @@ param
|
|||||||
} ++ vp.p ++
|
} ++ vp.p ++
|
||||||
vp.s2 ! a ++ vp.ext ;
|
vp.s2 ! a ++ vp.ext ;
|
||||||
|
|
||||||
agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
||||||
case agr of {
|
case agr of {
|
||||||
AgP3Sg _ => has ;
|
AgP3Sg _ => has ;
|
||||||
_ => have
|
_ => have
|
||||||
@@ -502,20 +502,20 @@ param
|
|||||||
haventContr = agrVerb (cBind "s not") (cBind "ve not") ;
|
haventContr = agrVerb (cBind "s not") (cBind "ve not") ;
|
||||||
|
|
||||||
Aux = {
|
Aux = {
|
||||||
pres : Polarity => Agr => Str ;
|
pres : Polarity => Agr => Str ;
|
||||||
contr : Polarity => Agr => Str ; -- contracted forms
|
contr : Polarity => Agr => Str ; -- contracted forms
|
||||||
past : Polarity => Agr => Str ; --# notpresent
|
past : Polarity => Agr => Str ; --# notpresent
|
||||||
inf,ppart,prpart : Str
|
inf,ppart,prpart : Str
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
auxBe : Aux = {
|
auxBe : Aux = {
|
||||||
pres = \\b,a => case <b,a> of {
|
pres = \\b,a => case <b,a> of {
|
||||||
<Pos,AgP1 Sg> => "am" ;
|
<Pos,AgP1 Sg> => "am" ;
|
||||||
<Neg,AgP1 Sg> => ["am not"] ; --- am not I
|
<Neg,AgP1 Sg> => ["am not"] ; --- am not I
|
||||||
_ => agrVerb (posneg b "is") (posneg b "are") a
|
_ => agrVerb (posneg b "is") (posneg b "are") a
|
||||||
} ;
|
} ;
|
||||||
contr = \\b,a => case <b,a> of {
|
contr = \\b,a => case <b,a> of {
|
||||||
<Pos,AgP1 Sg> => cBind "m" ;
|
<Pos,AgP1 Sg> => cBind "m" ;
|
||||||
<Neg,AgP1 Sg> => cBind "m not" ; --- am not I
|
<Neg,AgP1 Sg> => cBind "m not" ; --- am not I
|
||||||
_ => agrVerb (posneg b (cBind "s")) (posneg b (cBind "re")) a
|
_ => agrVerb (posneg b (cBind "s")) (posneg b (cBind "re")) a
|
||||||
} ;
|
} ;
|
||||||
@@ -545,7 +545,7 @@ param
|
|||||||
AgP2 Pl => "yourselves" ;
|
AgP2 Pl => "yourselves" ;
|
||||||
AgP3Pl _ => "themselves"
|
AgP3Pl _ => "themselves"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
possPron : Agr => Str = table {
|
possPron : Agr => Str = table {
|
||||||
AgP1 Sg => "my" ;
|
AgP1 Sg => "my" ;
|
||||||
AgP2 Sg => "your" ;
|
AgP2 Sg => "your" ;
|
||||||
@@ -565,8 +565,8 @@ param
|
|||||||
|
|
||||||
mkClause : Str -> Agr -> VP -> Clause =
|
mkClause : Str -> Agr -> VP -> Clause =
|
||||||
\subj,agr,vp -> {
|
\subj,agr,vp -> {
|
||||||
s = \\t,a,b,o =>
|
s = \\t,a,b,o =>
|
||||||
let
|
let
|
||||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||||
compl = vp.s2 ! agr ++ vp.ext
|
compl = vp.s2 ! agr ++ vp.ext
|
||||||
in
|
in
|
||||||
@@ -583,41 +583,41 @@ param
|
|||||||
_ => neg.s ! t ! a ! CPos ! o
|
_ => neg.s ! t ! a ! CPos ! o
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- For $Numeral$.
|
-- For $Numeral$.
|
||||||
|
|
||||||
mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Case => Str} =
|
mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Case => Str} =
|
||||||
\two, twelve, twenty, second ->
|
\two, twelve, twenty, second ->
|
||||||
{s = table {
|
{s = table {
|
||||||
unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ;
|
unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ;
|
||||||
teen => \\c => mkCard c twelve ;
|
teen => \\c => mkCard c twelve ;
|
||||||
ten => \\c => mkCard c twenty
|
ten => \\c => mkCard c twenty
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
regNum : Str -> {s : DForm => CardOrd => Case => Str} =
|
regNum : Str -> {s : DForm => CardOrd => Case => Str} =
|
||||||
\six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ;
|
\six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ;
|
||||||
|
|
||||||
regCardOrd : Str -> {s : CardOrd => Case => Str} = \ten ->
|
regCardOrd : Str -> {s : CardOrd => Case => Str} = \ten ->
|
||||||
{s = table {NCard => regGenitiveS ten ;
|
{s = table {NCard => regGenitiveS ten ;
|
||||||
NOrd => regGenitiveS (regOrd ten)} } ;
|
NOrd => regGenitiveS (regOrd ten)} } ;
|
||||||
|
|
||||||
mkCard : CardOrd -> Str -> Case => Str = \o,ten ->
|
mkCard : CardOrd -> Str -> Case => Str = \o,ten ->
|
||||||
(regCardOrd ten).s ! o ;
|
(regCardOrd ten).s ! o ;
|
||||||
|
|
||||||
regOrd : Str -> Str = \ten ->
|
regOrd : Str -> Str = \ten ->
|
||||||
case last ten of {
|
case last ten of {
|
||||||
"y" => init ten + "ieth" ;
|
"y" => init ten + "ieth" ;
|
||||||
_ => ten + "th"
|
_ => ten + "th"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkQuestion :
|
mkQuestion :
|
||||||
{s : Str} -> Clause ->
|
{s : Str} -> Clause ->
|
||||||
{s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl ->
|
{s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl ->
|
||||||
{
|
{
|
||||||
s = \\t,a,p =>
|
s = \\t,a,p =>
|
||||||
let
|
let
|
||||||
cls = cl.s ! t ! a ! p ;
|
cls = cl.s ! t ! a ! p ;
|
||||||
why = wh.s
|
why = wh.s
|
||||||
in table {
|
in table {
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
|||||||
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
||||||
|
|
||||||
ImpVP vp = {
|
ImpVP vp = {
|
||||||
s = \\pol,n =>
|
s = \\pol,n =>
|
||||||
let
|
let
|
||||||
agr = AgP2 (numImp n) ;
|
agr = AgP2 (numImp n) ;
|
||||||
verb = infVP VVAux vp False Simul CPos agr ;
|
verb = infVP VVAux vp False Simul CPos agr ;
|
||||||
dont = case pol of {
|
dont = case pol of {
|
||||||
@@ -26,7 +26,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
|||||||
s = \\pol,impform => adv.s ++ imp.s ! pol ! impform
|
s = \\pol,impform => adv.s ++ imp.s ! pol ! impform
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SlashVP np vp =
|
SlashVP np vp =
|
||||||
mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ;
|
mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ;
|
||||||
|
|
||||||
AdvSlash slash adv = {
|
AdvSlash slash adv = {
|
||||||
@@ -36,8 +36,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
|||||||
|
|
||||||
SlashPrep cl prep = cl ** {c2 = prep.s} ;
|
SlashPrep cl prep = cl ** {c2 = prep.s} ;
|
||||||
|
|
||||||
SlashVS np vs slash =
|
SlashVS np vs slash =
|
||||||
mkClause (np.s ! npNom) np.a
|
mkClause (np.s ! npNom) np.a
|
||||||
(insertObj (\\_ => conjThat ++ slash.s) (predV vs)) **
|
(insertObj (\\_ => conjThat ++ slash.s) (predV vs)) **
|
||||||
{c2 = slash.c2} ;
|
{c2 = slash.c2} ;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete StructuralEng of Structural = CatEng **
|
concrete StructuralEng of Structural = CatEng **
|
||||||
open MorphoEng, ResEng, ParadigmsEng, MakeStructuralEng, Prelude in {
|
open MorphoEng, ResEng, ParadigmsEng, MakeStructuralEng, Prelude in {
|
||||||
|
|
||||||
flags optimize=all ;
|
flags optimize=all ;
|
||||||
@@ -38,7 +38,7 @@ concrete StructuralEng of Structural = CatEng **
|
|||||||
typ = VVAux
|
typ = VVAux
|
||||||
} |
|
} |
|
||||||
{
|
{
|
||||||
s = table {
|
s = table {
|
||||||
VVF VInf => ["be able to"] ;
|
VVF VInf => ["be able to"] ;
|
||||||
VVF VPres => "can" ;
|
VVF VPres => "can" ;
|
||||||
VVF VPPart => ["been able to"] ;
|
VVF VPPart => ["been able to"] ;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ lin
|
|||||||
a = agrgP3 Sg cn.g
|
a = agrgP3 Sg cn.g
|
||||||
} ;
|
} ;
|
||||||
CNSymbNP det cn xs = {
|
CNSymbNP det cn xs = {
|
||||||
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! npcase2case c ;
|
s = \\c => det.s ++ cn.s ! det.n ! Nom ++ (addGenitiveS xs.s) ! npcase2case c ;
|
||||||
a = agrgP3 det.n cn.g
|
a = agrgP3 det.n cn.g
|
||||||
} ;
|
} ;
|
||||||
CNNumNP cn i = {
|
CNNumNP cn i = {
|
||||||
@@ -20,12 +20,12 @@ lin
|
|||||||
a = agrgP3 Sg cn.g
|
a = agrgP3 Sg cn.g
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SymbS sy = sy ;
|
SymbS sy = sy ;
|
||||||
|
|
||||||
SymbNum sy = { s,sp = \\_ => addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
SymbNum sy = { s,sp = \\_ => addGenitiveS sy.s ; n = Pl ; hasCard = True } ;
|
||||||
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ;
|
||||||
|
|
||||||
lincat
|
lincat
|
||||||
|
|
||||||
Symb, [Symb] = SS ;
|
Symb, [Symb] = SS ;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ lin
|
|||||||
oper
|
oper
|
||||||
-- Note: this results in a space before 's, but there's
|
-- Note: this results in a space before 's, but there's
|
||||||
-- not mauch we can do about that.
|
-- not mauch we can do about that.
|
||||||
addGenitiveS : Str -> Case => Str = \s ->
|
addGenitiveS : Str -> Case => Str = \s ->
|
||||||
table { Gen => s ++ BIND ++ "'s"; _ => s } ;
|
table { Gen => s ++ BIND ++ "'s"; _ => s } ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../abstract:../common
|
--# -path=.:../abstract:../common
|
||||||
|
|
||||||
concrete TerminologyEng of Terminology = CatEng ** open
|
concrete TerminologyEng of Terminology = CatEng ** open
|
||||||
ResEng,
|
ResEng,
|
||||||
ParadigmsEng,
|
ParadigmsEng,
|
||||||
(G = GrammarEng),
|
(G = GrammarEng),
|
||||||
@@ -60,7 +60,7 @@ lin
|
|||||||
active_Parameter = mkN "active" ;
|
active_Parameter = mkN "active" ;
|
||||||
passive_Parameter = mkN "passive" ;
|
passive_Parameter = mkN "passive" ;
|
||||||
middle_Parameter = mkN "middle" ;
|
middle_Parameter = mkN "middle" ;
|
||||||
|
|
||||||
imperative_Parameter = mkN "imperative" ;
|
imperative_Parameter = mkN "imperative" ;
|
||||||
indicative_Parameter = mkN "indicative" ;
|
indicative_Parameter = mkN "indicative" ;
|
||||||
conjunctive_Parameter = mkN "conjunctive" ;
|
conjunctive_Parameter = mkN "conjunctive" ;
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ concrete VerbEng of Verb = CatEng ** open ResEng, Prelude in {
|
|||||||
UseV = predV ;
|
UseV = predV ;
|
||||||
|
|
||||||
SlashV2a v = predVc v ** {c2 = v.c2 ; gapInMiddle = False} ;
|
SlashV2a v = predVc v ** {c2 = v.c2 ; gapInMiddle = False} ;
|
||||||
Slash2V3 v np =
|
Slash2V3 v np =
|
||||||
insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predVc v ** {c2 = v.c3 ; gapInMiddle = False}) ;
|
insertObjc (\\_ => v.c2 ++ np.s ! NPAcc) (predVc v ** {c2 = v.c3 ; gapInMiddle = False}) ;
|
||||||
Slash3V3 v np =
|
Slash3V3 v np =
|
||||||
insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ----
|
insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ----
|
||||||
|
|
||||||
ComplVV v vp = insertObj (\\a => infVP v.typ vp False Simul CPos a) (predVV v) ; ---- insertExtra?
|
ComplVV v vp = insertObj (\\a => infVP v.typ vp False Simul CPos a) (predVV v) ; ---- insertExtra?
|
||||||
ComplVS v s = insertExtra (conjThat ++ s.s) (predV v) ;
|
ComplVS v s = insertExtra (conjThat ++ s.s) (predV v) ;
|
||||||
--- ComplVS v s = insertObj (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predV v) ;
|
--- ComplVS v s = insertObj (variants {\\_ => conjThat ++ s.s; \\_ => s.s}) (predV v) ;
|
||||||
ComplVQ v q = insertExtra (q.s ! QIndir) (predV v) ;
|
ComplVQ v q = insertExtra (q.s ! QIndir) (predV v) ;
|
||||||
ComplVA v ap = insertObj (ap.s) (predV v) ;
|
ComplVA v ap = insertObj (ap.s) (predV v) ;
|
||||||
@@ -62,7 +62,7 @@ concrete VerbEng of Verb = CatEng ** open ResEng, Prelude in {
|
|||||||
CompAP ap = ap ;
|
CompAP ap = ap ;
|
||||||
CompNP np = {s = \\_ => np.s ! NPAcc} ;
|
CompNP np = {s = \\_ => np.s ! NPAcc} ;
|
||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
CompCN cn = {s = \\a => case (fromAgr a).n of {
|
CompCN cn = {s = \\a => case (fromAgr a).n of {
|
||||||
Sg => artIndef ++ cn.s ! Sg ! Nom ;
|
Sg => artIndef ++ cn.s ! Sg ! Nom ;
|
||||||
Pl => cn.s ! Pl ! Nom
|
Pl => cn.s ! Pl ! Nom
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user