forked from GitHub/gf-core
Gender in English Agr
This commit is contained in:
@@ -22,10 +22,11 @@ abstract Noun = Cat ** {
|
||||
PredetNP : Predet -> NP -> NP; -- only the man
|
||||
|
||||
-- A noun phrase can also be postmodified by the past participle of a
|
||||
-- verb or by an adverb.
|
||||
-- verb, by an adverb, or by a relative clause
|
||||
|
||||
PPartNP : NP -> V2 -> NP ; -- the number squared
|
||||
AdvNP : NP -> Adv -> NP ; -- Paris at midnight
|
||||
RelNP : NP -> RS -> NP ; -- Paris, which is in Europe
|
||||
|
||||
--2 Determiners
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
|
||||
-- Relative
|
||||
|
||||
RCl = {s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; c : Case} ;
|
||||
RCl = {
|
||||
s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ;
|
||||
c : Case
|
||||
} ;
|
||||
RP = {s : RCase => Str ; a : RAgr} ;
|
||||
|
||||
-- Verb
|
||||
@@ -48,7 +51,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
NP, Pron = {s : Case => Str ; a : Agr} ;
|
||||
Det = {s : Str ; n : Number} ;
|
||||
Predet, Ord = {s : Str} ;
|
||||
Num = {s : Str; n : Number } ;
|
||||
Num = {s : Str; n : Number} ;
|
||||
Quant, Art = {s : Number => Str} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
@@ -12,10 +12,10 @@ concrete ConjunctionEng of Conjunction =
|
||||
DConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p ; g = ss.a.g}
|
||||
} ;
|
||||
DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p ; g = ss.a.g}
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctTable Agr conj ss ** {
|
||||
|
||||
@@ -24,7 +24,7 @@ concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
|
||||
ImpPl1 vp = {s = "let's" ++ infVP True vp {n = Pl ; p = P1}} ;
|
||||
ImpPl1 vp = {s = "let's" ++ infVP True vp {n = Pl ; p = P1 ; g = Neutr}} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +72,12 @@ oper
|
||||
-- We record the form "mine" and the gender for later use.
|
||||
|
||||
Pronoun : Type =
|
||||
{s : Case => Str ; a : Agr ; g : Gender} ;
|
||||
{s : Case => Str ; a : Agr} ;
|
||||
|
||||
mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun =
|
||||
\I,me,my,mine,n,p,g ->
|
||||
{s = table {Nom => I ; Acc => me ; Gen => my} ;
|
||||
a = {n = n ; p = p} ;
|
||||
g = g
|
||||
a = {n = n ; p = p ; g = g}
|
||||
} ;
|
||||
|
||||
human : Gender = Masc ; --- doesn't matter
|
||||
|
||||
@@ -21,6 +21,11 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
RelNP np rs = {
|
||||
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
AdvNP np adv = {
|
||||
s = \\c => np.s ! c ++ adv.s ;
|
||||
a = np.a
|
||||
@@ -98,7 +103,9 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
||||
AdjCN ap cn = {
|
||||
s = \\n,c => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n ! c)
|
||||
} ;
|
||||
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||
RelCN cn rs = {
|
||||
s = \\n,c => cn.s ! n ! c ++ rs.s ! agrP3 n ---- g
|
||||
} ;
|
||||
AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
|
||||
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
|
||||
@@ -14,7 +14,7 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
||||
} ;
|
||||
|
||||
QuestVP qp vp =
|
||||
let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
|
||||
let cl = mkClause (qp.s ! Nom) (agrP3 qp.n) vp
|
||||
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
|
||||
|
||||
QuestSlash ip slash =
|
||||
|
||||
@@ -16,7 +16,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
||||
RNoAg => ag ;
|
||||
RAg a => a
|
||||
} ;
|
||||
cl = mkClause (rp.s ! RC Nom) agr vp
|
||||
cl = mkClause (rp.s ! RC agr.g Nom) agr vp
|
||||
in
|
||||
cl.s ! t ! ant ! b ! ODir ;
|
||||
c = Nom
|
||||
@@ -27,20 +27,26 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
||||
-- "we are looking at").
|
||||
|
||||
RelSlash rp slash = {
|
||||
s = \\t,a,p,_ => slash.c2 ++ rp.s ! RPrep ++ slash.s ! t ! a ! p ! ODir ;
|
||||
s = \\t,a,p,agr =>
|
||||
slash.c2 ++ rp.s ! RPrep agr.g ++ slash.s ! t ! a ! p ! ODir ;
|
||||
c = Acc
|
||||
} ;
|
||||
|
||||
FunRP p np rp = {
|
||||
s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep ;
|
||||
s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep np.a.g ;
|
||||
a = RAg np.a
|
||||
} ;
|
||||
|
||||
IdRP = {
|
||||
IdRP =
|
||||
let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc
|
||||
in {
|
||||
s = table {
|
||||
RC Gen => "whose" ;
|
||||
RC _ => "that" ;
|
||||
RPrep => "which"
|
||||
RC _ Gen => "whose" ;
|
||||
RC Neutr _ => varr "which" ;
|
||||
RC _ Acc => varr "whom" ;
|
||||
RC _ Nom => varr "who" ;
|
||||
RPrep Neutr => "which" ;
|
||||
RPrep _ => "whom"
|
||||
} ;
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
@@ -21,10 +21,11 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
param
|
||||
Case = Nom | Acc | Gen ;
|
||||
|
||||
-- Agreement of $NP$ is a record. We'll add $Gender$ later.
|
||||
-- Agreement of $NP$ is a record. $Gender$ is needed for "who"/"which" and
|
||||
-- for "himself"/"herself"/"itself".
|
||||
|
||||
oper
|
||||
Agr = {n : Number ; p : Person} ;
|
||||
Agr = {n : Number ; p : Person ; g : Gender} ;
|
||||
|
||||
param
|
||||
Gender = Neutr | Masc | Fem ;
|
||||
@@ -61,8 +62,8 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
||||
RCase = RPrep | RC Case ;
|
||||
RAgr = RNoAg | RAg {n : Number ; p : Person ; g : Gender} ;
|
||||
RCase = RPrep Gender | RC Gender Case ;
|
||||
|
||||
--2 For $Numeral$
|
||||
|
||||
@@ -73,11 +74,15 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
oper
|
||||
agrP3 : Number -> Agr = \n ->
|
||||
{n = n ; p = P3} ;
|
||||
{n = n ; p = P3 ; g = Neutr} ;
|
||||
|
||||
agrgP3 : Number -> Gender -> Agr = \n,g ->
|
||||
{n = n ; p = P3 ; g = g} ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
||||
n = conjNumber a.n b.n ;
|
||||
p = conjPerson a.p b.p
|
||||
p = conjPerson a.p b.p ;
|
||||
g = a.g ----
|
||||
} ;
|
||||
|
||||
-- For $Lex$.
|
||||
@@ -121,10 +126,14 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
} ;
|
||||
|
||||
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||
\i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
|
||||
\i,me,my,n -> let who = mkNP i me my n P3 Neutr in {
|
||||
s = who.s ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} =
|
||||
\i,me,my,n,p -> {
|
||||
mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
|
||||
{s : Case => Str ; a : Agr} =
|
||||
\i,me,my,n,p,g -> {
|
||||
s = table {
|
||||
Nom => i ;
|
||||
Acc => me ;
|
||||
@@ -132,7 +141,8 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
} ;
|
||||
a = {
|
||||
n = n ;
|
||||
p = p
|
||||
p = p ;
|
||||
g = g
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -149,7 +159,7 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ;
|
||||
|
||||
regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n ->
|
||||
mkNP that that (that + "'s") n P3 ;
|
||||
mkNP that that (that + "'s") n P3 Neutr ;
|
||||
|
||||
-- We have just a heuristic definition of the indefinite article.
|
||||
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
|
||||
@@ -380,7 +390,9 @@ resource ResEng = ParamX ** open Prelude in {
|
||||
reflPron : Agr => Str = table {
|
||||
{n = Sg ; p = P1} => "myself" ;
|
||||
{n = Sg ; p = P2} => "yourself" ;
|
||||
{n = Sg ; p = P3} => "itself" ; ----
|
||||
{n = Sg ; p = P3 ; g = Masc} => "himself" ;
|
||||
{n = Sg ; p = P3 ; g = Fem} => "herself" ;
|
||||
{n = Sg ; p = P3} => "itself" ;
|
||||
{n = Pl ; p = P1} => "ourselves" ;
|
||||
{n = Pl ; p = P2} => "yourselves" ;
|
||||
{n = Pl ; p = P3} => "themselves"
|
||||
|
||||
@@ -11,7 +11,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
||||
ImpVP vp = {
|
||||
s = \\pol,n =>
|
||||
let
|
||||
agr = {n = numImp n ; p = P2} ;
|
||||
agr = {n = numImp n ; p = P2 ; g = Masc} ;
|
||||
verb = infVP True vp agr ;
|
||||
dont = case pol of {
|
||||
CNeg True => "don't" ;
|
||||
|
||||
@@ -41,7 +41,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
--- first_Ord = ss "first" ; DEPRECATED
|
||||
for_Prep = ss "for" ;
|
||||
from_Prep = ss "from" ;
|
||||
he_Pron = mkNP "he" "him" "his" Sg P3 ;
|
||||
he_Pron = mkNP "he" "him" "his" Sg P3 Masc ;
|
||||
here_Adv = ss "here" ;
|
||||
here7to_Adv = ss ["to here"] ;
|
||||
here7from_Adv = ss ["from here"] ;
|
||||
@@ -49,9 +49,9 @@ concrete StructuralEng of Structural = CatEng **
|
||||
how8many_IDet = mkDeterminer Pl ["how many"] ;
|
||||
if_Subj = ss "if" ;
|
||||
in8front_Prep = ss ["in front of"] ;
|
||||
i_Pron = mkNP "I" "me" "my" Sg P1 ;
|
||||
i_Pron = mkNP "I" "me" "my" Sg P1 Masc ;
|
||||
in_Prep = ss "in" ;
|
||||
it_Pron = mkNP "it" "it" "its" Sg P3 ;
|
||||
it_Pron = mkNP "it" "it" "its" Sg P3 Neutr ;
|
||||
less_CAdv = ss "less" ;
|
||||
many_Det = mkDeterminer Pl "many" ;
|
||||
more_CAdv = ss "more" ;
|
||||
@@ -79,7 +79,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
please_Voc = ss "please" ;
|
||||
possess_Prep = ss "of" ;
|
||||
quite_Adv = ss "quite" ;
|
||||
she_Pron = mkNP "she" "her" "her" Sg P3 ;
|
||||
she_Pron = mkNP "she" "her" "her" Sg P3 Fem ;
|
||||
so_AdA = ss "so" ;
|
||||
somebody_NP = regNP "somebody" Sg ;
|
||||
someSg_Det = mkDeterminer Sg "some" ;
|
||||
@@ -91,7 +91,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
there7to_Adv = ss "there" ;
|
||||
there7from_Adv = ss ["from there"] ;
|
||||
therefore_PConj = ss "therefore" ;
|
||||
they_Pron = mkNP "they" "them" "their" Pl P3 ;
|
||||
they_Pron = mkNP "they" "them" "their" Pl P3 Masc ; ----
|
||||
this_Quant = mkQuant "this" "these" ;
|
||||
through_Prep = ss "through" ;
|
||||
too_AdA = ss "too" ;
|
||||
@@ -99,7 +99,7 @@ concrete StructuralEng of Structural = CatEng **
|
||||
under_Prep = ss "under" ;
|
||||
very_AdA = ss "very" ;
|
||||
want_VV = P.mkVV (P.regV "want") ;
|
||||
we_Pron = mkNP "we" "us" "our" Pl P1 ;
|
||||
we_Pron = mkNP "we" "us" "our" Pl P1 Masc ;
|
||||
whatPl_IP = mkIP "what" "what" "what's" Sg ;
|
||||
whatSg_IP = mkIP "what" "what" "what's" Sg ;
|
||||
when_IAdv = ss "when" ;
|
||||
@@ -113,9 +113,9 @@ concrete StructuralEng of Structural = CatEng **
|
||||
without_Prep = ss "without" ;
|
||||
with_Prep = ss "with" ;
|
||||
yes_Phr = ss "yes" ;
|
||||
youSg_Pron = mkNP "you" "you" "your" Sg P2 ;
|
||||
youPl_Pron = mkNP "you" "you" "your" Pl P2 ;
|
||||
youPol_Pron = mkNP "you" "you" "your" Sg P2 ;
|
||||
youSg_Pron = mkNP "you" "you" "your" Sg P2 Masc ;
|
||||
youPl_Pron = mkNP "you" "you" "your" Pl P2 Masc ;
|
||||
youPol_Pron = mkNP "you" "you" "your" Sg P2 Masc ;
|
||||
|
||||
|
||||
oper
|
||||
|
||||
Reference in New Issue
Block a user