Added case parameter for stand-alone forms of determiners. I had to move mkPron from ResEng to MorphoEng, and mkQuant from StructuralEng to MorphoEng. I also removed the unused mkPronoun stuff from MorphoEng.

This commit is contained in:
bjorn
2008-10-30 14:09:27 +00:00
parent 61bddaba10
commit 29c63ae172
7 changed files with 50 additions and 60 deletions

View File

@@ -50,12 +50,12 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
CN = {s : Number => Case => Str ; g : Gender} ;
NP = {s : Case => Str ; a : Agr} ;
Pron = {s : Case => Str ; sp : Str ; a : Agr} ;
Det = {s,sp : Str ; n : Number} ;
Pron = {s : Case => Str ; sp : Case => Str ; a : Agr} ;
Det = {s : Str ; sp : Case => Str ; n : Number} ;
Predet, Ord = {s : Str} ;
Num = {s : Str ; n : Number ; hasCard : Bool} ;
Card = {s : Str ; n : Number} ;
Quant = {s,sp : Bool => Number => Str} ;
Quant = {s : Bool => Number => Str ; sp : Bool => Number => Case => Str} ;
-- Numeral

View File

@@ -2,7 +2,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
open ResEng, Coordination, Prelude in {
lin
GenNP np = {s,sp = \\_,_ => np.s ! Gen} ;
GenNP np = {s = \\_,_ => np.s ! Gen ; sp = \\_,_,_ => np.s ! Gen} ;
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
StrandRelSlash rp slash = {

View File

@@ -46,37 +46,40 @@ oper
--2 Determiners
mkDeterminer : Number -> Str -> {s,sp : Str ; n : Number} = \n,s ->
{s,sp = s ; n = n} ;
mkDeterminer : Number -> Str -> {s : Str ; sp : Case => Str; n : Number} = \n,s ->
{s = s;
sp = regGenitiveS s ;
n = n} ;
--2 Pronouns
--
-- Here we define personal pronouns.
--
-- We record the form "mine" and the gender for later use.
Pronoun : Type =
{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 = toAgr n p g
mkQuant : Str -> Str -> {s : Bool => Number => Str; sp : Bool => Number => Case => Str } = \x,y -> {
s = \\_ => table { Sg => x ; Pl => y } ;
sp = \\_ => table { Sg => regGenitiveS x ; Pl => regGenitiveS y }
} ;
human : Gender = Masc ; --- doesn't matter
regGenitiveS : Str -> Case => Str = \s ->
table { Gen => genitiveS s; _ => s } ;
pronI = mkPronoun "I" "me" "my" "mine" Sg P1 human ;
pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb agr OK
pronHe = mkPronoun "he" "him" "his" "his" Sg P3 Masc ;
pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 Fem ;
pronIt = mkPronoun "it" "it" "its" "it" Sg P3 Neutr ;
genitiveS : Str -> Str = \dog ->
case last dog of {
"s" => dog + "'" ;
_ => dog + "'s"
};
pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 human ;
pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ;
pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; ---
--2 Pronouns
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
{s : Case => Str ; sp : Case => Str ; a : Agr} =
\i,me,my,mine,n,p,g -> {
s = table {
Nom => i ;
Acc => me ;
Gen => my
} ;
a = toAgr n p g ;
sp = regGenitiveS mine
} ;
--2 Adjectives
--
-- To form the adjectival and the adverbial forms, two strings are needed

View File

@@ -1,4 +1,4 @@
concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
flags optimize=all_subs ;
@@ -33,18 +33,18 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
DetQuant quant num = {
s = quant.s ! num.hasCard ! num.n ++ num.s ;
sp = quant.sp ! num.hasCard ! num.n ++ num.s ;
sp = \\c => quant.sp ! num.hasCard ! num.n ! c ++ num.s ;
n = num.n
} ;
DetQuantOrd quant num ord = {
s = quant.s ! num.hasCard ! num.n ++ num.s ++ ord.s ;
sp = quant.sp ! num.hasCard ! num.n ++ num.s ++ ord.s ;
sp = \\c => quant.sp ! num.hasCard ! num.n ! c ++ num.s ++ ord.s ;
n = num.n
} ;
DetNP det = {
s = \\c => det.sp ; ---- case
s = det.sp ;
a = agrP3 det.n
} ;
@@ -70,23 +70,23 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
OrdSuperl a = {s = a.s ! AAdj Superl} ;
DefArt = {
s = \\c,n => artDef ;
sp = \\c,n => case <n,c> of {
<Sg,False> => "it" ;
<Pl,False> => "they" ;
_ => artDef
s = \\hasCard,n => artDef ;
sp = \\hasCard,n => case <n,hasCard> of {
<Sg,False> => table { Gen => "its"; _ => "it" } ;
<Pl,False> => table { Nom => "they"; Acc => "them"; Gen => "theirs" } ;
_ => \\c => artDef
}
} ;
IndefArt = {
s = \\c,n => case <n,c> of {
s = \\hasCard,n => case <n,hasCard> of {
<Sg,False> => artIndef ;
_ => []
_ => []
} ;
sp = \\c,n => case <n,c> of {
<Sg,False> => "one" ;
<Pl,False> => "ones" ;
_ => []
sp = \\hasCard,n => case <n,hasCard> of {
<Sg,False> => table { Gen => "one's"; _ => "one" };
<Pl,False> => table { Gen => "ones'"; _ => "ones" } ;
_ => \\c => []
}
} ;

View File

@@ -342,7 +342,6 @@ oper
mkPN : N -> PN = nounPN
} ;
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
regN2 n = mkN2 (regN n) (mkPrep "of") ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;

View File

@@ -148,21 +148,15 @@ resource ResEng = ParamX ** open Prelude in {
n = n
} ;
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
{s : Case => Str ; sp : Str ; a : Agr} =
\i,me,my,mine,n,p,g -> {
s = table {
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 ;
Gen => my
} ;
a = toAgr n p g ;
sp = mine
} ;
mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
{s : Case => Str ; a : Agr} =
\i,me,my,n,p,g -> mkPron i me my me n p g ;
};
-- These functions cover many cases; full coverage inflectional patterns are
-- in $MorphoEng$.

View File

@@ -121,11 +121,5 @@ concrete StructuralEng of Structural = CatEng **
youPl_Pron = mkPron "you" "you" "your" "yours" Pl P2 Masc ;
youPol_Pron = mkPron "you" "you" "your" "yours" Sg P2 Masc ;
oper
mkQuant : Str -> Str -> {s,sp : Bool => Number => Str} = \x,y -> {
s,sp = \\_ => table Number [x ; y]
} ;
}