towards completing French API

This commit is contained in:
aarne
2005-02-21 16:26:01 +00:00
parent 6dc5c19c9e
commit 6ff1cfc233
3 changed files with 41 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
--1 A Small English Resource Syntax --1 A Small English Resource Syntax
-- --
-- Aarne Ranta 2002 -- Aarne Ranta 2002 - 2005
-- --
-- This resource grammar contains definitions needed to construct -- This resource grammar contains definitions needed to construct
-- indicative, interrogative, and imperative sentences in English. -- indicative, interrogative, and imperative sentences in English.

View File

@@ -21,6 +21,8 @@ lin
DefNumNP = defNounPhraseNum ; DefNumNP = defNounPhraseNum ;
DetNP = detNounPhrase ; DetNP = detNounPhrase ;
NDetNP = numDetNounPhrase ;
NDetNum = justNumDetNounPhrase ;
MassNP = partitiveNounPhrase singular ; MassNP = partitiveNounPhrase singular ;
AppN2 = appFunComm ; AppN2 = appFunComm ;
@@ -43,7 +45,19 @@ lin
ComparADeg = comparAdjPhrase ; ComparADeg = comparAdjPhrase ;
SuperlNP = superlNounPhrase ; 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} ; UseV2V x = x ** {isAux = False} ;
UseV2S x = x ; UseV2S x = x ;
@@ -115,8 +129,11 @@ lin
ImperOne = imperUtterance singular ; ImperOne = imperUtterance singular ;
ImperMany = imperUtterance plural ; ImperMany = imperUtterance plural ;
----- PrepS p = p ; ---- AdvCl = advClause ;
----- AdvS = advSentence ; ---- AdvVPI = advVerbPhrase ;
---- AdCPhr = advSentence ;
---- AdvPhr = advSentence ;
TwoS = twoSentence ; TwoS = twoSentence ;
ConsS = consSentence ; ConsS = consSentence ;
@@ -148,6 +165,7 @@ lin
PhrManyCN = useCommonNounPhrase plural ; PhrManyCN = useCommonNounPhrase plural ;
PhrIP ip = postfixSS "?" ip ; PhrIP ip = postfixSS "?" ip ;
PhrIAdv ia = postfixSS "?" ia ; PhrIAdv ia = postfixSS "?" ia ;
---- PhrVPI = verbUtterance ;
OnePhr p = p ; OnePhr p = p ;
ConsPhr = cc2 ; ConsPhr = cc2 ;

View File

@@ -81,7 +81,7 @@ oper
-- The determiner determines the number of the argument noun. -- The determiner determines the number of the argument noun.
Determiner : Type = {s : Gender => Str ; n : Number} ; Determiner : Type = {s : Gender => Str ; n : Number} ;
NumDeterminer : Type = {s : Gender => Str} ; DeterminerNum : Type = {s : Gender => Str} ;
detNounPhrase : Determiner -> CommNoun -> NounPhrase = \tout, homme -> detNounPhrase : Determiner -> CommNoun -> NounPhrase = \tout, homme ->
normalNounPhrase normalNounPhrase
@@ -89,6 +89,23 @@ oper
homme.g homme.g
tout.n ; 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, -- The following macros are sufficient to define most determiners,
-- as shown by the examples that follow. -- as shown by the examples that follow.
@@ -98,7 +115,7 @@ oper
mkDeterminer1 : Number -> Str -> Determiner = \n,chaque -> mkDeterminer1 : Number -> Str -> Determiner = \n,chaque ->
mkDeterminer n chaque chaque ; mkDeterminer n chaque chaque ;
mkDeterminerNum : Str -> Str -> NumDeterminer = mkDeterminerNum : Str -> Str -> DeterminerNum =
\tous,toutes -> \tous,toutes ->
{s = \\g => genForms tous toutes ! g} ; {s = \\g => genForms tous toutes ! g} ;