1
0
forked from GitHub/gf-core

Gender in English Agr

This commit is contained in:
aarne
2008-04-21 15:56:50 +00:00
parent 65f8120498
commit 7e29773e50
11 changed files with 68 additions and 40 deletions

View File

@@ -22,10 +22,11 @@ abstract Noun = Cat ** {
PredetNP : Predet -> NP -> NP; -- only the man PredetNP : Predet -> NP -> NP; -- only the man
-- A noun phrase can also be postmodified by the past participle of a -- 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 PPartNP : NP -> V2 -> NP ; -- the number squared
AdvNP : NP -> Adv -> NP ; -- Paris at midnight AdvNP : NP -> Adv -> NP ; -- Paris at midnight
RelNP : NP -> RS -> NP ; -- Paris, which is in Europe
--2 Determiners --2 Determiners

View File

@@ -29,7 +29,10 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
-- Relative -- 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} ; RP = {s : RCase => Str ; a : RAgr} ;
-- Verb -- Verb
@@ -48,7 +51,7 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
NP, Pron = {s : Case => Str ; a : Agr} ; NP, Pron = {s : Case => Str ; a : Agr} ;
Det = {s : Str ; n : Number} ; Det = {s : Str ; n : Number} ;
Predet, Ord = {s : Str} ; Predet, Ord = {s : Str} ;
Num = {s : Str; n : Number } ; Num = {s : Str; n : Number} ;
Quant, Art = {s : Number => Str} ; Quant, Art = {s : Number => Str} ;
-- Numeral -- Numeral

View File

@@ -12,10 +12,10 @@ concrete ConjunctionEng of Conjunction =
DConjAdv = conjunctDistrSS ; DConjAdv = conjunctDistrSS ;
ConjNP conj ss = conjunctTable Case conj ss ** { 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 ** { 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 ** { ConjAP conj ss = conjunctTable Agr conj ss ** {

View File

@@ -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) ; 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}} ;
} }

View File

@@ -72,13 +72,12 @@ oper
-- We record the form "mine" and the gender for later use. -- We record the form "mine" and the gender for later use.
Pronoun : Type = Pronoun : Type =
{s : Case => Str ; a : Agr ; g : Gender} ; {s : Case => Str ; a : Agr} ;
mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun = mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun =
\I,me,my,mine,n,p,g -> \I,me,my,mine,n,p,g ->
{s = table {Nom => I ; Acc => me ; Gen => my} ; {s = table {Nom => I ; Acc => me ; Gen => my} ;
a = {n = n ; p = p} ; a = {n = n ; p = p ; g = g}
g = g
} ; } ;
human : Gender = Masc ; --- doesn't matter human : Gender = Masc ; --- doesn't matter

View File

@@ -21,6 +21,11 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
a = np.a a = np.a
} ; } ;
RelNP np rs = {
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
a = np.a
} ;
AdvNP np adv = { AdvNP np adv = {
s = \\c => np.s ! c ++ adv.s ; s = \\c => np.s ! c ++ adv.s ;
a = np.a a = np.a
@@ -98,7 +103,9 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
AdjCN ap cn = { AdjCN ap cn = {
s = \\n,c => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n ! c) 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} ; AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ; SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;

View File

@@ -14,7 +14,7 @@ concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
} ; } ;
QuestVP qp vp = 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} ; in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
QuestSlash ip slash = QuestSlash ip slash =

View File

@@ -16,7 +16,7 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
RNoAg => ag ; RNoAg => ag ;
RAg a => a RAg a => a
} ; } ;
cl = mkClause (rp.s ! RC Nom) agr vp cl = mkClause (rp.s ! RC agr.g Nom) agr vp
in in
cl.s ! t ! ant ! b ! ODir ; cl.s ! t ! ant ! b ! ODir ;
c = Nom c = Nom
@@ -27,20 +27,26 @@ concrete RelativeEng of Relative = CatEng ** open ResEng in {
-- "we are looking at"). -- "we are looking at").
RelSlash rp slash = { 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 c = Acc
} ; } ;
FunRP p np rp = { 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 a = RAg np.a
} ; } ;
IdRP = { IdRP =
let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc
in {
s = table { s = table {
RC Gen => "whose" ; RC _ Gen => "whose" ;
RC _ => "that" ; RC Neutr _ => varr "which" ;
RPrep => "which" RC _ Acc => varr "whom" ;
RC _ Nom => varr "who" ;
RPrep Neutr => "which" ;
RPrep _ => "whom"
} ; } ;
a = RNoAg a = RNoAg
} ; } ;

View File

@@ -21,10 +21,11 @@ resource ResEng = ParamX ** open Prelude in {
param param
Case = Nom | Acc | Gen ; 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 oper
Agr = {n : Number ; p : Person} ; Agr = {n : Number ; p : Person ; g : Gender} ;
param param
Gender = Neutr | Masc | Fem ; Gender = Neutr | Masc | Fem ;
@@ -61,8 +62,8 @@ resource ResEng = ParamX ** open Prelude in {
--2 For $Relative$ --2 For $Relative$
RAgr = RNoAg | RAg {n : Number ; p : Person} ; RAgr = RNoAg | RAg {n : Number ; p : Person ; g : Gender} ;
RCase = RPrep | RC Case ; RCase = RPrep Gender | RC Gender Case ;
--2 For $Numeral$ --2 For $Numeral$
@@ -73,11 +74,15 @@ resource ResEng = ParamX ** open Prelude in {
oper oper
agrP3 : Number -> Agr = \n -> 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 -> { conjAgr : Agr -> Agr -> Agr = \a,b -> {
n = conjNumber a.n b.n ; n = conjNumber a.n b.n ;
p = conjPerson a.p b.p p = conjPerson a.p b.p ;
g = a.g ----
} ; } ;
-- For $Lex$. -- For $Lex$.
@@ -121,10 +126,14 @@ resource ResEng = ParamX ** open Prelude in {
} ; } ;
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} = 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} = mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
\i,me,my,n,p -> { {s : Case => Str ; a : Agr} =
\i,me,my,n,p,g -> {
s = table { s = table {
Nom => i ; Nom => i ;
Acc => me ; Acc => me ;
@@ -132,7 +141,8 @@ resource ResEng = ParamX ** open Prelude in {
} ; } ;
a = { a = {
n = n ; 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") ; mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ;
regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n -> 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. -- We have just a heuristic definition of the indefinite article.
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic -- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
@@ -380,7 +390,9 @@ resource ResEng = ParamX ** open Prelude in {
reflPron : Agr => Str = table { reflPron : Agr => Str = table {
{n = Sg ; p = P1} => "myself" ; {n = Sg ; p = P1} => "myself" ;
{n = Sg ; p = P2} => "yourself" ; {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 = P1} => "ourselves" ;
{n = Pl ; p = P2} => "yourselves" ; {n = Pl ; p = P2} => "yourselves" ;
{n = Pl ; p = P3} => "themselves" {n = Pl ; p = P3} => "themselves"

View File

@@ -11,7 +11,7 @@ concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
ImpVP vp = { ImpVP vp = {
s = \\pol,n => s = \\pol,n =>
let let
agr = {n = numImp n ; p = P2} ; agr = {n = numImp n ; p = P2 ; g = Masc} ;
verb = infVP True vp agr ; verb = infVP True vp agr ;
dont = case pol of { dont = case pol of {
CNeg True => "don't" ; CNeg True => "don't" ;

View File

@@ -41,7 +41,7 @@ concrete StructuralEng of Structural = CatEng **
--- first_Ord = ss "first" ; DEPRECATED --- first_Ord = ss "first" ; DEPRECATED
for_Prep = ss "for" ; for_Prep = ss "for" ;
from_Prep = ss "from" ; 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" ; here_Adv = ss "here" ;
here7to_Adv = ss ["to here"] ; here7to_Adv = ss ["to here"] ;
here7from_Adv = ss ["from here"] ; here7from_Adv = ss ["from here"] ;
@@ -49,9 +49,9 @@ concrete StructuralEng of Structural = CatEng **
how8many_IDet = mkDeterminer Pl ["how many"] ; how8many_IDet = mkDeterminer Pl ["how many"] ;
if_Subj = ss "if" ; if_Subj = ss "if" ;
in8front_Prep = ss ["in front of"] ; 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" ; 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" ; less_CAdv = ss "less" ;
many_Det = mkDeterminer Pl "many" ; many_Det = mkDeterminer Pl "many" ;
more_CAdv = ss "more" ; more_CAdv = ss "more" ;
@@ -79,7 +79,7 @@ concrete StructuralEng of Structural = CatEng **
please_Voc = ss "please" ; please_Voc = ss "please" ;
possess_Prep = ss "of" ; possess_Prep = ss "of" ;
quite_Adv = ss "quite" ; 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" ; so_AdA = ss "so" ;
somebody_NP = regNP "somebody" Sg ; somebody_NP = regNP "somebody" Sg ;
someSg_Det = mkDeterminer Sg "some" ; someSg_Det = mkDeterminer Sg "some" ;
@@ -91,7 +91,7 @@ concrete StructuralEng of Structural = CatEng **
there7to_Adv = ss "there" ; there7to_Adv = ss "there" ;
there7from_Adv = ss ["from there"] ; there7from_Adv = ss ["from there"] ;
therefore_PConj = ss "therefore" ; 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" ; this_Quant = mkQuant "this" "these" ;
through_Prep = ss "through" ; through_Prep = ss "through" ;
too_AdA = ss "too" ; too_AdA = ss "too" ;
@@ -99,7 +99,7 @@ concrete StructuralEng of Structural = CatEng **
under_Prep = ss "under" ; under_Prep = ss "under" ;
very_AdA = ss "very" ; very_AdA = ss "very" ;
want_VV = P.mkVV (P.regV "want") ; 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 ; whatPl_IP = mkIP "what" "what" "what's" Sg ;
whatSg_IP = mkIP "what" "what" "what's" Sg ; whatSg_IP = mkIP "what" "what" "what's" Sg ;
when_IAdv = ss "when" ; when_IAdv = ss "when" ;
@@ -113,9 +113,9 @@ concrete StructuralEng of Structural = CatEng **
without_Prep = ss "without" ; without_Prep = ss "without" ;
with_Prep = ss "with" ; with_Prep = ss "with" ;
yes_Phr = ss "yes" ; yes_Phr = ss "yes" ;
youSg_Pron = mkNP "you" "you" "your" Sg P2 ; youSg_Pron = mkNP "you" "you" "your" Sg P2 Masc ;
youPl_Pron = mkNP "you" "you" "your" Pl P2 ; youPl_Pron = mkNP "you" "you" "your" Pl P2 Masc ;
youPol_Pron = mkNP "you" "you" "your" Sg P2 ; youPol_Pron = mkNP "you" "you" "your" Sg P2 Masc ;
oper oper