diff --git a/src/english/AdjectiveEng.gf b/src/english/AdjectiveEng.gf index e94a36d3..c858096a 100644 --- a/src/english/AdjectiveEng.gf +++ b/src/english/AdjectiveEng.gf @@ -21,22 +21,22 @@ concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in { } ; 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 } ; 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 } ; 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 } ; SentAP ap sc = { - s = \\a => ap.s ! a ++ sc.s ; + s = \\a => ap.s ! a ++ sc.s ; isPre = False } ; diff --git a/src/english/BackwardEng.gf b/src/english/BackwardEng.gf index cc17d7ea..57d2f084 100644 --- a/src/english/BackwardEng.gf +++ b/src/english/BackwardEng.gf @@ -10,44 +10,44 @@ concrete BackwardEng of Backward = CatEng ** open ResEng in { -- from Verb 19/4/2008 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) ; - ComplV2V v np vp = + ComplV2V v np vp = insertObj (\\a => infVP v.isAux vp False Simul CPos a) (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; - ComplV2S v np s = + ComplV2S v np s = insertObj (\\_ => conjThat ++ s.s) (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; - ComplV2Q v np q = - insertObj (\\_ => q.s ! QIndir) + ComplV2Q v np q = + insertObj (\\_ => q.s ! QIndir) (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) ; ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; -- from Sentence 19/4/2008 - SlashV2 np v2 = + SlashV2 np v2 = mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ; - SlashVVV2 np vv v2 = - mkClause (np.s ! Nom) np.a + SlashVVV2 np vv v2 = + mkClause (np.s ! Nom) np.a (insertObj (\\a => infVP vv.isAux (predV v2) False Simul CPos a) (predVV vv)) ** {c2 = v2.c2} ; -- 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 DetSg quant ord = { - s = quant.s ! Sg ++ ord.s ; + s = quant.s ! Sg ++ ord.s ; n = Sg } ; 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 } ; @@ -57,7 +57,7 @@ concrete BackwardEng of Backward = CatEng ** open ResEng in { IndefArt = { s = table { - Sg => artIndef ; + Sg => artIndef ; Pl => [] } } ; diff --git a/src/english/CatEng.gf b/src/english/CatEng.gf index 6b154860..d6c1e727 100644 --- a/src/english/CatEng.gf +++ b/src/english/CatEng.gf @@ -28,14 +28,14 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in { QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ; IP = {s : NPCase => Str ; n : Number} ; - IComp = {s : Str} ; + IComp = {s : Str} ; IDet = {s : Str ; n : Number} ; IQuant = {s : Number => Str} ; -- Relative RCl = { - s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; + s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; c : NPCase } ; RP = {s : RCase => Str ; a : RAgr} ; @@ -44,11 +44,11 @@ concrete CatEng of Cat = CommonX - [Pol,CAdv] ** open ResEng, Prelude in { VP = ResEng.VP ; VPSlash = ResEng.SlashVP ; - Comp = {s : Agr => Str} ; + Comp = {s : Agr => Str} ; -- Adjective - AP = {s : Agr => Str ; isPre : Bool} ; + AP = {s : Agr => Str ; isPre : Bool} ; -- Noun diff --git a/src/english/CompatibilityEng.gf b/src/english/CompatibilityEng.gf index 1efad7a9..a5df94af 100644 --- a/src/english/CompatibilityEng.gf +++ b/src/english/CompatibilityEng.gf @@ -5,13 +5,13 @@ concrete CompatibilityEng of Compatibility = CatEng ** open Prelude, ResEng in { -- from Noun 19/4/2008 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 } ; oper -- Note: this results in a space before 's, but there's -- not mauch we can do about that. - addGenitiveS : Str -> Case => Str = \s -> + addGenitiveS : Str -> Case => Str = \s -> table { Gen => s ++ "'s"; _ => s } ; } diff --git a/src/english/ConjunctionEng.gf b/src/english/ConjunctionEng.gf index 93284af6..e5ef0834 100644 --- a/src/english/ConjunctionEng.gf +++ b/src/english/ConjunctionEng.gf @@ -1,4 +1,4 @@ -concrete ConjunctionEng of Conjunction = +concrete ConjunctionEng of Conjunction = CatEng ** open ResEng, Coordination, Prelude in { flags optimize=all_subs ; @@ -22,11 +22,11 @@ concrete ConjunctionEng of Conjunction = c = ss.c } ; - ConjIAdv = conjunctDistrSS ; + ConjIAdv = conjunctDistrSS ; 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. diff --git a/src/english/DocumentationEng.gf b/src/english/DocumentationEng.gf index 44a6d4e1..cbdbcfa6 100644 --- a/src/english/DocumentationEng.gf +++ b/src/english/DocumentationEng.gf @@ -83,7 +83,7 @@ lin InflectionV3 v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ v.c2 ++ pp "arg1" ++ @@ -93,7 +93,7 @@ lin InflectionV2V v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ v.c2 ++ pp "object" ++ @@ -107,7 +107,7 @@ lin InflectionV2S v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ v.c2 ++ pp "object" ++ @@ -117,7 +117,7 @@ lin InflectionV2Q v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ pp "question") ; @@ -126,7 +126,7 @@ lin InflectionV2A v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ v.c2 ++ pp "object" ++ @@ -136,7 +136,7 @@ lin InflectionVV v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VVF VInf ++ v.p ++ case v.typ of { @@ -155,7 +155,7 @@ lin InflectionVS v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ "that" ++ pp "sentence") ; @@ -164,7 +164,7 @@ lin InflectionVQ v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ pp "question") ; @@ -173,7 +173,7 @@ lin InflectionVA v = { t = "v" ; - s1= heading1 "Verb" ++ + s1= heading1 "Verb" ++ paragraph (pp "subject" ++ v.s ! VInf ++ v.p ++ pp "adjective") ; diff --git a/src/english/DocumentationEngFunctor.gf b/src/english/DocumentationEngFunctor.gf index d1be94b3..0df78675 100644 --- a/src/english/DocumentationEngFunctor.gf +++ b/src/english/DocumentationEngFunctor.gf @@ -2,7 +2,7 @@ -- documentation of English in any language instantiating Terminology -incomplete concrete DocumentationEngFunctor of Documentation = CatEng ** open +incomplete concrete DocumentationEngFunctor of Documentation = CatEng ** open Terminology, ResEng, ParadigmsEng, @@ -16,18 +16,18 @@ in { lincat Inflection = {s1,s2 : Str} ; - Document = {s : Str} ; - + Document = {s : Str} ; + oper tdf : Str -> Str = \s -> td (intag "i" s) ; heading : N -> Str = \n -> (nounHeading n).s ; lin InflectionN noun = { s1 = heading1 (heading noun_Category) ; - s2 = frameTable ( + s2 = frameTable ( 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 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 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)) ) } ; 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)))) ; s2= inflVerb 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))) ; s2= inflVerb 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))))) ; s2= inflVerb v } ; @@ -63,7 +64,7 @@ lin MkDocument b i e = ss (i.s1 ++ "

"++b.s++"

" ++ i.s2 ++ paragraph e.s) ; -oper +oper verbExample : CatEng.Cl -> Str = \cl -> (S.mkUtt cl).s ; inflVerb : Verb -> Str = \verb -> @@ -72,7 +73,7 @@ oper tr (th (heading present_Parameter) ++ tdf (verb.s ! VPres)) ++ 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 present_Parameter ++ heading participle_Parameter) ++ tdf (verb.s ! VPresPart)) + tr (th (heading present_Parameter ++ heading participle_Parameter) ++ tdf (verb.s ! VPresPart)) ) ; } diff --git a/src/english/ExtendEng.gf b/src/english/ExtendEng.gf index db301014..5149a825 100644 --- a/src/english/ExtendEng.gf +++ b/src/english/ExtendEng.gf @@ -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} ; 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 } ; diff --git a/src/english/ExtraEng.gf b/src/english/ExtraEng.gf index 4f016d3a..248fb666 100644 --- a/src/english/ExtraEng.gf +++ b/src/english/ExtraEng.gf @@ -1,11 +1,11 @@ -concrete ExtraEng of ExtraEngAbs = CatEng ** +concrete ExtraEng of ExtraEngAbs = CatEng ** open ResEng, Coordination, Prelude, MorphoEng, ParadigmsEng in { lin GenNP np = {s = \\_,_ => np.s ! npGen ; sp = \\_,_,_,_ => np.s ! npGen; isDef = True} ; GenIP ip = {s = \\_ => ip.s ! NCase Gen} ; GenRP nu cn = { - s = \\c => "whose" ++ nu.s ! False ! Nom ++ + s = \\c => "whose" ++ nu.s ! False ! Nom ++ case c of { RC _ (NCase Gen) => cn.s ! nu.n ! Gen ; _ => cn.s ! nu.n ! Nom @@ -14,12 +14,12 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** } ; 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 ; c = NPAcc } ; 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 ; c = NPAcc } ; @@ -28,11 +28,11 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** c = NPAcc } ; - PiedPipingQuestSlash ip slash = + PiedPipingQuestSlash ip slash = mkQuestion (ss (slash.c2 ++ ip.s ! NPAcc)) slash ; - StrandQuestSlash ip slash = - {s = \\t,a,b,q => + StrandQuestSlash ip slash = + {s = \\t,a,b,q => (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 ; - ComplVPIVV vv vpi = + ComplVPIVV vv vpi = insertObj (\\a => vpi.s ! vv.typ ! a) (predVV vv) ; lin @@ -73,8 +73,8 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** PredVPS np vpi = {s = np.s ! npNom ++ vpi.s ! np.a} ; MkVPS t p vp = { - s = \\a => - let + s = \\a => + let verb = vp.s ! t.t ! t.a ! p.p ! oDir ! a ; 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 @@ -110,7 +110,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** } ; may_VV = lin VV { - s = table { + s = table { VVF VInf => ["be allowed to"] ; VVF VPres => "may" ; VVF VPPart => ["been allowed to"] ; @@ -124,21 +124,21 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** } ; shall_VV = lin VV { - s = table { + s = table { VVF VInf => ["be obliged to"] ; --- VVF VPres => "shall" ; VVF VPPart => ["been obliged to"] ; VVF VPresPart => ["being obliged to"] ; VVF VPast => "should" ; --# notpresent VVPastNeg => "shouldn't" ; --# notpresent - VVPresNeg => "shan't" + VVPresNeg => "shan't" } ; p = [] ; typ = VVAux } ; ought_VV = lin VV { - s = table { + s = table { VVF VInf => ["be obliged to"] ; --- VVF VPres => "ought to" ; VVF VPPart => ["been obliged to"] ; @@ -152,37 +152,37 @@ concrete ExtraEng of ExtraEngAbs = CatEng ** } ; used_VV = lin VV { - s = table { + s = table { VVF VInf => Predef.nonExist ; --- VVF VPres => Predef.nonExist ; VVF VPPart => ["used to"] ; VVF VPresPart => ["being used to"] ; VVF VPast => "used to" ; --# notpresent VVPastNeg => "used not to" ; --# notpresent - VVPresNeg => Predef.nonExist + VVPresNeg => Predef.nonExist } ; p = [] ; typ = VVAux } ; - NominalizeVPSlashNP vpslash np = + NominalizeVPSlashNP vpslash np = let vp : ResEng.VP = insertObjPre (\\_ => vpslash.c2 ++ np.s ! NPAcc) vpslash ; a = AgP3Sg Neutr - in - lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ; + in + lin NP {s = \\_ => vp.ad ! a ++ vp.prp ++ vp.s2 ! a ; a = a} ; lin - UncNeg = {s = [] ; p = CNeg False} ; + UncNeg = {s = [] ; p = CNeg False} ; - oper passVPSlash : VPSlash -> Str -> ResEng.VP = - \vps,ag -> - let + oper passVPSlash : VPSlash -> Str -> ResEng.VP = + \vps,ag -> + let be = predAux auxBe ; ppt = vps.ptp in { s = be.s ; - p = [] ; + p = [] ; prp = be.prp ; ptp = be.ptp ; inf = be.inf ; @@ -192,7 +192,7 @@ lin ext = vps.ext } ; - lin + lin PassVPSlash vps = passVPSlash vps [] ; PassAgentVPSlash vps np = passVPSlash vps ("by" ++ np.s ! NPAcc) ; @@ -202,8 +202,8 @@ lin } ; --- AR 22/5/2013 - ExistsNP np = - mkClause "there" (agrP3 (fromAgr np.a).n) + ExistsNP np = + mkClause "there" (agrP3 (fromAgr np.a).n) (insertObj (\\_ => np.s ! NPAcc) (predV (regV "exist"))) ; 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} ; FrontExtPredVP np vp = { - s = \\t,a,b,o => - let + s = \\t,a,b,o => + let subj = np.s ! npNom ; agr = np.a ; verb = vp.s ! t ! a ! b ! o ! agr ; @@ -252,8 +252,8 @@ lin } ; InvFrontExtPredVP np vp = { - s = \\t,a,b,o => - let + s = \\t,a,b,o => + let subj = np.s ! npNom ; agr = np.a ; verb = vp.s ! t ! a ! b ! o ! agr ; @@ -269,7 +269,7 @@ lin oper unc : CPolarity -> CPolarity = \x -> case x of { - CNeg _ => CNeg False ; + CNeg _ => CNeg False ; _ => x } ; ------- @@ -285,7 +285,7 @@ lin RNP = {s : Agr => Str} ; RNPList = {s1,s2 : Agr => Str} ; - lin + lin ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ; ReflPron = {s = reflPron} ; 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_nr_RNP x xs = consrTable Agr comma {s = \\a => x.s ! NPAcc} xs ; - + ---- TODO: RNPList construction @@ -307,7 +307,7 @@ lin that_RP = { s = table { - RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; + RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; RC Neutr _ => "that" ; RC _ NPAcc => "that" ; RC _ (NCase Nom) => "that" ; @@ -319,7 +319,7 @@ lin which_who_RP = { s = table { - RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; + RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; RC Neutr _ => "which" ; RC _ NPAcc => "whom" ; RC _ (NCase Nom) => "who" ; @@ -328,18 +328,18 @@ lin } ; a = RNoAg } ; - + who_RP = { s = table { - RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; + RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; _ => "who" } ; a = RNoAg } ; - + which_RP = { s = table { - RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; + RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; _ => "which" } ; a = RNoAg @@ -347,7 +347,7 @@ lin emptyRP = { s = table { - RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; + RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; RC _ NPAcc => [] ; RC _ (NCase Nom) => "that" ; RPrep Neutr => "which" ; diff --git a/src/english/ExtraEngAbs.gf b/src/english/ExtraEngAbs.gf index b9b6642a..69a7bca5 100644 --- a/src/english/ExtraEngAbs.gf +++ b/src/english/ExtraEngAbs.gf @@ -1,14 +1,14 @@ abstract ExtraEngAbs = Extra - [ProDrop] ** { -- uncontracted negative polarity; contracted is the default for PNeg - fun + fun UncNeg : Pol ; -- freely compounded nouns 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) which_RP : RP ; -- force "which" who_RP : RP ; -- force "who" ; in Acc, also "who": "the girl who I saw" diff --git a/src/english/GrammarEng.gf b/src/english/GrammarEng.gf index 3e273229..c2600a7b 100644 --- a/src/english/GrammarEng.gf +++ b/src/english/GrammarEng.gf @@ -1,8 +1,8 @@ --# -path=.:../abstract:../common:prelude -concrete GrammarEng of Grammar = - NounEng, - VerbEng, +concrete GrammarEng of Grammar = + NounEng, + VerbEng, AdjectiveEng, AdverbEng, NumeralEng, diff --git a/src/english/IdiomEng.gf b/src/english/IdiomEng.gf index 05f40d16..eefc0307 100644 --- a/src/english/IdiomEng.gf +++ b/src/english/IdiomEng.gf @@ -6,28 +6,28 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in { ImpersCl vp = mkClause "it" (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 (\\_ => 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 (\\_ => ad.s) (predAux auxBe))) ; - ExistNP np = - mkClause "there" (agrP3 (fromAgr np.a).n) + ExistNP np = + mkClause "there" (agrP3 (fromAgr np.a).n) (insertObj (\\_ => np.s ! NPAcc) (predAux auxBe)) ; - ExistIP ip = - mkQuestion (ss (ip.s ! npNom)) + ExistIP ip = + mkQuestion (ss (ip.s ! npNom)) (mkClause "there" (agrP3 ip.n) (predAux auxBe)) ; - ExistNPAdv np adv = - mkClause "there" (agrP3 (fromAgr np.a).n) + ExistNPAdv np adv = + mkClause "there" (agrP3 (fromAgr np.a).n) (insertObj (\\_ => np.s ! NPAcc ++ adv.s) (predAux auxBe)) ; - ExistIPAdv ip adv = - mkQuestion (ss (ip.s ! npNom)) + ExistIPAdv ip adv = + mkQuestion (ss (ip.s ! npNom)) (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) ; @@ -39,7 +39,7 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in { SelfAdvVP vp = insertObj reflPron vp ; SelfAdVVP vp = insertAdVAgr reflPron vp ; SelfNP np = { - s = \\c => np.s ! c ++ reflPron ! np.a ; + s = \\c => np.s ! c ++ reflPron ! np.a ; a = np.a } ; diff --git a/src/english/LangEng.gf b/src/english/LangEng.gf index 7446f469..e7d716e9 100644 --- a/src/english/LangEng.gf +++ b/src/english/LangEng.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:../api:../prelude -concrete LangEng of Lang = +concrete LangEng of Lang = GrammarEng, LexiconEng ,ConstructionEng diff --git a/src/english/MakeStructuralEng.gf b/src/english/MakeStructuralEng.gf index 40c50f8d..13bbb761 100644 --- a/src/english/MakeStructuralEng.gf +++ b/src/english/MakeStructuralEng.gf @@ -2,8 +2,8 @@ resource MakeStructuralEng = open CatEng, ParadigmsEng, ResEng, MorphoEng, Prelude in { -oper - mkSubj : Str -> Subj = \x -> +oper + mkSubj : Str -> Subj = \x -> lin Subj {s = x} ; mkNP : Str -> ParadigmsEng.Number -> NP = \s,n -> lin NP (regNP s n) ; @@ -11,7 +11,7 @@ oper lin IDet {s = s ; n = n} ; mkIQuant : Str -> Str -> IQuant = \s,n -> lin IQuant {s = table {Sg => s ; Pl => n}} ; - + mkDet = overload { mkDet : Str -> Det = \s -> lin Det (mkDeterminer singular s) ; diff --git a/src/english/MorphoEng.gf b/src/english/MorphoEng.gf index 6a0d2fad..707beb95 100644 --- a/src/english/MorphoEng.gf +++ b/src/english/MorphoEng.gf @@ -14,9 +14,9 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in { --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!? mkDeterminerSpec : Number -> Str -> Str -> Str -> Bool -> @@ -30,7 +30,7 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in { --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} = \i,me,my,mine,n,p,g -> { s = table { diff --git a/src/english/NounEng.gf b/src/english/NounEng.gf index 1c09fe54..eed0441b 100644 --- a/src/english/NounEng.gf +++ b/src/english/NounEng.gf @@ -3,8 +3,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in { flags optimize=all_subs ; lin - DetCN det cn = { - s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ; + DetCN det cn = { + s = \\c => det.s ++ cn.s ! det.n ! npcase2case c ; a = agrgP3 det.n cn.g } ; @@ -48,8 +48,8 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in { } ; DetQuantOrd quant num ord = { - 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 ; + 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 ; n = num.n ; hasNum = True } ; diff --git a/src/english/NumeralEng.gf b/src/english/NumeralEng.gf index ce801908..47fc1c35 100644 --- a/src/english/NumeralEng.gf +++ b/src/english/NumeralEng.gf @@ -1,6 +1,6 @@ concrete NumeralEng of Numeral = CatEng [Numeral,Digits] ** open Prelude, ResEng in { -lincat +lincat Digit = {s : DForm => CardOrd => Case => Str} ; Sub10 = {s : DForm => 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 - lincat + lincat Dig = TDigit ; lin diff --git a/src/english/ParadigmsEng.gf b/src/english/ParadigmsEng.gf index 1ba055c2..fdcc5b52 100644 --- a/src/english/ParadigmsEng.gf +++ b/src/english/ParadigmsEng.gf @@ -4,12 +4,12 @@ -- -- 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 -- expressions of open categories: nouns, adjectives, verbs. --- +-- -- 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 -- 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 -- escape to construct the most irregular words of type $C$. -- 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. -resource ParadigmsEng = open - (Predef=Predef), - Prelude, +resource ParadigmsEng = open + (Predef=Predef), + Prelude, MorphoEng, ResEng, CatEng in { ---2 Parameters +--2 Parameters -- -- To abstract over gender names, we define the following identifiers. oper - Gender : Type ; + Gender : Type ; human : Gender ; nonhuman : Gender ; @@ -45,9 +45,9 @@ oper -- To abstract over number names, we define the following. - Number : Type ; + Number : Type ; - singular : Number ; + singular : Number ; plural : Number ; -- To abstract over case names, we define the following. @@ -74,10 +74,10 @@ oper mkN : overload { -- 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"), - 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. @@ -91,7 +91,7 @@ oper mkN : Gender -> N -> N ; -- default nonhuman ---3 Compound nouns +--3 Compound nouns -- -- A compound noun is an uninflected string attached to an inflected noun, -- such as "baby boom", "chief executive officer". @@ -106,17 +106,17 @@ oper verbalN : V -> N ; -- e.g. sing -> singing ---3 Relational nouns +--3 Relational nouns 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 -> Str -> N2 ; -- access to --% mkN2 : N -> Prep -> N2 ; -- e.g. access to 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. -- -- 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 --- and terminated by some other letters. To force this or the opposite, --- the following can be used: +-- and terminated by some other letters. To force this or the opposite, +-- the following can be used: compoundA : A -> A ; -- force comparison with more/most simpleA : A -> A ; -- force comparison with -er,-est @@ -179,7 +179,7 @@ oper --3 Two-place adjectives mkA2 : overload { - mkA2 : A -> Prep -> A2 ; -- absent from + mkA2 : A -> Prep -> A2 ; -- absent from mkA2 : A -> Str -> A2 ; -- absent from --% mkA2 : Str -> Prep -> 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 -- 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"). 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 -- 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". mkV : (drink, drank, drunk : Str) -> V ; -- ordinary irregular -- Irregular verbs with duplicated consonant in the present participle. - + mkV : (run, ran, run, running : Str) -> V ; -- irregular with duplication --% -- 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 -- hidden from the document. - Gender = ResEng.Gender ; + Gender = ResEng.Gender ; Number = ResEng.Number ; Case = ResEng.NPCase ; - human = Masc ; + human = Masc ; nonhuman = Neutr ; masculine = Masc ; feminine = Fem ; @@ -376,7 +376,7 @@ mkInterj : Str -> Interj Preposition : Type = Str ; -- obsolete - regN = \ray -> + regN = \ray -> let rays = add_s ray in mk2N ray rays ; @@ -392,12 +392,12 @@ mkInterj : Str -> Interj duplFinal : Str -> Str = \w -> case w of { _ + ("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 _ => w } ; - mk2N = \man,men -> + mk2N = \man,men -> let mens = case last men of { "s" => men + "'" ; _ => men + "'s" @@ -405,7 +405,7 @@ mkInterj : Str -> Interj in 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}) ; 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 : Str -> Str -> N2 = \n,s -> prepN2 (regN n) (mkPrep s); 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}) ; @@ -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'; } ; - mkQuantifier : Str -> Str -> Str -> Str -> Str -> Str -> Quant = + mkQuantifier : Str -> Str -> Str -> Str -> Str -> Str -> Quant = \sg,pl,sg1',pl1',sg2',pl2' -> lin Quant { s = \\_ => table { Sg => sg ; Pl => pl } ; 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} ; isDef = True } ; @@ -474,8 +474,8 @@ mkInterj : Str -> Interj mk2A a b = mkAdjective a a a b ; 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 (regADeg a) } ; @@ -486,7 +486,7 @@ mkInterj : Str -> Interj mkADeg a b c d = mkAdjective a b c d ; - regADeg happy = + regADeg happy = let happ = init happy ; y = last happy ; @@ -496,7 +496,7 @@ mkInterj : Str -> Interj _ => duplFinal happy + "e" } ; in mkADeg happy (happie + "r") (happie + "st") (adj2adv happy) ; - + adj2adv : Str -> Str = \happy -> case happy of { _ + "ble" => init happy + "y" ; @@ -505,8 +505,8 @@ mkInterj : Str -> Interj _ => happy + "ly" } ; - duplADeg fat = - mkADeg fat + duplADeg fat = + mkADeg fat (fat + last fat + "er") (fat + last fat + "est") (adj2adv fat) ; compoundADeg a = @@ -528,7 +528,7 @@ mkInterj : Str -> Interj mk5V a b c d e = lin V (mkVerb a b c d e ** {s1 = []}) ; - regV cry = + regV cry = let cries = (regN cry).s ! Pl ! Nom ; -- ! cried : Str = case cries of { @@ -539,7 +539,7 @@ mkInterj : Str -> Interj crying : Str = case cry of { _ + "ee" => cry + "ing" ; d + "ie" => d + "ying" ; - us + "e" => us + "ing" ; + us + "e" => us + "ing" ; ent + "er" => ent + "ering" ; _ => duplFinal cry + "ing" } @@ -547,14 +547,14 @@ mkInterj : Str -> Interj reg2V fit fitted = let fitt = Predef.tk 2 fitted ; - in + in 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) ; - regDuplV fit = + regDuplV fit = 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) ; t => let fitt = fit + t in @@ -567,8 +567,8 @@ mkInterj : Str -> Interj irreg4V x y z w = let reg = (regV x).s in mk5V x (reg ! VPres) y z w ** {s1 = []} ; - irregDuplV fit y z = - let + irregDuplV fit y z = + let fitting = (regDuplV fit).s ! VPresPart in 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} ; 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} ; dirV3 v p = prepPrepV3 v noPrep p ; dirdirV3 v = dirV3 v noPrep ; @@ -593,22 +593,22 @@ mkInterj : Str -> Interj mkVS v = lin VS v ; mkVV v = lin VV { s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ; - p = v.p ; + p = v.p ; typ = VVInf } ; auxVV, infVV = \v -> lin VV { s = table { - VVF vf => v.s ! vf ; - VVPresNeg => v.s ! VPres ++ "not" ; + VVF vf => v.s ! vf ; + VVPresNeg => v.s ! VPres ++ "not" ; VVPastNeg => v.s ! VPast ++ "not" ; --# notpresent _ => v.s ! VInf } ; - p = v.p ; + p = v.p ; typ = VVAux } ; ingVV v = lin VV { s = table {VVF vf => v.s ! vf ; _ => v.s ! VInf} ; - p = v.p ; + p = v.p ; typ = VVPresPart } ; mkVQ v = lin VQ v ; @@ -657,7 +657,7 @@ mkInterj : Str -> Interj 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 ; @@ -671,7 +671,7 @@ mkInterj : Str -> Interj mkA = overload { 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) ; mkA : (good,better,best,well : Str) -> A = \a,b,c,d -> mkAdjective a b c d @@ -680,10 +680,10 @@ mkInterj : Str -> Interj invarA s = mkAdjective s s s s ; compoundA = compoundADeg ; - simpleA a = - let ad = (a.s ! AAdj Posit Nom) + simpleA a = + let ad = (a.s ! AAdj Posit Nom) in regADeg ad ; - + irregAdv a adv = lin A {s = table {AAdv => adv; aform => a.s ! aform}; isPre = a.isPre} ; prepA2 : A -> Prep -> A2 ; @@ -726,7 +726,7 @@ mkInterj : Str -> Interj mkV2 : V -> Str -> V2 = \v,p -> prepV2 v (mkPrep p) ; mkV2 : Str -> Prep -> V2 = \v,p -> prepV2 (regV v) p ; mkV2 : Str -> Str -> V2 = \v,p -> prepV2 (regV v) (mkPrep p) - }; + }; prepPrepV3 : V -> Prep -> Prep -> V3 ; dirV3 : V -> Prep -> V3 ; @@ -748,18 +748,18 @@ mkInterj : Str -> Interj 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}) ; ---- obsolete --- Comparison adjectives may two more forms. +-- Comparison adjectives may two more forms. ADeg : Type ; 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 -- "-y" ("happy - happier - happiest - happily") @@ -780,7 +780,7 @@ mkInterj : Str -> Interj adegA : ADeg -> A ; - regPN : Str -> PN ; + regPN : Str -> PN ; regGenPN : Str -> Gender -> PN ; -- John, John's -- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". diff --git a/src/english/QuestionEng.gf b/src/english/QuestionEng.gf index a2f478d8..775a8f86 100644 --- a/src/english/QuestionEng.gf +++ b/src/english/QuestionEng.gf @@ -5,8 +5,8 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in { lin QuestCl cl = { - s = \\t,a,p => - let cls = cl.s ! t ! a ! p + s = \\t,a,p => + let cls = cl.s ! t ! a ! p in table { QDir => cls ! OQuest ; 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 in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ---- - QuestSlash ip slash = - {s = \\t,a,b,q => + QuestSlash ip slash = + {s = \\t,a,b,q => (mkQuestion (ss (ip.s ! NPAcc)) slash).s ! t ! a ! b ! q ++ slash.c2 } ; --- changed AR 5/6/2016: uses stranding; pied-piping in ExtraEng - + QuestIAdv iadv cl = mkQuestion iadv cl ; - QuestIComp icomp np = + QuestIComp icomp np = 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 ; n = ip.n } ; - + 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 } ; IdetIP idet = { - s = \\c => idet.s ; + s = \\c => idet.s ; n = idet.n } ; IdetQuant idet num = { - s = idet.s ! num.n ++ num.s ! False ! Nom ; + s = idet.s ! num.n ++ num.s ! False ! Nom ; n = num.n } ; @@ -56,14 +56,14 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in { CompIAdv a = a ; CompIP p = ss (p.s ! npNom) ; - lincat + lincat QVP = ResEng.VP ; lin ComplSlashIP vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! NPAcc) vp ; AdvQVP 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 in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! oDir} ; ---- diff --git a/src/english/RelativeEng.gf b/src/english/RelativeEng.gf index eb597d7c..5a0888e4 100644 --- a/src/english/RelativeEng.gf +++ b/src/english/RelativeEng.gf @@ -5,13 +5,13 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in { lin 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 } ; RelVP rp vp = { - s = \\t,ant,b,ag => - let + s = \\t,ant,b,ag => + let agr = case rp.a of { RNoAg => ag ; 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 --- 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"). 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 ; c = NPAcc } ; @@ -42,7 +42,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in { IdRP = { s = table { - RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; + RC _ (NCase Gen) | RC _ NPNomPoss => "whose" ; RC Neutr _ => "that" ; RC _ NPAcc => "that" ; RC _ (NCase Nom) => "that" ; diff --git a/src/english/ResEng.gf b/src/english/ResEng.gf index 0608fdac..858439b7 100644 --- a/src/english/ResEng.gf +++ b/src/english/ResEng.gf @@ -39,7 +39,7 @@ resource ResEng = ParamX ** open Prelude in { param Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl Gender ; - param + param Gender = Neutr | Masc | Fem ; @@ -48,7 +48,7 @@ resource ResEng = ParamX ** open Prelude in { -- Only these five forms are needed for open-lexicon verbs. param - VForm = + VForm = VInf | VPres | VPPart @@ -58,13 +58,13 @@ resource ResEng = ParamX ** open Prelude in { -- Auxiliary verbs have special negative forms. - VVForm = + VVForm = VVF VForm | VVPresNeg | 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"). -- Notice that inverted forms ($OQuest$) don't allow verb contractions: *"'s he arrived". @@ -83,7 +83,7 @@ param AForm = AAdj Degree Case | AAdv ; --2 For $Relative$ - + RAgr = RNoAg | RAg Agr ; RCase = RPrep Gender | RC Gender NPCase ; @@ -95,7 +95,7 @@ param --2 Transformations between parameter types oper - toAgr : Number -> Person -> Gender -> Agr = \n,p,g -> + toAgr : Number -> Person -> Gender -> Agr = \n,p,g -> case p of { P1 => AgP1 n ; P2 => AgP2 n ; @@ -116,8 +116,8 @@ param agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ; - conjAgr : Agr -> Agr -> Agr = \a0,b0 -> - let a = fromAgr a0 ; b = fromAgr b0 + conjAgr : Agr -> Agr -> Agr = \a0,b0 -> + let a = fromAgr a0 ; b = fromAgr b0 in toAgr (conjNumber a.n b.n) @@ -127,7 +127,7 @@ param -- 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 -> { s = table { Sg => table { @@ -152,7 +152,7 @@ param isPre = True } ; - mkVerb : (_,_,_,_,_ : Str) -> Verb = + mkVerb : (_,_,_,_,_ : Str) -> Verb = \go,goes,went,gone,going -> { s = table { VInf => go ; @@ -167,12 +167,12 @@ param 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 { - s = who.s ; + s = who.s ; n = n } ; - mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> - {s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g -> + mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> + {s : NPCase => Str ; a : Agr} = \i,me,my,n,p,g -> { s = table { NCase Nom => i ; NPAcc => me ; @@ -184,7 +184,7 @@ param regNP : Str -> Number -> {s : NPCase => Str ; a : Agr} = \that,n -> mkNP that that (that + "'s") n P3 Neutr ; - regGenitiveS : Str -> Case => Str = \s -> + regGenitiveS : Str -> Case => Str = \s -> table { Gen => genitiveS s; _ => s } ; genitiveS : Str -> Str = \dog -> @@ -199,7 +199,7 @@ param artIndef = pre { "eu" | "Eu" | "uni" | "up" => "a" ; - "un" => "an" ; + "un" => "an" ; "a" | "e" | "i" | "o" | "A" | "E" | "I" | "O" => "an" ; "SMS" | "sms" => "an" ; --- _ => "a" @@ -216,7 +216,7 @@ param } ; param - CPolarity = + CPolarity = CPos | CNeg Bool ; -- contracted or not @@ -227,13 +227,13 @@ param } ; VerbForms : Type = - Tense => Anteriority => CPolarity => Order => Agr => + Tense => Anteriority => CPolarity => Order => Agr => {aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept VP : Type = { s : VerbForms ; p : Str ; -- verb particle - prp : Str ; -- present participle + prp : Str ; -- present participle ptp : Str ; -- past participle inf : Str ; -- the infinitive form ; VerbForms would be the logical place 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. } ; - predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb -> + predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb -> predV verb ** {c2 = verb.c2 ; gapInMiddle = True; missingAdv = False} ; cBind : Str -> Str = \s -> Predef.BIND ++ ("'" + s) ; predV : Verb -> VP = \verb -> { - s = \\t,ant,b,ord,agr => + s = \\t,ant,b,ord,agr => let inf = verb.s ! VInf ; fin = presVerb verb agr ; @@ -303,8 +303,8 @@ param } ; predAux : Aux -> VP = \verb -> { - s = \\t,ant,cb,ord,agr => - let + s = \\t,ant,cb,ord,agr => + let b = case cb of { CPos => Pos ; _ => Neg @@ -321,7 +321,7 @@ param => vf (have agr) part ; --# notpresent => vfn c (haveContr agr) (haventContr agr) part ; --# notpresent => vfn c (have agr) (havent agr) part ; --# notpresent - + => vf (cBind "d") part ; --# notpresent => vf "had" part ; --# notpresent => vfn c (cBind "d") (cBind "d not") part ; --# notpresent @@ -349,7 +349,7 @@ param => vf fin [] ; => vfn c cfinp fin [] ; => vfn c finp fin [] - + } ; p = [] ; prp = verb.prpart ; @@ -360,14 +360,14 @@ param isSimple = True ; 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} ; 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} = - \contr,x,y,z -> + vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} = + \contr,x,y,z -> case contr of { True => {aux = y ; adv = [] ; fin = [] ; inf = z} ; False => {aux = x ; adv = "not" ; fin = [] ; inf = z} @@ -393,9 +393,9 @@ param 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 } ; - insertExtrac : Str -> SlashVP -> SlashVP = \obj,vp -> + insertExtrac : Str -> SlashVP -> SlashVP = \obj,vp -> insertExtra obj vp ** {c2 = vp.c2 ; gapInMiddle = vp.gapInMiddle ; missingAdv = vp.missingAdv } ; --- AR 7/3/2013 move the particle after the object @@ -408,7 +408,7 @@ param ad = vp.ad ; s2 = \\a => obj ! a ++ vp.s2 ! a ++ vp.p ; -- and put it here ; corresponds to insertObjPre isSimple = False ; - ext = vp.ext + ext = vp.ext } ; --- 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 } ; --- +-- predVV : {s : VVForm => Str ; p : Str ; typ : VVType} -> VP = \verb -> let verbs = verb.s @@ -462,14 +462,14 @@ param _ => 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) ; infVP : VVType -> VP -> Bool -> Anteriority -> CPolarity -> Agr -> Str = \typ,vp,ad_pos,ant,cb,a -> case cb of {CPos => ""; _ => "not"} ++ case ant 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" True => vp.ad ! a ++ "to" ++ vp.inf ; False => "to" ++ vp.ad ! a ++ vp.inf @@ -487,7 +487,7 @@ param } ++ vp.p ++ vp.s2 ! a ++ vp.ext ; - agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> + agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> case agr of { AgP3Sg _ => has ; _ => have @@ -502,20 +502,20 @@ param haventContr = agrVerb (cBind "s not") (cBind "ve not") ; Aux = { - pres : Polarity => Agr => Str ; - contr : Polarity => Agr => Str ; -- contracted forms + pres : Polarity => Agr => Str ; + contr : Polarity => Agr => Str ; -- contracted forms past : Polarity => Agr => Str ; --# notpresent inf,ppart,prpart : Str } ; auxBe : Aux = { pres = \\b,a => case of { - => "am" ; + => "am" ; => ["am not"] ; --- am not I _ => agrVerb (posneg b "is") (posneg b "are") a } ; contr = \\b,a => case of { - => cBind "m" ; + => cBind "m" ; => cBind "m not" ; --- am not I _ => agrVerb (posneg b (cBind "s")) (posneg b (cBind "re")) a } ; @@ -545,7 +545,7 @@ param AgP2 Pl => "yourselves" ; AgP3Pl _ => "themselves" } ; - + possPron : Agr => Str = table { AgP1 Sg => "my" ; AgP2 Sg => "your" ; @@ -565,8 +565,8 @@ param mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { - s = \\t,a,b,o => - let + s = \\t,a,b,o => + let verb = vp.s ! t ! a ! b ! o ! agr ; compl = vp.s2 ! agr ++ vp.ext in @@ -583,41 +583,41 @@ param _ => neg.s ! t ! a ! CPos ! o } } ; - + -- 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 -> {s = table { - unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ; - teen => \\c => mkCard c twelve ; + unit => table {NCard => regGenitiveS two ; NOrd => regGenitiveS second} ; + teen => \\c => mkCard c twelve ; 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) ; regCardOrd : Str -> {s : CardOrd => Case => Str} = \ten -> - {s = table {NCard => regGenitiveS ten ; + {s = table {NCard => regGenitiveS ten ; NOrd => regGenitiveS (regOrd ten)} } ; - mkCard : CardOrd -> Str -> Case => Str = \o,ten -> - (regCardOrd ten).s ! o ; + mkCard : CardOrd -> Str -> Case => Str = \o,ten -> + (regCardOrd ten).s ! o ; - regOrd : Str -> Str = \ten -> + regOrd : Str -> Str = \ten -> case last ten of { "y" => init ten + "ieth" ; _ => ten + "th" } ; - mkQuestion : - {s : Str} -> Clause -> + mkQuestion : + {s : Str} -> Clause -> {s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl -> { - s = \\t,a,p => - let + s = \\t,a,p => + let cls = cl.s ! t ! a ! p ; why = wh.s in table { diff --git a/src/english/SentenceEng.gf b/src/english/SentenceEng.gf index 70d649bd..1ef5f335 100644 --- a/src/english/SentenceEng.gf +++ b/src/english/SentenceEng.gf @@ -9,8 +9,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in { PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ; ImpVP vp = { - s = \\pol,n => - let + s = \\pol,n => + let agr = AgP2 (numImp n) ; verb = infVP VVAux vp False Simul CPos agr ; 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 } ; - SlashVP np vp = + SlashVP np vp = mkClause (np.s ! npNom) np.a vp ** {c2 = vp.c2} ; AdvSlash slash adv = { @@ -36,8 +36,8 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in { SlashPrep cl prep = cl ** {c2 = prep.s} ; - SlashVS np vs slash = - mkClause (np.s ! npNom) np.a + SlashVS np vs slash = + mkClause (np.s ! npNom) np.a (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** {c2 = slash.c2} ; diff --git a/src/english/StructuralEng.gf b/src/english/StructuralEng.gf index 97241b45..c77a90cf 100644 --- a/src/english/StructuralEng.gf +++ b/src/english/StructuralEng.gf @@ -1,4 +1,4 @@ -concrete StructuralEng of Structural = CatEng ** +concrete StructuralEng of Structural = CatEng ** open MorphoEng, ResEng, ParadigmsEng, MakeStructuralEng, Prelude in { flags optimize=all ; @@ -38,7 +38,7 @@ concrete StructuralEng of Structural = CatEng ** typ = VVAux } | { - s = table { + s = table { VVF VInf => ["be able to"] ; VVF VPres => "can" ; VVF VPPart => ["been able to"] ; diff --git a/src/english/SymbolEng.gf b/src/english/SymbolEng.gf index 6da69adf..a8f333f4 100644 --- a/src/english/SymbolEng.gf +++ b/src/english/SymbolEng.gf @@ -12,7 +12,7 @@ lin a = agrgP3 Sg cn.g } ; 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 } ; CNNumNP cn i = { @@ -20,12 +20,12 @@ lin a = agrgP3 Sg cn.g } ; - SymbS sy = sy ; + SymbS sy = sy ; SymbNum sy = { s,sp = \\_ => addGenitiveS sy.s ; n = Pl ; hasCard = True } ; SymbOrd sy = { s = \\c => sy.s ++ (regGenitiveS "th")!c} ; -lincat +lincat Symb, [Symb] = SS ; @@ -38,7 +38,7 @@ lin oper -- Note: this results in a space before 's, but there's -- not mauch we can do about that. - addGenitiveS : Str -> Case => Str = \s -> + addGenitiveS : Str -> Case => Str = \s -> table { Gen => s ++ BIND ++ "'s"; _ => s } ; } diff --git a/src/english/TerminologyEng.gf b/src/english/TerminologyEng.gf index 5a17c234..903c07f6 100644 --- a/src/english/TerminologyEng.gf +++ b/src/english/TerminologyEng.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common -concrete TerminologyEng of Terminology = CatEng ** open +concrete TerminologyEng of Terminology = CatEng ** open ResEng, ParadigmsEng, (G = GrammarEng), @@ -60,7 +60,7 @@ lin active_Parameter = mkN "active" ; passive_Parameter = mkN "passive" ; middle_Parameter = mkN "middle" ; - + imperative_Parameter = mkN "imperative" ; indicative_Parameter = mkN "indicative" ; conjunctive_Parameter = mkN "conjunctive" ; diff --git a/src/english/VerbEng.gf b/src/english/VerbEng.gf index cf397e8c..05f14057 100644 --- a/src/english/VerbEng.gf +++ b/src/english/VerbEng.gf @@ -6,13 +6,13 @@ concrete VerbEng of Verb = CatEng ** open ResEng, Prelude in { UseV = predV ; 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}) ; - Slash3V3 v np = + Slash3V3 v np = insertObjc (\\_ => v.c3 ++ np.s ! NPAcc) (predVc v) ; ---- 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) ; ComplVQ v q = insertExtra (q.s ! QIndir) (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 ; CompNP np = {s = \\_ => np.s ! NPAcc} ; 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 ; Pl => cn.s ! Pl ! Nom }