mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
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:
@@ -50,12 +50,12 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
CN = {s : Number => Case => Str ; g : Gender} ;
|
CN = {s : Number => Case => Str ; g : Gender} ;
|
||||||
NP = {s : Case => Str ; a : Agr} ;
|
NP = {s : Case => Str ; a : Agr} ;
|
||||||
Pron = {s : Case => Str ; sp : Str ; a : Agr} ;
|
Pron = {s : Case => Str ; sp : Case => Str ; a : Agr} ;
|
||||||
Det = {s,sp : Str ; n : Number} ;
|
Det = {s : Str ; sp : Case => Str ; n : Number} ;
|
||||||
Predet, Ord = {s : Str} ;
|
Predet, Ord = {s : Str} ;
|
||||||
Num = {s : Str ; n : Number ; hasCard : Bool} ;
|
Num = {s : Str ; n : Number ; hasCard : Bool} ;
|
||||||
Card = {s : Str ; n : Number} ;
|
Card = {s : Str ; n : Number} ;
|
||||||
Quant = {s,sp : Bool => Number => Str} ;
|
Quant = {s : Bool => Number => Str ; sp : Bool => Number => Case => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ concrete ExtraEng of ExtraEngAbs = CatEng **
|
|||||||
open ResEng, Coordination, Prelude in {
|
open ResEng, Coordination, Prelude in {
|
||||||
|
|
||||||
lin
|
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) ;
|
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
||||||
|
|
||||||
StrandRelSlash rp slash = {
|
StrandRelSlash rp slash = {
|
||||||
|
|||||||
@@ -46,37 +46,40 @@ oper
|
|||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
|
|
||||||
mkDeterminer : Number -> Str -> {s,sp : Str ; n : Number} = \n,s ->
|
mkDeterminer : Number -> Str -> {s : Str ; sp : Case => Str; n : Number} = \n,s ->
|
||||||
{s,sp = s ; n = n} ;
|
{s = s;
|
||||||
|
sp = regGenitiveS s ;
|
||||||
|
n = n} ;
|
||||||
|
|
||||||
--2 Pronouns
|
mkQuant : Str -> Str -> {s : Bool => Number => Str; sp : Bool => Number => Case => Str } = \x,y -> {
|
||||||
--
|
s = \\_ => table { Sg => x ; Pl => y } ;
|
||||||
-- Here we define personal pronouns.
|
sp = \\_ => table { Sg => regGenitiveS x ; Pl => regGenitiveS y }
|
||||||
--
|
|
||||||
-- 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
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
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 ;
|
genitiveS : Str -> Str = \dog ->
|
||||||
pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb agr OK
|
case last dog of {
|
||||||
pronHe = mkPronoun "he" "him" "his" "his" Sg P3 Masc ;
|
"s" => dog + "'" ;
|
||||||
pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 Fem ;
|
_ => dog + "'s"
|
||||||
pronIt = mkPronoun "it" "it" "its" "it" Sg P3 Neutr ;
|
};
|
||||||
|
|
||||||
pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 human ;
|
--2 Pronouns
|
||||||
pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ;
|
|
||||||
pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; ---
|
|
||||||
|
|
||||||
|
|
||||||
|
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
|
--2 Adjectives
|
||||||
--
|
--
|
||||||
-- To form the adjectival and the adverbial forms, two strings are needed
|
-- To form the adjectival and the adverbial forms, two strings are needed
|
||||||
|
|||||||
@@ -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 ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
@@ -33,18 +33,18 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
|
|
||||||
DetQuant quant num = {
|
DetQuant quant num = {
|
||||||
s = quant.s ! num.hasCard ! num.n ++ num.s ;
|
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
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuantOrd quant num ord = {
|
DetQuantOrd quant num ord = {
|
||||||
s = quant.s ! num.hasCard ! num.n ++ num.s ++ ord.s ;
|
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
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetNP det = {
|
DetNP det = {
|
||||||
s = \\c => det.sp ; ---- case
|
s = det.sp ;
|
||||||
a = agrP3 det.n
|
a = agrP3 det.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -70,23 +70,23 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||||
|
|
||||||
DefArt = {
|
DefArt = {
|
||||||
s = \\c,n => artDef ;
|
s = \\hasCard,n => artDef ;
|
||||||
sp = \\c,n => case <n,c> of {
|
sp = \\hasCard,n => case <n,hasCard> of {
|
||||||
<Sg,False> => "it" ;
|
<Sg,False> => table { Gen => "its"; _ => "it" } ;
|
||||||
<Pl,False> => "they" ;
|
<Pl,False> => table { Nom => "they"; Acc => "them"; Gen => "theirs" } ;
|
||||||
_ => artDef
|
_ => \\c => artDef
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
IndefArt = {
|
IndefArt = {
|
||||||
s = \\c,n => case <n,c> of {
|
s = \\hasCard,n => case <n,hasCard> of {
|
||||||
<Sg,False> => artIndef ;
|
<Sg,False> => artIndef ;
|
||||||
_ => []
|
_ => []
|
||||||
} ;
|
} ;
|
||||||
sp = \\c,n => case <n,c> of {
|
sp = \\hasCard,n => case <n,hasCard> of {
|
||||||
<Sg,False> => "one" ;
|
<Sg,False> => table { Gen => "one's"; _ => "one" };
|
||||||
<Pl,False> => "ones" ;
|
<Pl,False> => table { Gen => "ones'"; _ => "ones" } ;
|
||||||
_ => []
|
_ => \\c => []
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -342,7 +342,6 @@ oper
|
|||||||
mkPN : N -> PN = nounPN
|
mkPN : N -> PN = nounPN
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||||
regN2 n = mkN2 (regN n) (mkPrep "of") ;
|
regN2 n = mkN2 (regN n) (mkPrep "of") ;
|
||||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||||
|
|||||||
@@ -148,21 +148,15 @@ resource ResEng = ParamX ** open Prelude in {
|
|||||||
n = n
|
n = n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender ->
|
mkNP : (i,me,my : Str) -> Number -> Person -> Gender ->
|
||||||
{s : Case => Str ; sp : Str ; a : Agr} =
|
{s : Case => Str ; a : Agr} = \i,me,my,n,p,g ->
|
||||||
\i,me,my,mine,n,p,g -> {
|
{ s = table {
|
||||||
s = table {
|
|
||||||
Nom => i ;
|
Nom => i ;
|
||||||
Acc => me ;
|
Acc => me ;
|
||||||
Gen => my
|
Gen => my
|
||||||
} ;
|
} ;
|
||||||
a = toAgr n p g ;
|
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
|
-- These functions cover many cases; full coverage inflectional patterns are
|
||||||
-- in $MorphoEng$.
|
-- in $MorphoEng$.
|
||||||
|
|||||||
@@ -121,11 +121,5 @@ concrete StructuralEng of Structural = CatEng **
|
|||||||
youPl_Pron = mkPron "you" "you" "your" "yours" Pl P2 Masc ;
|
youPl_Pron = mkPron "you" "you" "your" "yours" Pl P2 Masc ;
|
||||||
youPol_Pron = mkPron "you" "you" "your" "yours" Sg 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]
|
|
||||||
} ;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user