From 09a82c8abb29209f884f82695d83bafbab2ffb41 Mon Sep 17 00:00:00 2001 From: aarne Date: Tue, 22 Apr 2008 12:34:45 +0000 Subject: [PATCH] made articles and mass syntactic in exper --- lib/resource/exper/abstract/Backward.gf | 9 ++++- lib/resource/exper/abstract/Cat.gf | 1 - lib/resource/exper/abstract/Noun.gf | 21 +++++----- lib/resource/exper/english/BackwardEng.gf | 13 ++++++ lib/resource/exper/english/CatEng.gf | 4 +- lib/resource/exper/english/NounEng.gf | 49 +++++++++++------------ 6 files changed, 55 insertions(+), 42 deletions(-) diff --git a/lib/resource/exper/abstract/Backward.gf b/lib/resource/exper/abstract/Backward.gf index efdbbd209..3654b1281 100644 --- a/lib/resource/exper/abstract/Backward.gf +++ b/lib/resource/exper/abstract/Backward.gf @@ -24,10 +24,15 @@ fun OrdInt : Int -> Ord ; -- 51st (DEPRECATED) -- 20/4 - DetSg : Art -> Ord -> Det ; -- the best man - DetPl : Art -> Num -> Ord -> Det ; -- the five best men + DetSg : Quant -> Ord -> Det ; -- the best man + DetPl : Quant -> Num -> Ord -> Det ; -- the five best men NoNum : Num ; + -- 22/4 + DefArt : Quant ; -- the (house), the (houses) + IndefArt : Quant ; -- a (house), (houses) + MassDet : Quant ; -- (beer) + -- from Structural 19/4/2008 that_NP : NP ; diff --git a/lib/resource/exper/abstract/Cat.gf b/lib/resource/exper/abstract/Cat.gf index 12f4760bc..35e59d78a 100644 --- a/lib/resource/exper/abstract/Cat.gf +++ b/lib/resource/exper/abstract/Cat.gf @@ -80,7 +80,6 @@ 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" - Art ; -- article (non-independent Quant) e.g. "the" Num ; -- cardinal number (used with QuantPl) e.g. "seven" Ord ; -- ordinal number (used in Det) e.g. "seventh" diff --git a/lib/resource/exper/abstract/Noun.gf b/lib/resource/exper/abstract/Noun.gf index d2664d430..919e3bb87 100644 --- a/lib/resource/exper/abstract/Noun.gf +++ b/lib/resource/exper/abstract/Noun.gf @@ -36,28 +36,25 @@ abstract Noun = Cat ** { -- (This is modified from CLE by further dividing their $Num$ into -- 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 -- "one" is a numeral: "this one man". -- Quantifiers can form noun phrases directly. - DetQuant : Quant -> Num -> Ord -> NP ; -- these five - --- Quantifiers can also be used in the same way as articles. - - ArtQuant : Quant -> Art ; + 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 -> Art ; -- my (house) + PossPron : Pron -> Quant ; -- my (house) -- 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 ; NumPl : Num ; @@ -90,18 +87,18 @@ abstract Noun = Cat ** { OrdNumeralNP : Numeral -> NP ; -- the fiftieth 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 -- any particular word (Finnish; Swedish definites). - DefArt : Art ; -- the (house), the (houses) - IndefArt : Art ; -- a (house), (houses) + DefNP : Num -> Ord -> CN -> NP ; -- the (house), the (houses) + IndefNP : Num -> Ord -> CN -> NP ; -- a (house), (houses) -- 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. - MassDet : Art ; -- (beer) + MassNP : CN -> NP ; -- (beer) -- Other determiners are defined in [Structural Structural.html]. diff --git a/lib/resource/exper/english/BackwardEng.gf b/lib/resource/exper/english/BackwardEng.gf index 602ad1ee9..95f922c00 100644 --- a/lib/resource/exper/english/BackwardEng.gf +++ b/lib/resource/exper/english/BackwardEng.gf @@ -51,6 +51,19 @@ concrete BackwardEng of Backward = CatEng ** open ResEng in { NoNum = {s = []; n = Pl } ; + DefArt = {s = \\_ => artDef} ; + + IndefArt = { + s = table { + Sg => artIndef ; + Pl => [] + } + } ; + + MassDet = {s = \\_ => []} ; + + + -- from Structural 19/4/2008 that_NP = regNP "that" Sg ; diff --git a/lib/resource/exper/english/CatEng.gf b/lib/resource/exper/english/CatEng.gf index e9b3ec565..14103a012 100644 --- a/lib/resource/exper/english/CatEng.gf +++ b/lib/resource/exper/english/CatEng.gf @@ -51,8 +51,8 @@ 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} ; - Quant, Art = {s : Number => Str} ; + Num = {s : Str; n : Number ; isNum : Bool} ; + Quant = {s : Number => Str} ; -- Numeral diff --git a/lib/resource/exper/english/NounEng.gf b/lib/resource/exper/english/NounEng.gf index 2554e485a..2a025fa77 100644 --- a/lib/resource/exper/english/NounEng.gf +++ b/lib/resource/exper/english/NounEng.gf @@ -31,39 +31,29 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in { a = np.a } ; - DetArt quant num ord = { + DetQuant quant num ord = { s = quant.s ! num.n ++ num.s ++ ord.s ; n = num.n } ; - DetQuant quant num ord = { + DetNP quant num ord = { s = \\c => quant.s ! num.n ++ num.s ++ ord.s ; ---- case a = agrP3 num.n } ; - ArtQuant q = q ; - PossPron p = {s = \\_ => p.s ! Gen} ; - NumSg = {s = []; n = Sg} ; - NumPl = {s = []; n = Pl} ; + NumSg = {s = []; n = Sg ; isNum = False} ; + NumPl = {s = []; n = Pl ; isNum = False} ; NoOrd = {s = []} ; - NumDigits n = {s = n.s ! NCard ; n = n.n} ; - - --table (Predef.Ints 1 * Predef.Ints 9) { - -- <0,1> => Sg ; - -- _ => Pl -- DEPRECATED - -- } ! <1,2> ---- parser bug (AR 2/6/2007) - -- ---- - -- } ; - + NumDigits n = {s = n.s ! NCard ; n = n.n ; isNum = True} ; 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} ; - 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} ; @@ -82,16 +72,25 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in { a = agrP3 n.n } ; - DefArt = {s = \\_ => artDef} ; - - IndefArt = { - s = table { - Sg => artIndef ; - Pl => [] - } + DefNP num ord cn = { + s = \\c => artDef ++ num.s ++ ord.s ++ cn.s ! num.n ! c ; + a = agrP3 num.n } ; - MassDet = {s = \\_ => []} ; + IndefNP num ord cn = + let an = case of { + => 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 ; UseN2 n = n ;