From ce8466a35aae91f5b8359980a84f6e9f6f2b2b15 Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 23 Apr 2008 07:20:37 +0000 Subject: [PATCH] Noun syntax in exper once again --- lib/resource/exper/abstract/Backward.gf | 1 + lib/resource/exper/abstract/Cat.gf | 4 +- lib/resource/exper/abstract/Noun.gf | 83 ++++++++++++------------- lib/resource/exper/english/CatEng.gf | 4 +- lib/resource/exper/english/NounEng.gf | 59 ++++++++++-------- 5 files changed, 80 insertions(+), 71 deletions(-) diff --git a/lib/resource/exper/abstract/Backward.gf b/lib/resource/exper/abstract/Backward.gf index 3b56d6334..6223e42c1 100644 --- a/lib/resource/exper/abstract/Backward.gf +++ b/lib/resource/exper/abstract/Backward.gf @@ -30,6 +30,7 @@ fun NumInt : Int -> Num ; -- 51 OrdInt : Int -> Ord ; -- 51st (DEPRECATED) + NoOrd : Ord ; -- 20/4 DetSg : Quant -> Ord -> Det ; -- the best man diff --git a/lib/resource/exper/abstract/Cat.gf b/lib/resource/exper/abstract/Cat.gf index 450d88316..a596c318f 100644 --- a/lib/resource/exper/abstract/Cat.gf +++ b/lib/resource/exper/abstract/Cat.gf @@ -80,7 +80,9 @@ abstract Cat = Common ** { Det ; -- determiner phrase e.g. "those seven" Predet ; -- predeterminer (prefixed Quant) e.g. "all" 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" --2 Numerals diff --git a/lib/resource/exper/abstract/Noun.gf b/lib/resource/exper/abstract/Noun.gf index 919e3bb87..318e988ad 100644 --- a/lib/resource/exper/abstract/Noun.gf +++ b/lib/resource/exper/abstract/Noun.gf @@ -2,6 +2,7 @@ abstract Noun = Cat ** { + --2 Noun phrases -- The three main types of noun phrases are @@ -28,77 +29,75 @@ abstract Noun = Cat ** { AdvNP : NP -> Adv -> NP ; -- Paris at midnight RelNP : NP -> RS -> NP ; -- Paris, which is in Europe +-- Determiners can form noun phrases directly. + + DetNP : Det -> NP ; -- these five + + --2 Determiners -- The determiner has a fine-grained structure, in which a 'nucleus' --- quantifier and two optional parts can be discerned. --- The cardinal numeral is only available for plural determiners. --- (This is modified from CLE by further dividing their $Num$ into --- cardinal and ordinal.) +-- quantifier and two optional parts can be discerned: a cardinal and +-- an ordinal numeral. - 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 --- "one" is a numeral: "this one man". - --- 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) +-- Whether the resulting determiner is singular or plural depends on the +-- cardinal. -- 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 inherent numbers. +-- the inherent number. - NumSg : Num ; - NumPl : Num ; - NoOrd : Ord ; + NumSg : Card ; + NumPl : Card ; + NumCard : Card -> Num ; --- $Num$ consists of either digits or numeral words. +-- $Card$ consists of either digits or numeral words. - NumDigits : Digits -> Num ; -- 51 - NumNumeral : Numeral -> Num ; -- fifty-one + NumDigits : Digits -> Card ; -- 51 + NumNumeral : Numeral -> Card ; -- fifty-one -- The construction of numerals is defined in [Numeral Numeral.html]. -- $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. +-- Also superlative forms of adjectives behave syntactically like ordinals. - OrdDigits : Digits -> Ord ; -- 51st - OrdNumeral : Numeral -> Ord ; -- fifty-first - --- 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 + OrdDigits : Digits -> Ord ; -- 51st + OrdNumeral : Numeral -> Ord ; -- fifty-first + OrdSuperl : A -> Ord ; -- largest -- Definite and indefinite noun phrases are sometimes realized as -- neatly distinct words (Spanish "un, unos ; el, los") but also without -- any particular word (Finnish; Swedish definites). - DefNP : Num -> Ord -> CN -> NP ; -- the (house), the (houses) - IndefNP : Num -> Ord -> CN -> NP ; -- a (house), (houses) + DetArtOrd : Art -> Num -> Ord -> Det ; -- the (five) best + 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 -- not distinguish mass nouns from other common nouns, which can result -- 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]. diff --git a/lib/resource/exper/english/CatEng.gf b/lib/resource/exper/english/CatEng.gf index 6e9f1aded..9e3fcace4 100644 --- a/lib/resource/exper/english/CatEng.gf +++ b/lib/resource/exper/english/CatEng.gf @@ -51,8 +51,10 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in { NP, Pron = {s : Case => Str ; a : Agr} ; Det = {s : Str ; n : Number} ; 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} ; + Art = {s : Bool => Number => Str} ; -- Numeral diff --git a/lib/resource/exper/english/NounEng.gf b/lib/resource/exper/english/NounEng.gf index 2a025fa77..a4e4f8e11 100644 --- a/lib/resource/exper/english/NounEng.gf +++ b/lib/resource/exper/english/NounEng.gf @@ -31,60 +31,65 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in { a = np.a } ; - DetQuant quant num ord = { + DetQuantOrd quant num ord = { s = quant.s ! num.n ++ num.s ++ ord.s ; n = num.n } ; - DetNP quant num ord = { - s = \\c => quant.s ! num.n ++ num.s ++ ord.s ; ---- case - a = agrP3 num.n + DetQuant quant num = { + s = quant.s ! num.n ++ num.s ; + n = num.n + } ; + + DetNP det = { + s = \\c => det.s ; ---- case + a = agrP3 det.n } ; PossPron p = {s = \\_ => p.s ! Gen} ; - NumSg = {s = []; n = Sg ; isNum = False} ; - NumPl = {s = []; n = Pl ; isNum = False} ; - NoOrd = {s = []} ; + NumSg = {s = []; n = Sg ; hasCard = False} ; + NumPl = {s = []; n = Pl ; hasCard = False} ; +---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} ; - 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} ; - 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} ; - NumNumeralNP num = { - s = \\c => num.s ! NCard ; ---- case - a = agrP3 num.n + DetArtOrd art num ord = { + s = art.s ! num.hasCard ! num.n ++ num.s ++ ord.s ; + n = num.n } ; - OrdNumeralNP ord = { - s = \\c => "the" ++ ord.s ! NOrd ; ---- case + DetArtCard art card = { + 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 } ; - OrdSuperlNP n a = { - s = \\c => "the" ++ n.s ++ a.s ! AAdj Superl ; ---- case - a = agrP3 n.n + DetArtPl art cn = { + s = \\c => art.s ! False ! Pl ++ cn.s ! Pl ! c ; + a = agrP3 Pl } ; - DefNP num ord cn = { - s = \\c => artDef ++ num.s ++ ord.s ++ cn.s ! num.n ! c ; - a = agrP3 num.n - } ; + DefArt = {s = \\c,n => artDef} ; - IndefNP num ord cn = - let an = case of { + IndefArt = {s = \\c,n => case of { => artIndef ; _ => [] } - in { - s = \\c => an ++ num.s ++ ord.s ++ cn.s ! num.n ! c ; - a = agrP3 num.n } ; MassNP cn = {