mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
Noun syntax in exper once again
This commit is contained in:
@@ -30,6 +30,7 @@ fun
|
|||||||
|
|
||||||
NumInt : Int -> Num ; -- 51
|
NumInt : Int -> Num ; -- 51
|
||||||
OrdInt : Int -> Ord ; -- 51st (DEPRECATED)
|
OrdInt : Int -> Ord ; -- 51st (DEPRECATED)
|
||||||
|
NoOrd : Ord ;
|
||||||
|
|
||||||
-- 20/4
|
-- 20/4
|
||||||
DetSg : Quant -> Ord -> Det ; -- the best man
|
DetSg : Quant -> Ord -> Det ; -- the best man
|
||||||
|
|||||||
@@ -80,7 +80,9 @@ 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"
|
||||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
Art ; -- article e.g. "the"
|
||||||
|
Num ; -- number determining element e.g. "seven"
|
||||||
|
Card ; -- cardinal number e.g. "seven"
|
||||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||||
|
|
||||||
--2 Numerals
|
--2 Numerals
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
abstract Noun = Cat ** {
|
abstract Noun = Cat ** {
|
||||||
|
|
||||||
|
|
||||||
--2 Noun phrases
|
--2 Noun phrases
|
||||||
|
|
||||||
-- The three main types of noun phrases are
|
-- The three main types of noun phrases are
|
||||||
@@ -28,77 +29,75 @@ abstract Noun = Cat ** {
|
|||||||
AdvNP : NP -> Adv -> NP ; -- Paris at midnight
|
AdvNP : NP -> Adv -> NP ; -- Paris at midnight
|
||||||
RelNP : NP -> RS -> NP ; -- Paris, which is in Europe
|
RelNP : NP -> RS -> NP ; -- Paris, which is in Europe
|
||||||
|
|
||||||
|
-- Determiners can form noun phrases directly.
|
||||||
|
|
||||||
|
DetNP : Det -> NP ; -- these five
|
||||||
|
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
|
|
||||||
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
-- The determiner has a fine-grained structure, in which a 'nucleus'
|
||||||
-- quantifier and two optional parts can be discerned.
|
-- quantifier and two optional parts can be discerned: a cardinal and
|
||||||
-- The cardinal numeral is only available for plural determiners.
|
-- an ordinal numeral.
|
||||||
-- (This is modified from CLE by further dividing their $Num$ into
|
|
||||||
-- cardinal and ordinal.)
|
|
||||||
|
|
||||||
DetQuant : Quant -> Num -> Ord -> Det ; -- the five best men
|
DetQuantOrd : Quant -> Num -> Ord -> Det ; -- these five best men
|
||||||
|
DetQuant : Quant -> Num -> Det ; -- these five best men
|
||||||
|
|
||||||
-- Notice that $DetPl$ can still result in a singular determiner, because
|
-- Whether the resulting determiner is singular or plural depends on the
|
||||||
-- "one" is a numeral: "this one man".
|
-- cardinal.
|
||||||
|
|
||||||
-- Quantifiers can form noun phrases directly.
|
|
||||||
|
|
||||||
DetNP : Quant -> Num -> Ord -> NP ; -- these five
|
|
||||||
|
|
||||||
-- Pronouns have possessive forms. Genitives of other kinds
|
|
||||||
-- of noun phrases are not given here, since they are not possible
|
|
||||||
-- in e.g. Romance languages. They can be found in
|
|
||||||
-- [``Extra`` ../abstract/Extra.gf].
|
|
||||||
|
|
||||||
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. It is, however, the $Num$ that determines
|
-- the "kernel" of a determiner. It is, however, the $Num$ that determines
|
||||||
-- the inherent numbers.
|
-- the inherent number.
|
||||||
|
|
||||||
NumSg : Num ;
|
NumSg : Card ;
|
||||||
NumPl : Num ;
|
NumPl : Card ;
|
||||||
NoOrd : Ord ;
|
NumCard : Card -> Num ;
|
||||||
|
|
||||||
-- $Num$ consists of either digits or numeral words.
|
-- $Card$ consists of either digits or numeral words.
|
||||||
|
|
||||||
NumDigits : Digits -> Num ; -- 51
|
NumDigits : Digits -> Card ; -- 51
|
||||||
NumNumeral : Numeral -> Num ; -- fifty-one
|
NumNumeral : Numeral -> Card ; -- fifty-one
|
||||||
|
|
||||||
-- The construction of numerals is defined in [Numeral Numeral.html].
|
-- The construction of numerals is defined in [Numeral Numeral.html].
|
||||||
|
|
||||||
-- $Num$ can be modified by certain adverbs.
|
-- $Num$ can be modified by certain adverbs.
|
||||||
|
|
||||||
AdNum : AdN -> Num -> Num ; -- almost 51
|
AdNum : AdN -> Card -> Card ; -- almost 51
|
||||||
|
|
||||||
-- $Ord$ consists of either digits or numeral words.
|
-- $Ord$ consists of either digits or numeral words.
|
||||||
|
-- Also superlative forms of adjectives behave syntactically like ordinals.
|
||||||
|
|
||||||
OrdDigits : Digits -> Ord ; -- 51st
|
OrdDigits : Digits -> Ord ; -- 51st
|
||||||
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
||||||
|
OrdSuperl : A -> Ord ; -- largest
|
||||||
-- Superlative forms of adjectives behave syntactically in the same way as
|
|
||||||
-- ordinals.
|
|
||||||
|
|
||||||
OrdSuperl : A -> Ord ; -- largest
|
|
||||||
|
|
||||||
-- Ordinals and cardinals can be used as noun phrases alone.
|
|
||||||
|
|
||||||
OrdSuperlNP : Num -> A -> NP ; -- the five best
|
|
||||||
OrdNumeralNP : Numeral -> NP ; -- the fiftieth
|
|
||||||
NumNumeralNP : Numeral -> NP ; -- fifty
|
|
||||||
|
|
||||||
-- Definite and indefinite noun phrases 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).
|
||||||
|
|
||||||
DefNP : Num -> Ord -> CN -> NP ; -- the (house), the (houses)
|
DetArtOrd : Art -> Num -> Ord -> Det ; -- the (five) best
|
||||||
IndefNP : Num -> Ord -> CN -> NP ; -- a (house), (houses)
|
DetArtCard : Art -> Card -> Det ; -- the five
|
||||||
|
|
||||||
|
IndefArt : Art ;
|
||||||
|
DefArt : Art ;
|
||||||
|
|
||||||
|
-- Articles cannot alone form noun phrases, but need a noun.
|
||||||
|
|
||||||
|
DetArtSg : Art -> CN -> NP ; -- the man
|
||||||
|
DetArtPl : Art -> CN -> NP ; -- the men
|
||||||
|
|
||||||
-- 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.
|
||||||
|
|
||||||
MassNP : CN -> NP ; -- (beer)
|
MassNP : CN -> NP ; -- (beer)
|
||||||
|
|
||||||
|
-- Pronouns have possessive forms. Genitives of other kinds
|
||||||
|
-- of noun phrases are not given here, since they are not possible
|
||||||
|
-- in e.g. Romance languages. They can be found in $Extra$ modules.
|
||||||
|
|
||||||
|
PossPron : Pron -> Quant ; -- my (house)
|
||||||
|
|
||||||
-- Other determiners are defined in [Structural Structural.html].
|
-- Other determiners are defined in [Structural Structural.html].
|
||||||
|
|
||||||
|
|||||||
@@ -51,8 +51,10 @@ 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 ; isNum : Bool} ;
|
Num = {s : Str; n : Number ; hasCard : Bool} ;
|
||||||
|
Card = {s : Str; n : Number} ;
|
||||||
Quant = {s : Number => Str} ;
|
Quant = {s : Number => Str} ;
|
||||||
|
Art = {s : Bool => Number => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
|
|||||||
@@ -31,60 +31,65 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
a = np.a
|
a = np.a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetQuant quant num ord = {
|
DetQuantOrd 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
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetNP quant num ord = {
|
DetQuant quant num = {
|
||||||
s = \\c => quant.s ! num.n ++ num.s ++ ord.s ; ---- case
|
s = quant.s ! num.n ++ num.s ;
|
||||||
a = agrP3 num.n
|
n = num.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetNP det = {
|
||||||
|
s = \\c => det.s ; ---- case
|
||||||
|
a = agrP3 det.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
PossPron p = {s = \\_ => p.s ! Gen} ;
|
PossPron p = {s = \\_ => p.s ! Gen} ;
|
||||||
|
|
||||||
NumSg = {s = []; n = Sg ; isNum = False} ;
|
NumSg = {s = []; n = Sg ; hasCard = False} ;
|
||||||
NumPl = {s = []; n = Pl ; isNum = False} ;
|
NumPl = {s = []; n = Pl ; hasCard = False} ;
|
||||||
NoOrd = {s = []} ;
|
---b NoOrd = {s = []} ;
|
||||||
|
|
||||||
NumDigits n = {s = n.s ! NCard ; n = n.n ; isNum = True} ;
|
NumCard n = n ** {hasCard = True} ;
|
||||||
|
|
||||||
|
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
|
||||||
OrdDigits n = {s = n.s ! NOrd} ;
|
OrdDigits n = {s = n.s ! NOrd} ;
|
||||||
|
|
||||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n ; isNum = True} ;
|
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
||||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||||
|
|
||||||
AdNum adn num = {s = adn.s ++ num.s ; n = num.n ; isNum = True} ; ----
|
AdNum adn num = {s = adn.s ++ num.s ; n = num.n} ;
|
||||||
|
|
||||||
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||||
|
|
||||||
NumNumeralNP num = {
|
DetArtOrd art num ord = {
|
||||||
s = \\c => num.s ! NCard ; ---- case
|
s = art.s ! num.hasCard ! num.n ++ num.s ++ ord.s ;
|
||||||
a = agrP3 num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
OrdNumeralNP ord = {
|
DetArtCard art card = {
|
||||||
s = \\c => "the" ++ ord.s ! NOrd ; ---- case
|
s = art.s ! True ! card.n ++ card.s ;
|
||||||
|
n = card.n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
DetArtSg art cn = {
|
||||||
|
s = \\c => art.s ! False ! Sg ++ cn.s ! Sg ! c ;
|
||||||
a = agrP3 Sg
|
a = agrP3 Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
OrdSuperlNP n a = {
|
DetArtPl art cn = {
|
||||||
s = \\c => "the" ++ n.s ++ a.s ! AAdj Superl ; ---- case
|
s = \\c => art.s ! False ! Pl ++ cn.s ! Pl ! c ;
|
||||||
a = agrP3 n.n
|
a = agrP3 Pl
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DefNP num ord cn = {
|
DefArt = {s = \\c,n => artDef} ;
|
||||||
s = \\c => artDef ++ num.s ++ ord.s ++ cn.s ! num.n ! c ;
|
|
||||||
a = agrP3 num.n
|
|
||||||
} ;
|
|
||||||
|
|
||||||
IndefNP num ord cn =
|
IndefArt = {s = \\c,n => case <n,c> of {
|
||||||
let an = case <num.n,num.isNum> of {
|
|
||||||
<Sg,False> => artIndef ;
|
<Sg,False> => artIndef ;
|
||||||
_ => []
|
_ => []
|
||||||
}
|
}
|
||||||
in {
|
|
||||||
s = \\c => an ++ num.s ++ ord.s ++ cn.s ! num.n ! c ;
|
|
||||||
a = agrP3 num.n
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassNP cn = {
|
MassNP cn = {
|
||||||
|
|||||||
Reference in New Issue
Block a user