From 8438ba16def73e277d1dc8b85ebeac45d49652ed Mon Sep 17 00:00:00 2001 From: bringert Date: Fri, 11 May 2007 13:38:54 +0000 Subject: [PATCH] Added n : Number field to the Num category for English. --- lib/resource-1.0/english/CatEng.gf | 3 ++- lib/resource-1.0/english/NounEng.gf | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/resource-1.0/english/CatEng.gf b/lib/resource-1.0/english/CatEng.gf index a9e90927c..11533f9a2 100644 --- a/lib/resource-1.0/english/CatEng.gf +++ b/lib/resource-1.0/english/CatEng.gf @@ -52,7 +52,8 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in { CN = {s : Number => Case => Str} ; NP, Pron = {s : Case => Str ; a : Agr} ; Det = {s : Str ; n : Number} ; - Predet, QuantSg, QuantPl, Num, Ord = {s : Str} ; + Predet, QuantSg, QuantPl, Ord = {s : Str} ; + Num = {s : Str; n : Number } ; Quant = {s : Number => Str} ; -- Numeral diff --git a/lib/resource-1.0/english/NounEng.gf b/lib/resource-1.0/english/NounEng.gf index 57e74f239..635dbe8d2 100644 --- a/lib/resource-1.0/english/NounEng.gf +++ b/lib/resource-1.0/english/NounEng.gf @@ -32,7 +32,7 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in { DetPl quant num ord = { s = quant.s ++ num.s ++ ord.s ; - n = Pl + n = num.n } ; SgQuant quant = {s = quant.s ! Sg} ; @@ -40,15 +40,21 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in { PossPron p = {s = \\_ => p.s ! Gen} ; - NoNum, NoOrd = {s = []} ; + NoNum = {s = []; n = Pl } ; + NoOrd = {s = []} ; + + NumInt n = {s = n.s; n = table (Predef.Ints 1 * Predef.Ints 9) { + <0,1> => Sg ; + _ => Pl + } ! + } ; - NumInt n = n ; OrdInt n = {s = n.s ++ "th"} ; --- - NumNumeral numeral = {s = numeral.s ! NCard} ; + NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n } ; OrdNumeral numeral = {s = numeral.s ! NOrd} ; - AdNum adn num = {s = adn.s ++ num.s} ; + AdNum adn num = {s = adn.s ++ num.s; n = num.n } ; OrdSuperl a = {s = a.s ! AAdj Superl} ;