mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 10:48:54 -06:00
made articles and mass syntactic in exper
This commit is contained in:
@@ -24,10 +24,15 @@ fun
|
|||||||
OrdInt : Int -> Ord ; -- 51st (DEPRECATED)
|
OrdInt : Int -> Ord ; -- 51st (DEPRECATED)
|
||||||
|
|
||||||
-- 20/4
|
-- 20/4
|
||||||
DetSg : Art -> Ord -> Det ; -- the best man
|
DetSg : Quant -> Ord -> Det ; -- the best man
|
||||||
DetPl : Art -> Num -> Ord -> Det ; -- the five best men
|
DetPl : Quant -> Num -> Ord -> Det ; -- the five best men
|
||||||
NoNum : Num ;
|
NoNum : Num ;
|
||||||
|
|
||||||
|
-- 22/4
|
||||||
|
DefArt : Quant ; -- the (house), the (houses)
|
||||||
|
IndefArt : Quant ; -- a (house), (houses)
|
||||||
|
MassDet : Quant ; -- (beer)
|
||||||
|
|
||||||
-- from Structural 19/4/2008
|
-- from Structural 19/4/2008
|
||||||
|
|
||||||
that_NP : NP ;
|
that_NP : NP ;
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ abstract Cat = Common ** {
|
|||||||
Det ; -- determiner phrase e.g. "those seven"
|
Det ; -- determiner phrase e.g. "those seven"
|
||||||
Predet ; -- predeterminer (prefixed Quant) e.g. "all"
|
Predet ; -- predeterminer (prefixed Quant) e.g. "all"
|
||||||
Quant ; -- quantifier ('nucleus' of Det) e.g. "this/these"
|
Quant ; -- quantifier ('nucleus' of Det) e.g. "this/these"
|
||||||
Art ; -- article (non-independent Quant) e.g. "the"
|
|
||||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||||
|
|
||||||
|
|||||||
@@ -36,28 +36,25 @@ abstract Noun = Cat ** {
|
|||||||
-- (This is modified from CLE by further dividing their $Num$ into
|
-- (This is modified from CLE by further dividing their $Num$ into
|
||||||
-- cardinal and ordinal.)
|
-- cardinal and ordinal.)
|
||||||
|
|
||||||
DetArt : Art -> Num -> Ord -> Det ; -- the five best men
|
DetQuant : Quant -> Num -> Ord -> Det ; -- the five best men
|
||||||
|
|
||||||
-- Notice that $DetPl$ can still result in a singular determiner, because
|
-- Notice that $DetPl$ can still result in a singular determiner, because
|
||||||
-- "one" is a numeral: "this one man".
|
-- "one" is a numeral: "this one man".
|
||||||
|
|
||||||
-- Quantifiers can form noun phrases directly.
|
-- Quantifiers can form noun phrases directly.
|
||||||
|
|
||||||
DetQuant : Quant -> Num -> Ord -> NP ; -- these five
|
DetNP : Quant -> Num -> Ord -> NP ; -- these five
|
||||||
|
|
||||||
-- Quantifiers can also be used in the same way as articles.
|
|
||||||
|
|
||||||
ArtQuant : Quant -> Art ;
|
|
||||||
|
|
||||||
-- Pronouns have possessive forms. Genitives of other kinds
|
-- Pronouns have possessive forms. Genitives of other kinds
|
||||||
-- of noun phrases are not given here, since they are not possible
|
-- of noun phrases are not given here, since they are not possible
|
||||||
-- in e.g. Romance languages. They can be found in
|
-- in e.g. Romance languages. They can be found in
|
||||||
-- [``Extra`` ../abstract/Extra.gf].
|
-- [``Extra`` ../abstract/Extra.gf].
|
||||||
|
|
||||||
PossPron : Pron -> Art ; -- my (house)
|
PossPron : Pron -> Quant ; -- my (house)
|
||||||
|
|
||||||
-- All parts of the determiner can be empty, except $Quant$, which is
|
-- All parts of the determiner can be empty, except $Quant$, which is
|
||||||
-- the "kernel" of a determiner.
|
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
|
||||||
|
-- the inherent numbers.
|
||||||
|
|
||||||
NumSg : Num ;
|
NumSg : Num ;
|
||||||
NumPl : Num ;
|
NumPl : Num ;
|
||||||
@@ -90,18 +87,18 @@ abstract Noun = Cat ** {
|
|||||||
OrdNumeralNP : Numeral -> NP ; -- the fiftieth
|
OrdNumeralNP : Numeral -> NP ; -- the fiftieth
|
||||||
NumNumeralNP : Numeral -> NP ; -- fifty
|
NumNumeralNP : Numeral -> NP ; -- fifty
|
||||||
|
|
||||||
-- Definite and indefinite constructions are sometimes realized as
|
-- Definite and indefinite noun phrases are sometimes realized as
|
||||||
-- neatly distinct words (Spanish "un, unos ; el, los") but also without
|
-- neatly distinct words (Spanish "un, unos ; el, los") but also without
|
||||||
-- any particular word (Finnish; Swedish definites).
|
-- any particular word (Finnish; Swedish definites).
|
||||||
|
|
||||||
DefArt : Art ; -- the (house), the (houses)
|
DefNP : Num -> Ord -> CN -> NP ; -- the (house), the (houses)
|
||||||
IndefArt : Art ; -- a (house), (houses)
|
IndefNP : Num -> Ord -> CN -> NP ; -- a (house), (houses)
|
||||||
|
|
||||||
-- Nouns can be used without an article as mass nouns. The resource does
|
-- Nouns can be used without an article as mass nouns. The resource does
|
||||||
-- not distinguish mass nouns from other common nouns, which can result
|
-- not distinguish mass nouns from other common nouns, which can result
|
||||||
-- in semantically odd expressions.
|
-- in semantically odd expressions.
|
||||||
|
|
||||||
MassDet : Art ; -- (beer)
|
MassNP : CN -> NP ; -- (beer)
|
||||||
|
|
||||||
-- Other determiners are defined in [Structural Structural.html].
|
-- Other determiners are defined in [Structural Structural.html].
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,19 @@ concrete BackwardEng of Backward = CatEng ** open ResEng in {
|
|||||||
|
|
||||||
NoNum = {s = []; n = Pl } ;
|
NoNum = {s = []; n = Pl } ;
|
||||||
|
|
||||||
|
DefArt = {s = \\_ => artDef} ;
|
||||||
|
|
||||||
|
IndefArt = {
|
||||||
|
s = table {
|
||||||
|
Sg => artIndef ;
|
||||||
|
Pl => []
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
MassDet = {s = \\_ => []} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-- from Structural 19/4/2008
|
-- from Structural 19/4/2008
|
||||||
|
|
||||||
that_NP = regNP "that" Sg ;
|
that_NP = regNP "that" Sg ;
|
||||||
|
|||||||
@@ -51,8 +51,8 @@ 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 ; isNum : Bool} ;
|
||||||
Quant, Art = {s : Number => Str} ;
|
Quant = {s : Number => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
|
|||||||
@@ -31,39 +31,29 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetArt quant num ord = {
|
DetQuant quant num ord = {
|
||||||
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuant quant num ord = {
|
DetNP quant num ord = {
|
||||||
s = \\c => quant.s ! num.n ++ num.s ++ ord.s ; ---- case
|
s = \\c => quant.s ! num.n ++ num.s ++ ord.s ; ---- case
|
||||||
a = agrP3 num.n
|
a = agrP3 num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ArtQuant q = q ;
|
|
||||||
|
|
||||||
PossPron p = {s = \\_ => p.s ! Gen} ;
|
PossPron p = {s = \\_ => p.s ! Gen} ;
|
||||||
|
|
||||||
NumSg = {s = []; n = Sg} ;
|
NumSg = {s = []; n = Sg ; isNum = False} ;
|
||||||
NumPl = {s = []; n = Pl} ;
|
NumPl = {s = []; n = Pl ; isNum = False} ;
|
||||||
NoOrd = {s = []} ;
|
NoOrd = {s = []} ;
|
||||||
|
|
||||||
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
|
NumDigits n = {s = n.s ! NCard ; n = n.n ; isNum = True} ;
|
||||||
|
|
||||||
--table (Predef.Ints 1 * Predef.Ints 9) {
|
|
||||||
-- <0,1> => Sg ;
|
|
||||||
-- _ => Pl -- DEPRECATED
|
|
||||||
-- } ! <1,2> ---- parser bug (AR 2/6/2007)
|
|
||||||
-- ---- <n.size,n.last>
|
|
||||||
-- } ;
|
|
||||||
|
|
||||||
OrdDigits n = {s = n.s ! NOrd} ;
|
OrdDigits n = {s = n.s ! NOrd} ;
|
||||||
|
|
||||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n ; isNum = True} ;
|
||||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||||
|
|
||||||
AdNum adn num = {s = adn.s ++ num.s; n = num.n } ;
|
AdNum adn num = {s = adn.s ++ num.s ; n = num.n ; isNum = True} ; ----
|
||||||
|
|
||||||
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||||
|
|
||||||
@@ -82,16 +72,25 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
a = agrP3 n.n
|
a = agrP3 n.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DefArt = {s = \\_ => artDef} ;
|
DefNP num ord cn = {
|
||||||
|
s = \\c => artDef ++ num.s ++ ord.s ++ cn.s ! num.n ! c ;
|
||||||
IndefArt = {
|
a = agrP3 num.n
|
||||||
s = table {
|
|
||||||
Sg => artIndef ;
|
|
||||||
Pl => []
|
|
||||||
}
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassDet = {s = \\_ => []} ;
|
IndefNP num ord cn =
|
||||||
|
let an = case <num.n,num.isNum> of {
|
||||||
|
<Sg,False> => artIndef ;
|
||||||
|
_ => []
|
||||||
|
}
|
||||||
|
in {
|
||||||
|
s = \\c => an ++ num.s ++ ord.s ++ cn.s ! num.n ! c ;
|
||||||
|
a = agrP3 num.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
MassNP cn = {
|
||||||
|
s = cn.s ! Sg ;
|
||||||
|
a = agrP3 Sg
|
||||||
|
} ;
|
||||||
|
|
||||||
UseN n = n ;
|
UseN n = n ;
|
||||||
UseN2 n = n ;
|
UseN2 n = n ;
|
||||||
|
|||||||
Reference in New Issue
Block a user