From 6ff1cfc233fbc43b280755b52ae51f1401d3d344 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 21 Feb 2005 16:26:01 +0000 Subject: [PATCH] towards completing French API --- lib/resource/english/SyntaxEng.gf | 2 +- lib/resource/romance/RulesRomance.gf | 24 +++++++++++++++++++++--- lib/resource/romance/SyntaxRomance.gf | 21 +++++++++++++++++++-- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/lib/resource/english/SyntaxEng.gf b/lib/resource/english/SyntaxEng.gf index 19932e2a8..684258924 100644 --- a/lib/resource/english/SyntaxEng.gf +++ b/lib/resource/english/SyntaxEng.gf @@ -2,7 +2,7 @@ --1 A Small English Resource Syntax -- --- Aarne Ranta 2002 +-- Aarne Ranta 2002 - 2005 -- -- This resource grammar contains definitions needed to construct -- indicative, interrogative, and imperative sentences in English. diff --git a/lib/resource/romance/RulesRomance.gf b/lib/resource/romance/RulesRomance.gf index 86c9ccd14..36a08eca9 100644 --- a/lib/resource/romance/RulesRomance.gf +++ b/lib/resource/romance/RulesRomance.gf @@ -21,6 +21,8 @@ lin DefNumNP = defNounPhraseNum ; DetNP = detNounPhrase ; + NDetNP = numDetNounPhrase ; + NDetNum = justNumDetNounPhrase ; MassNP = partitiveNounPhrase singular ; AppN2 = appFunComm ; @@ -43,7 +45,19 @@ lin ComparADeg = comparAdjPhrase ; SuperlNP = superlNounPhrase ; - UseV2 = transAsVerb ; +---- PredAS = predAdjSent ; +---- PredV0 rain = predVerbClause (pronNounPhrase pronIt) rain (complVerb rain) ; + +-- Partial saturation. + +---- UseV2 = transAsVerb ; + +---- ComplV3 = complDitransVerb ; + +---- ComplA2S = predAdjSent2 ; + +---- AdjPart = adjPastPart ; + UseV2V x = x ** {isAux = False} ; UseV2S x = x ; @@ -115,8 +129,11 @@ lin ImperOne = imperUtterance singular ; ImperMany = imperUtterance plural ; ------ PrepS p = p ; ------ AdvS = advSentence ; +---- AdvCl = advClause ; +---- AdvVPI = advVerbPhrase ; + +---- AdCPhr = advSentence ; +---- AdvPhr = advSentence ; TwoS = twoSentence ; ConsS = consSentence ; @@ -148,6 +165,7 @@ lin PhrManyCN = useCommonNounPhrase plural ; PhrIP ip = postfixSS "?" ip ; PhrIAdv ia = postfixSS "?" ia ; +---- PhrVPI = verbUtterance ; OnePhr p = p ; ConsPhr = cc2 ; diff --git a/lib/resource/romance/SyntaxRomance.gf b/lib/resource/romance/SyntaxRomance.gf index 8f18f3bb2..f480b2af0 100644 --- a/lib/resource/romance/SyntaxRomance.gf +++ b/lib/resource/romance/SyntaxRomance.gf @@ -81,7 +81,7 @@ oper -- The determiner determines the number of the argument noun. Determiner : Type = {s : Gender => Str ; n : Number} ; - NumDeterminer : Type = {s : Gender => Str} ; + DeterminerNum : Type = {s : Gender => Str} ; detNounPhrase : Determiner -> CommNoun -> NounPhrase = \tout, homme -> normalNounPhrase @@ -89,6 +89,23 @@ oper homme.g tout.n ; + + numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase = + \tous, six, homme -> + normalNounPhrase + (\\c => prepCase c ++ tous.s ! homme.g ++ six.s ! homme.g ++ homme.s ! Pl) + homme.g + Pl ; + +--- Here one would like to provide a feminine variant as well. + + justNumDetNounPhrase : DeterminerNum -> Numeral -> NounPhrase = + \tous, six -> + normalNounPhrase + (\\c => prepCase c ++ tous.s ! Masc ++ six.s ! Masc) + Masc + Pl ; + -- The following macros are sufficient to define most determiners, -- as shown by the examples that follow. @@ -98,7 +115,7 @@ oper mkDeterminer1 : Number -> Str -> Determiner = \n,chaque -> mkDeterminer n chaque chaque ; - mkDeterminerNum : Str -> Str -> NumDeterminer = + mkDeterminerNum : Str -> Str -> DeterminerNum = \tous,toutes -> {s = \\g => genForms tous toutes ! g} ;