mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-19 17:59:32 -06:00
195 lines
4.5 KiB
Plaintext
195 lines
4.5 KiB
Plaintext
--# -path=.:../abstract:../../prelude
|
|
|
|
incomplete concrete RulesRomance of Rules = CategoriesRomance **
|
|
open Prelude, SyntaxRomance in {
|
|
|
|
flags optimize = all_subs ;
|
|
|
|
lin
|
|
UseN = noun2CommNounPhrase ;
|
|
UsePN = nameNounPhrase ;
|
|
|
|
IndefOneNP = indefNounPhrase singular ;
|
|
IndefNumNP = indefNounPhraseNum ;
|
|
DefOneNP = defNounPhrase singular ;
|
|
DefNumNP = defNounPhraseNum ;
|
|
|
|
DetNP = detNounPhrase ;
|
|
NDetNP = numDetNounPhrase ;
|
|
NDetNum = justNumDetNounPhrase ;
|
|
MassNP = partitiveNounPhrase singular ;
|
|
|
|
AppN2 = appFunComm ;
|
|
AppN3 = appFun2 ;
|
|
UseN2 = funAsCommNounPhrase ; -- [SyntaxFra.noun2CommNounPhrase]
|
|
|
|
ModAP = modCommNounPhrase ;
|
|
CNthatS = nounThatSentence ;
|
|
|
|
ModGenOne = npGenDet singular ;
|
|
ModGenNum = npGenDetNum ;
|
|
|
|
UseInt i = {s = \\_ => i.s ; n = Pl ; isNo = False} ; ---- n
|
|
NoNum = noNum ;
|
|
|
|
UseA = adj2adjPhrase ;
|
|
ComplA2 = complAdj ;
|
|
ComplAV v x = complVerbAdj v x ;
|
|
ComplObjA2V v x y = complVerbAdj2 True v x y ;
|
|
|
|
PositADeg = positAdjPhrase ;
|
|
ComparADeg = comparAdjPhrase ;
|
|
SuperlADeg = superlAdjPhrase ;
|
|
|
|
PredAS = predAdjSent ;
|
|
PredV0 rain = predVerb0 rain ;
|
|
|
|
-- Partial saturation.
|
|
|
|
UseV2 = transAsVerb ;
|
|
|
|
ComplA2S = predAdjSent2 ; ---- clitics get lost
|
|
|
|
AdjPart = adjPastPart ;
|
|
|
|
UseV2V x = x ** {isAux = False} ;
|
|
UseV2S x = x ;
|
|
UseV2Q x = x ;
|
|
UseA2S x = x ;
|
|
UseA2V x = x ;
|
|
|
|
-- Formation of fixed-tense fixed-polarity clauses.
|
|
|
|
UseCl tp cl =
|
|
{s = \\m => tp.s ++ cl.s ! tp.b ! useClForm tp.t tp.a m} ;
|
|
UseRCl tp cl =
|
|
{s = \\m,g,n,p => tp.s ++
|
|
cl.s1 ! g ! n ! p ++
|
|
cl.s2 ! tp.b ! useClForm tp.t tp.a m ! g ! n ! p ++
|
|
cl.s3 ! tp.b
|
|
} ;
|
|
UseQCl tp cl =
|
|
{s = \\q => tp.s ++ cl.s ! tp.b ! useClForm tp.t tp.a Ind ! q} ;
|
|
UseVCl po a cl =
|
|
{s = \\v,g,n,p => po.s ++ a.s ++ cl.s ! po.p ! a.a ! v ! g ! n ! p} ;
|
|
|
|
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
|
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;
|
|
|
|
TPresent = {s = [] ; t = Present} ;
|
|
TPast = {s = [] ; t = Past} ;
|
|
TFuture = {s = [] ; t = Future} ;
|
|
TConditional = {s = [] ; t = Condit} ;
|
|
|
|
ASimul = {s = [] ; a = Simul} ;
|
|
AAnter = {s = [] ; a = Anter} ;
|
|
|
|
PPos = {s = [] ; p = True} ;
|
|
PNeg = {s = [] ; p = False} ;
|
|
|
|
-- Adverbs.
|
|
|
|
AdjAdv a = {s = a.s ! AA} ;
|
|
---- AdvVP = adVerbPhrase ;
|
|
AdvPP p = p ;
|
|
|
|
PrepNP = prepNounPhrase ;
|
|
|
|
AdvCN = advCommNounPhrase ;
|
|
AdvAP = advAdjPhrase ;
|
|
AdvAdv = cc2 ;
|
|
|
|
--- Here the $np$ should become always stressed.
|
|
|
|
AdvNP np adv = <np : {g : PronGen ; n : Number ; p : Person}> **
|
|
{s = \\f => np.s ! f ++ adv.s ; c = Clit0} ;
|
|
|
|
--3 Sentences and relative clauses
|
|
--
|
|
|
|
SlashV2 = slashTransVerb ;
|
|
SlashVV2 = slashVerbVerb ;
|
|
SlashAdv = slashAdverb ;
|
|
|
|
IdRP = identRelPron ;
|
|
FunRP = funRelPron ;
|
|
RelSlash = relSlash ;
|
|
ModRS = modRelClause ;
|
|
RelCl = relSuch ;
|
|
|
|
--!
|
|
--3 Questions and imperatives
|
|
--
|
|
|
|
IDetCN d n = let np = detNounPhrase d n in {
|
|
s = \\c => np.s ! case2pform c ;
|
|
g = pgen2gen np.g ;
|
|
n = np.n
|
|
} ;
|
|
FunIP = funIntPron ;
|
|
|
|
QuestCl = questClause ;
|
|
IntSlash = intSlash ;
|
|
QuestAdv = questAdverbial ;
|
|
|
|
PosImpVP = imperVerbPhrase True ;
|
|
NegImpVP = imperVerbPhrase False ;
|
|
|
|
IndicPhrase = indicUtt ;
|
|
QuestPhrase = interrogUtt ;
|
|
ImperOne = imperUtterance singular ;
|
|
ImperMany = imperUtterance plural ;
|
|
|
|
AdvCl = advClause ;
|
|
AdvVPI = advVerbPhrase ;
|
|
|
|
AdCPhr = advSentence ;
|
|
AdvPhr = advSentence ;
|
|
|
|
TwoS = twoSentence ;
|
|
ConsS = consSentence ;
|
|
ConjS = conjunctSentence ;
|
|
ConjDS = conjunctDistrSentence ; -- [Coordination.conjunctDistrTable]
|
|
|
|
TwoAP = twoAdjPhrase ;
|
|
ConsAP = consAdjPhrase ;
|
|
ConjAP = conjunctAdjPhrase ;
|
|
ConjDAP = conjunctDistrAdjPhrase ;
|
|
|
|
TwoNP = twoNounPhrase ;
|
|
ConsNP = consNounPhrase ;
|
|
ConjNP = conjunctNounPhrase ;
|
|
ConjDNP = conjunctDistrNounPhrase ;
|
|
|
|
TwoAdv = twoAdverb ;
|
|
ConsAdv = consAdverb ;
|
|
ConjAdv = conjunctAdverb ;
|
|
ConjDAdv = conjunctDistrAdverb ;
|
|
|
|
SubjS = subjunctSentence ; -- stack
|
|
SubjImper = subjunctImperative ;
|
|
SubjQS = subjunctQuestion ;
|
|
----- SubjVP = subjunctVerbPhrase ;
|
|
AdvSubj if A = {s = if.s ++ A.s ! if.m} ;
|
|
|
|
PhrNP = useNounPhrase ;
|
|
PhrOneCN = useCommonNounPhrase singular ;
|
|
PhrManyCN = useCommonNounPhrase plural ;
|
|
PhrIP ip = postfixSS "?" ip ;
|
|
PhrIAdv ia = postfixSS "?" ia ;
|
|
PhrVPI = verbUtterance ;
|
|
|
|
OnePhr p = p ;
|
|
ConsPhr = cc2 ;
|
|
|
|
-----------------------
|
|
-- special constructions
|
|
|
|
OneNP = nounPhraseOn ;
|
|
|
|
ExistCN A = existNounPhrase (indefNounPhrase Sg A) ;
|
|
|
|
ExistNumCN nu A = existNounPhrase (indefNounPhraseNum nu A) ;
|
|
|
|
}
|