mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-22 19:22:50 -06:00
*** empty log message ***
This commit is contained in:
@@ -47,7 +47,7 @@ lincat
|
|||||||
|
|
||||||
Det = Determiner ;
|
Det = Determiner ;
|
||||||
-- = Adjective ** {n: Number; g: PronGen; c: Case} ;
|
-- = Adjective ** {n: Number; g: PronGen; c: Case} ;
|
||||||
NDet = Adjective ** {g: PronGen; c: Case} ;
|
NDet = NoNumberDeterminer ;
|
||||||
-- "Det" without "Number" field
|
-- "Det" without "Number" field
|
||||||
|
|
||||||
N2 = Function ;
|
N2 = Function ;
|
||||||
@@ -95,9 +95,9 @@ lincat
|
|||||||
-- = {s : Bool => ClForm => Str} ;
|
-- = {s : Bool => ClForm => Str} ;
|
||||||
S = Sentence ;
|
S = Sentence ;
|
||||||
-- = {s : Str} ;
|
-- = {s : Str} ;
|
||||||
Slash = SentenceSlashNounPhrase ;
|
Slash = SlashNounPhrase ;
|
||||||
-- sentence without NP, e.g. "John waits for (...)"
|
-- = Clause ** Complement ;
|
||||||
-- = Sentence ** Complement ;
|
-- = {s : Bool => ClForm => Str; s2: Str; c: Case} ;
|
||||||
|
|
||||||
RP = RelPron ;
|
RP = RelPron ;
|
||||||
-- = {s : GenNum => Case => Animacy => Str} ;
|
-- = {s : GenNum => Case => Animacy => Str} ;
|
||||||
@@ -109,13 +109,14 @@ lincat
|
|||||||
-- = NounPhrase ;
|
-- = NounPhrase ;
|
||||||
IDet = Determiner ;
|
IDet = Determiner ;
|
||||||
-- = Adjective ** {n: Number; g: PronGen; c: Case} ;
|
-- = Adjective ** {n: Number; g: PronGen; c: Case} ;
|
||||||
|
|
||||||
IAdv = Adverb ;
|
IAdv = Adverb ;
|
||||||
-- = {s : Str} ;
|
-- = {s : Str} ;
|
||||||
|
|
||||||
QS = Question ; -- question w. fixed tense
|
QS = Question ; -- question w. fixed tense
|
||||||
-- = {s : QuestForm => Str} ;
|
-- = {s : QuestForm => Str} ;
|
||||||
QCl = {s :Bool => ClForm => QuestForm => Str};
|
QCl = QuestionCl ;
|
||||||
|
-- = {s :Bool => ClForm => QuestForm => Str};
|
||||||
|
|
||||||
Imp = Imperative ;
|
Imp = Imperative ;
|
||||||
-- = { s: Gender => Number => Str } ;
|
-- = { s: Gender => Number => Str } ;
|
||||||
@@ -132,7 +133,8 @@ lincat
|
|||||||
ListNP = ListNounPhrase ;
|
ListNP = ListNounPhrase ;
|
||||||
-- = { s1,s2 : PronForm => Str ; g: Gender ; anim : Animacy ;
|
-- = { s1,s2 : PronForm => Str ; g: Gender ; anim : Animacy ;
|
||||||
-- n : Number ; p : Person ; pron : Bool } ;
|
-- n : Number ; p : Person ; pron : Bool } ;
|
||||||
ListAdv= {s1 : Str ; s2 : Str} ;
|
ListAdv= ListAdverb ;
|
||||||
|
-- = {s1, s2 : Str} ;
|
||||||
|
|
||||||
Phr = Utterance ;
|
Phr = Utterance ;
|
||||||
-- = {s : Str} ;
|
-- = {s : Str} ;
|
||||||
@@ -153,7 +155,7 @@ lincat
|
|||||||
AS = Adverb ;
|
AS = Adverb ;
|
||||||
-- = {s : Str} ;
|
-- = {s : Str} ;
|
||||||
A2S = Adverb ** Complement;
|
A2S = Adverb ** Complement;
|
||||||
AV = Adjective ;
|
AV = Adjective ; --- "eager to leave"
|
||||||
-- = {s : AdjForm => Str} ;
|
-- = {s : AdjForm => Str} ;
|
||||||
A2V = AdjCompl ;
|
A2V = AdjCompl ;
|
||||||
-- = Adjective ** Complement ;
|
-- = Adjective ** Complement ;
|
||||||
|
|||||||
@@ -5,9 +5,8 @@ lin
|
|||||||
|
|
||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
ComplA2 = complAdj ;
|
ComplA2 = complAdj ;
|
||||||
-- ComplAV : AV -> VPI -> AP ; -- "eager to leave"
|
ComplAV = complVerbAdj ;
|
||||||
-- ComplObjA2V : A2V -> NP -> VPI -> AP ; -- "easy for us to convince"
|
ComplObjA2V = complObjA2V ;
|
||||||
PredVP = predVerbPhrase ;
|
|
||||||
UseA = adj2adjPhrase ;
|
UseA = adj2adjPhrase ;
|
||||||
ModAP = modCommNounPhrase ;
|
ModAP = modCommNounPhrase ;
|
||||||
UseN = noun2CommNounPhrase ;
|
UseN = noun2CommNounPhrase ;
|
||||||
@@ -18,8 +17,7 @@ lin
|
|||||||
AppN3 = appFun2 ;
|
AppN3 = appFun2 ;
|
||||||
PositADeg = positAdjPhrase ;
|
PositADeg = positAdjPhrase ;
|
||||||
ComparADeg = comparAdjPhrase ;
|
ComparADeg = comparAdjPhrase ;
|
||||||
--- SuperlNP = superlNounPhrase ;
|
SuperlADeg = superlAdjPhrase ;
|
||||||
-- SuperlADeg : ADeg -> AP ; -- "the oldest"
|
|
||||||
|
|
||||||
|
|
||||||
CNthatS = nounThatSentence ;
|
CNthatS = nounThatSentence ;
|
||||||
@@ -33,23 +31,23 @@ lin
|
|||||||
DefOneNP = indefNounPhrase Sg ;
|
DefOneNP = indefNounPhrase Sg ;
|
||||||
DefNumNP = indefNounPhraseNum Pl ;
|
DefNumNP = indefNounPhraseNum Pl ;
|
||||||
MassNP = indefNounPhrase Sg;
|
MassNP = indefNounPhrase Sg;
|
||||||
-- NDetNP : NDet -> Num -> CN -> NP ; -- "these (5) cars"
|
NDetNP = nDetNP ;
|
||||||
-- NDetNum : NDet -> Num -> NP ; -- "these (5)"
|
NDetNum = nDetNum ;
|
||||||
|
|
||||||
PosVG = predVerbGroup True Present ;
|
--- PosVG = predVerbGroup True Present ;
|
||||||
NegVG = predVerbGroup False Present ;
|
--- NegVG = predVerbGroup False Present ;
|
||||||
|
--- PredVP = predVerbPhrase ;
|
||||||
PredV = predVerb ;
|
--- PredV = predVerb ;
|
||||||
PredAP = predAdjective ;
|
--- PredAP = predAdjective ;
|
||||||
PredCN = predCommNoun ;
|
--- PredCN = predCommNoun ;
|
||||||
PredV2 = complTransVerb ;
|
--- PredV2 = complTransVerb ;
|
||||||
PredV3 = complDitransVerb ;
|
--- PredV3 = complDitransVerb ;
|
||||||
PredPassV = predPassVerb ;
|
--- PredPassV = predPassVerb ;
|
||||||
PredNP = predNounPhrase ;
|
--- PredNP = predNounPhrase ;
|
||||||
PredPP = predAdverb ;
|
--- PredPP = predAdverb ;
|
||||||
PredVS = complSentVerb ;
|
--- PredVS = complSentVerb ;
|
||||||
PredVV = complVerbVerb ;
|
--- PredVV = complVerbVerb ;
|
||||||
VTrans = verbOfTransVerb ;
|
--- VTrans = verbOfTransVerb ;
|
||||||
|
|
||||||
-- The main uses of verbs and verb phrases have been moved to the
|
-- The main uses of verbs and verb phrases have been moved to the
|
||||||
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
||||||
@@ -97,65 +95,67 @@ lin
|
|||||||
PNeg = {s = [] ; p = False} ;
|
PNeg = {s = [] ; p = False} ;
|
||||||
|
|
||||||
|
|
||||||
-- AdvPP : PP -> Adv ; -- "in London", "after the war"
|
AdvPP x = x ;
|
||||||
-- AdvAdv : AdA -> Adv -> Adv ; -- "very well"
|
AdvAdv = advAdv ;
|
||||||
|
|
||||||
AdjAdv a = mkAdverb (a.s ! AdvF) ;
|
AdjAdv a = mkAdverb (a.s ! AdvF) ;
|
||||||
PrepNP p = prepPhrase p ;
|
PrepNP p = prepPhrase p ;
|
||||||
AdvVPI = adVerbPhraseInf ;
|
AdvVPI = adVerbPhraseInf ;
|
||||||
---AdvVP = adVerbPhrase ;
|
|
||||||
---LocNP = locativeNounPhrase ;
|
|
||||||
AdvCN = advCommNounPhrase ;
|
AdvCN = advCommNounPhrase ;
|
||||||
AdvAP = advAdjPhrase ;
|
AdvAP = advAdjPhrase ;
|
||||||
|
|
||||||
|
AdvCl = advClause ;
|
||||||
|
AdCPhr = advSentencePhr ;
|
||||||
|
AdvPhr = advSentencePhr ;
|
||||||
|
|
||||||
|
---AdvVP = adVerbPhrase ;
|
||||||
|
---LocNP = locativeNounPhrase ;
|
||||||
|
|
||||||
|
|
||||||
|
IdRP = identRelPron ;
|
||||||
|
FunRP = funRelPron ;
|
||||||
|
|
||||||
|
RelCl = relCl;
|
||||||
|
RelSlash = relSlash ;
|
||||||
|
|
||||||
|
--- ModRC = modRelClause ;
|
||||||
|
--- RelSuch = relSuch ;
|
||||||
|
--- RelVP = relVerbPhrase ;
|
||||||
|
--- PosSlashV2 = slashTransVerb True ;
|
||||||
|
--- NegSlashV2 = slashTransVerb False ;
|
||||||
|
--- OneVP = predVerbPhrase (pron2NounPhrase pronKtoTo Animate) ;
|
||||||
|
--- ThereNP = thereIs ;
|
||||||
|
|
||||||
|
--- WhoOne = intPronKto Sg ;
|
||||||
|
--- WhoMany = intPronKto Pl ;
|
||||||
|
--- WhatOne = intPronChto Sg ;
|
||||||
|
--- WhatMany = intPronChto Pl ;
|
||||||
|
--- NounIPOne = nounIntPron Sg ;
|
||||||
|
--- NounIPMany = nounIntPron Pl ;
|
||||||
|
--- SuperlNP = superlNounPhrase ;
|
||||||
|
--- QuestVP = questVerbPhrase ;
|
||||||
|
--- IntVP = intVerbPhrase ;
|
||||||
|
--- ImperVP = imperVerbPhrase ;
|
||||||
|
|
||||||
|
FunIP = funIntPron ;
|
||||||
|
QuestAdv = questAdverbial ;
|
||||||
|
|
||||||
|
IndicPhrase = indicUtt ;
|
||||||
|
QuestPhrase = interrogUtt ;
|
||||||
|
ImperOne = imperUtterance Masc Sg ;
|
||||||
|
ImperMany = imperUtterance Masc Pl ;
|
||||||
|
|
||||||
|
-- IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
||||||
|
|
||||||
-- SlashV2 : NP -> V2 -> Slash ; -- "(whom) John doesn't love"
|
-- SlashV2 : NP -> V2 -> Slash ; -- "(whom) John doesn't love"
|
||||||
-- SlashVV2 : NP -> VV -> V2 -> Slash ; -- "(which song do you) want to play"
|
-- SlashVV2 : NP -> VV -> V2 -> Slash ; -- "(which song do you) want to play"
|
||||||
-- SlashAdv : Cl -> Prep -> Slash ; -- "(whom) John walks with"
|
-- SlashAdv : Cl -> Prep -> Slash ; -- "(whom) John walks with"
|
||||||
|
|
||||||
PosSlashV2 = slashTransVerb True ;
|
-- IntSlash = intSlash ;
|
||||||
NegSlashV2 = slashTransVerb False ;
|
-- QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||||
OneVP = predVerbPhrase (pron2NounPhrase pronKtoTo Animate) ;
|
|
||||||
ThereNP = thereIs ;
|
|
||||||
|
|
||||||
IdRP = identRelPron ;
|
|
||||||
FunRP = funRelPron ;
|
|
||||||
RelVP = relVerbPhrase ;
|
|
||||||
RelSlash = relSlash ;
|
|
||||||
ModRC = modRelClause ;
|
|
||||||
RelSuch = relSuch ;
|
|
||||||
-- RelCl : Cl -> RCl ; -- "such that it is even"
|
|
||||||
|
|
||||||
|
|
||||||
WhoOne = intPronKto Sg ;
|
|
||||||
WhoMany = intPronKto Pl ;
|
|
||||||
WhatOne = intPronChto Sg ;
|
|
||||||
WhatMany = intPronChto Pl ;
|
|
||||||
FunIP = funIntPron ;
|
|
||||||
-- IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
|
||||||
|
|
||||||
NounIPOne = nounIntPron Sg ;
|
|
||||||
NounIPMany = nounIntPron Pl ;
|
|
||||||
|
|
||||||
QuestVP = questVerbPhrase ;
|
|
||||||
---IntVP = intVerbPhrase ;
|
|
||||||
IntSlash = intSlash ;
|
|
||||||
-- QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
|
||||||
|
|
||||||
|
|
||||||
QuestAdv = questAdverbial ;
|
|
||||||
|
|
||||||
|
|
||||||
---ImperVP = imperVerbPhrase ;
|
|
||||||
-- PosImpVP, NegImpVP : VCl -> Imp ; -- "(don't) be a man"
|
-- PosImpVP, NegImpVP : VCl -> Imp ; -- "(don't) be a man"
|
||||||
|
|
||||||
IndicPhrase = indicUtt ;
|
|
||||||
QuestPhrase = interrogUtt ;
|
|
||||||
ImperOne = imperUtterance Masc Sg ;
|
|
||||||
ImperMany = imperUtterance Masc Pl ;
|
|
||||||
AdvCl = advClause ;
|
|
||||||
-- AdCPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
|
||||||
-- AdvPhr : Adv -> S -> Phr ; -- "In India, there are tigers."
|
|
||||||
|
|
||||||
TwoS = twoSentence ;
|
TwoS = twoSentence ;
|
||||||
ConsS = consSentence ;
|
ConsS = consSentence ;
|
||||||
@@ -172,23 +172,24 @@ lin
|
|||||||
ConjNP = conjunctNounPhrase ;
|
ConjNP = conjunctNounPhrase ;
|
||||||
ConjDNP = conjunctDistrNounPhrase ;
|
ConjDNP = conjunctDistrNounPhrase ;
|
||||||
|
|
||||||
-- ConjAdv : Conj -> ListAdv -> Adv ; -- "quickly or slowly"
|
ConjAdv = conjAdverb ;
|
||||||
-- ConjDAdv : ConjD -> ListAdv -> Adv ; -- "both badly and slowly"
|
ConjDAdv = conjDAdverb ;
|
||||||
-- TwoAdv : Adv -> Adv -> ListAdv ;
|
TwoAdv = twoAdverb ;
|
||||||
-- ConsAdv : ListAdv -> Adv -> ListAdv ;
|
ConsAdv = consAdverb ;
|
||||||
|
|
||||||
|
|
||||||
SubjS = subjunctSentence ;
|
SubjQS = subjQS ;
|
||||||
SubjImper = subjunctImperative ;
|
|
||||||
SubjQu = subjunctQuestion ;
|
|
||||||
-- SubjQS : Subj -> S -> QS -> QS ; -- "if you are new, who are you?"
|
|
||||||
SubjVP = subjunctVerbPhrase ;
|
|
||||||
|
|
||||||
-- This rule makes a subordinate clause into a sentence adverb, which
|
-- This rule makes a subordinate clause into a sentence adverb, which
|
||||||
-- can be attached to e.g. noun phrases. It might even replace the
|
-- can be attached to e.g. noun phrases. It might even replace the
|
||||||
-- previous subjunction rules.
|
-- previous subjunction rules.
|
||||||
|
|
||||||
-- AdvSubj : Subj -> S -> Adv ; -- "when he arrives"
|
AdvSubj = advSubj ;
|
||||||
|
|
||||||
|
--- SubjS = subjunctSentence ;
|
||||||
|
--- SubjImper = subjunctImperative ;
|
||||||
|
--- SubjQu = subjunctQuestion ;
|
||||||
|
--- SubjVP = subjunctVerbPhrase ;
|
||||||
|
|
||||||
PhrNP = useNounPhrase ;
|
PhrNP = useNounPhrase ;
|
||||||
PhrOneCN = useCommonNounPhrase Sg ;
|
PhrOneCN = useCommonNounPhrase Sg ;
|
||||||
@@ -197,8 +198,7 @@ lin
|
|||||||
PhrIAdv ia = postfixSS "?" ia ;
|
PhrIAdv ia = postfixSS "?" ia ;
|
||||||
OnePhr p = p ;
|
OnePhr p = p ;
|
||||||
ConsPhr = cc2 ;
|
ConsPhr = cc2 ;
|
||||||
|
PhrVPI = phrVPI ;
|
||||||
-- PhrVPI : VPI -> Phr ; -- "Tända ljus."
|
|
||||||
|
|
||||||
--2 Special constructs.
|
--2 Special constructs.
|
||||||
--
|
--
|
||||||
@@ -210,12 +210,5 @@ lin
|
|||||||
|
|
||||||
OneNP = npOne ;
|
OneNP = npOne ;
|
||||||
|
|
||||||
--New in the "lib"-version from Swedish:
|
|
||||||
|
|
||||||
AdvPP p = p ;
|
|
||||||
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
|
||||||
PrepS p = ss (p.s ++ ",") ;
|
|
||||||
PredVG = predVerbGroupClause ;
|
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -108,8 +108,57 @@ Numeral : Type = {s : Case => Gender => Str} ;
|
|||||||
-- The determined noun has the case parameter specific for the determiner:
|
-- The determined noun has the case parameter specific for the determiner:
|
||||||
|
|
||||||
Determiner : Type = Adjective ** { n: Number; g: PronGen; c : Case } ;
|
Determiner : Type = Adjective ** { n: Number; g: PronGen; c : Case } ;
|
||||||
|
NoNumberDeterminer = Adjective ** {g: PronGen; c: Case} ;
|
||||||
|
|
||||||
anyPlDet = kakojNibudDet ** {n = Pl; c= Nom} ;
|
anyPlDet = kakojNibudDet ** {n = Pl; c= Nom} ;
|
||||||
|
|
||||||
|
iDetCN : Determiner -> CommNounPhrase -> IntPron = \kakoj, okhotnik ->
|
||||||
|
{s = \\c => case kakoj.c of {
|
||||||
|
Nom =>
|
||||||
|
kakoj.s ! AF (extCase c) okhotnik.anim (gNum okhotnik.g kakoj.n) ++
|
||||||
|
okhotnik.s ! kakoj.n ! (extCase c) ;
|
||||||
|
_ =>
|
||||||
|
kakoj.s ! AF (extCase c) okhotnik.anim (gNum okhotnik.g kakoj.n) ++
|
||||||
|
okhotnik.s ! kakoj.n ! kakoj.c };
|
||||||
|
n = kakoj.n ;
|
||||||
|
p = P3 ;
|
||||||
|
pron = False;
|
||||||
|
g = kakoj.g ;
|
||||||
|
anim = okhotnik.anim
|
||||||
|
} ;
|
||||||
|
|
||||||
|
nDetNP : NoNumberDeterminer -> Numeral -> CommNounPhrase -> NounPhrase =\eti,pyat, okhotnik ->
|
||||||
|
{ s=\\c => case eti.c of {
|
||||||
|
Nom =>
|
||||||
|
eti.s ! AF (extCase c) Inanimate (gNum (pgen2gen eti.g) Pl) ++
|
||||||
|
pyat.s ! (extCase c) ! (pgen2gen eti.g)++ okhotnik.s ! Pl ! (extCase c);
|
||||||
|
_ =>
|
||||||
|
eti.s ! AF (extCase c) Inanimate (gNum (pgen2gen eti.g) Pl) ++
|
||||||
|
pyat.s ! eti.c ! (pgen2gen eti.g) ++ okhotnik.s ! Pl ! eti.c };
|
||||||
|
|
||||||
|
n = Pl ;
|
||||||
|
p = P3 ;
|
||||||
|
pron = False;
|
||||||
|
g = eti.g ;
|
||||||
|
anim = okhotnik.anim
|
||||||
|
};
|
||||||
|
|
||||||
|
nDetNum: NoNumberDeterminer -> Numeral -> NounPhrase =\eti,pyat ->
|
||||||
|
{ s=\\c => case eti.c of {
|
||||||
|
Nom =>
|
||||||
|
eti.s ! AF (extCase c) Inanimate (gNum (pgen2gen eti.g) Pl) ++
|
||||||
|
pyat.s ! (extCase c) ! (pgen2gen eti.g);
|
||||||
|
_ =>
|
||||||
|
eti.s ! AF (extCase c) Inanimate (gNum (pgen2gen eti.g) Pl) ++
|
||||||
|
pyat.s ! eti.c ! (pgen2gen eti.g) };
|
||||||
|
|
||||||
|
n = Pl ;
|
||||||
|
p = P3 ;
|
||||||
|
pron = False;
|
||||||
|
g = eti.g ;
|
||||||
|
anim = Inanimate
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
mkDeterminerNum : Determiner -> Numeral -> Determiner = \vse,dva ->
|
mkDeterminerNum : Determiner -> Numeral -> Determiner = \vse,dva ->
|
||||||
{s =\\af => vse.s ! af ++ dva.s ! (caseAF af) ! (genAF af) ;
|
{s =\\af => vse.s ! af ++ dva.s ! (caseAF af) ! (genAF af) ;
|
||||||
@@ -279,6 +328,18 @@ pgNum : PronGen -> Number -> GenNum = \g,n ->
|
|||||||
p = True
|
p = True
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
complVerbAdj : Adjective -> VerbPhraseInf -> AdjPhrase = \zhazhduuchii,zhit ->
|
||||||
|
{s = \\af => zhazhduuchii.s ! af ++ zhit.s2 ++ zhit.s ;
|
||||||
|
p = True
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
complObjA2V: AdjCompl -> NounPhrase -> VerbPhraseInf -> AdjPhrase =
|
||||||
|
\ legkii, mu, zapomnit ->
|
||||||
|
{ s = \\af => legkii.s ! AdvF ++ zapomnit.s2 ++ zapomnit.s ++
|
||||||
|
mu. s ! (mkPronForm legkii.c No NonPoss);
|
||||||
|
p = True
|
||||||
|
};
|
||||||
--3 Complements
|
--3 Complements
|
||||||
--
|
--
|
||||||
|
|
||||||
@@ -547,6 +608,9 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
|||||||
mkAdverb (na.s2 ++ stol.s ! PF na.c Yes NonPoss) ;
|
mkAdverb (na.s2 ++ stol.s ! PF na.c Yes NonPoss) ;
|
||||||
|
|
||||||
locativeNounPhrase : NounPhrase -> Adverb = \ivan ->
|
locativeNounPhrase : NounPhrase -> Adverb = \ivan ->
|
||||||
|
{s = "в" ++ ivan.s ! (mkPronForm Prepos Yes NonPoss) } ;
|
||||||
|
|
||||||
|
advAdv : Adverb -> Adverb -> Adverb =\ochen, khorosho ->
|
||||||
{s = ochen.s ++ khorosho.s};
|
{s = ochen.s ++ khorosho.s};
|
||||||
|
|
||||||
mkAdverb : Str -> Adverb = \well -> ss well ;
|
mkAdverb : Str -> Adverb = \well -> ss well ;
|
||||||
@@ -563,6 +627,8 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
|||||||
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \ochen, khorosho ->
|
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \ochen, khorosho ->
|
||||||
{s = \\a => ochen.s ++ khorosho.s ! a ;
|
{s = \\a => ochen.s ++ khorosho.s ! a ;
|
||||||
p = khorosho.p
|
p = khorosho.p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--2 Sentences
|
--2 Sentences
|
||||||
@@ -574,8 +640,8 @@ oper
|
|||||||
oper
|
oper
|
||||||
Sentence : Type = { s : Str } ;
|
Sentence : Type = { s : Str } ;
|
||||||
|
|
||||||
-- This is the traditional $S -> NP VP$ rule.
|
-- This is the traditional $S -> NP VP$ rule.
|
||||||
|
|
||||||
predVerbPhrase : NounPhrase -> VerbPhrase -> SlashNounPhrase =
|
predVerbPhrase : NounPhrase -> VerbPhrase -> SlashNounPhrase =
|
||||||
\Ya, tebyaNeVizhu -> { s = \\b,clf =>
|
\Ya, tebyaNeVizhu -> { s = \\b,clf =>
|
||||||
let
|
let
|
||||||
@@ -585,20 +651,20 @@ oper
|
|||||||
tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n
|
tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
if_then_else Str tebyaNeVizhu.negBefore
|
if_then_else Str tebyaNeVizhu.negBefore
|
||||||
(ya ++ ne ++ vizhu ++ tebya)
|
(ya ++ ne ++ vizhu ++ tebya)
|
||||||
|
(ya ++ vizhu ++ ne ++ tebya)
|
||||||
|
;
|
||||||
s2= "";
|
s2= "";
|
||||||
c = Nom
|
c = Nom
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
param
|
param
|
||||||
Anteriority = Simul | Anter ;
|
|
||||||
Anteriority = Simul | Anter ;
|
Anteriority = Simul | Anter ;
|
||||||
-- for compatibility with Rules.gf:
|
-- for compatibility with Rules.gf:
|
||||||
ClTense = ClPresent | ClPast | ClFuture | ClConditional;
|
ClTense = ClPresent | ClPast | ClFuture | ClConditional;
|
||||||
ClForm = ClIndic RusTense Anteriority | ClCondit | ClInfinit ;
|
ClForm = ClIndic RusTense Anteriority | ClCondit | ClInfinit ;
|
||||||
-- "naked infinitive" clauses
|
-- "naked infinitive" clauses
|
||||||
|
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Clause = {s : Bool => ClForm => Str} ;
|
Clause = {s : Bool => ClForm => Str} ;
|
||||||
@@ -623,7 +689,7 @@ oper
|
|||||||
(ya ++ vizhu ++ ne ++ tebya)
|
(ya ++ vizhu ++ ne ++ tebya)
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- This is a macro for simultaneous predication and complementation.
|
-- This is a macro for simultaneous predication and complementation.
|
||||||
|
|
||||||
predTransVerb : Bool -> TransVerb -> NounPhrase -> NounPhrase -> Sentence =
|
predTransVerb : Bool -> TransVerb -> NounPhrase -> NounPhrase -> Sentence =
|
||||||
\b,vizhu,ya,tu -> {s= (predVerbPhrase ya (predVerbGroup b Present (complTransVerb vizhu tu))).s!True!ClIndic Present Simul};
|
\b,vizhu,ya,tu -> {s= (predVerbPhrase ya (predVerbGroup b Present (complTransVerb vizhu tu))).s!True!ClIndic Present Simul};
|
||||||
@@ -678,9 +744,9 @@ oper
|
|||||||
-- $S/NP$.
|
-- $S/NP$.
|
||||||
-- We cannot have - nor would we want to have - a productive slash-category former.
|
-- We cannot have - nor would we want to have - a productive slash-category former.
|
||||||
-- Perhaps a handful more will be needed.
|
-- Perhaps a handful more will be needed.
|
||||||
--
|
--
|
||||||
-- Notice that the slash category has the same relation to sentences as
|
-- Notice that the slash category has the same relation to sentences as
|
||||||
-- transitive verbs have to verbs: it's like a *sentence taking a complement*.
|
-- transitive verbs have to verbs: it's like a *sentence taking a complement*.
|
||||||
|
|
||||||
SlashNounPhrase = Clause ** Complement ;
|
SlashNounPhrase = Clause ** Complement ;
|
||||||
|
|
||||||
@@ -709,7 +775,7 @@ thereIs : NounPhrase -> Sentence = \bar ->
|
|||||||
-- $coordination.gf$. The overall structure is independent of category,
|
-- $coordination.gf$. The overall structure is independent of category,
|
||||||
-- but there can be differences in parameter dependencies.
|
-- but there can be differences in parameter dependencies.
|
||||||
--
|
--
|
||||||
--3 Conjunctions
|
--3 Conjunctions
|
||||||
--
|
--
|
||||||
-- Coordinated phrases are built by using conjunctions, which are either
|
-- Coordinated phrases are built by using conjunctions, which are either
|
||||||
-- simple ("и", "или") or distributed ("как - так", "либо - либо").
|
-- simple ("и", "или") or distributed ("как - так", "либо - либо").
|
||||||
@@ -742,10 +808,10 @@ oper
|
|||||||
|
|
||||||
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \kotoruj, gulyaet ->
|
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \kotoruj, gulyaet ->
|
||||||
{ s = \\b,clf,gn, c, anim => let { nu = numGNum gn } in
|
{ s = \\b,clf,gn, c, anim => let { nu = numGNum gn } in
|
||||||
kotoruj.s ! gn ! c ! anim ++ gulyaet.s2 ++ gulyaet.s ! VFin gn P3 ++
|
kotoruj.s ! gn ! c ! anim ++ gulyaet.s2 ++ gulyaet.s ! VFin gn P3 ++
|
||||||
gulyaet.s3 ! genGNum gn ! nu
|
gulyaet.s3 ! genGNum gn ! nu
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
relSlash : RelPron -> SlashNounPhrase -> RelClause =
|
relSlash : RelPron -> SlashNounPhrase -> RelClause =
|
||||||
\kotoruj, yaVizhu ->
|
\kotoruj, yaVizhu ->
|
||||||
{s = \\b,clf,gn, _ , anim => yaVizhu.s2 ++ kotoruj.s ! gn ! yaVizhu.c ! anim
|
{s = \\b,clf,gn, _ , anim => yaVizhu.s2 ++ kotoruj.s ! gn ! yaVizhu.c ! anim
|
||||||
@@ -754,6 +820,9 @@ oper
|
|||||||
|
|
||||||
-- A 'degenerate' relative clause is the one often used in mathematics, e.g.
|
-- A 'degenerate' relative clause is the one often used in mathematics, e.g.
|
||||||
-- "число x, такое что x - четное".
|
-- "число x, такое что x - четное".
|
||||||
|
|
||||||
|
relSuch : Sentence -> RelClause = \A ->
|
||||||
|
{s = \\b,clf,gn,c, anim => takoj.s ! AF c anim gn ++ "что" ++ A.s } ;
|
||||||
|
|
||||||
relCl : Clause -> RelClause =\ A ->
|
relCl : Clause -> RelClause =\ A ->
|
||||||
{s = \\b,clf,gn,c, anim => takoj.s ! AF c anim gn ++ "что" ++ A.s !b!clf};
|
{s = \\b,clf,gn,c, anim => takoj.s ! AF c anim gn ++ "что" ++ A.s !b!clf};
|
||||||
@@ -843,6 +912,12 @@ oper
|
|||||||
-- about on this level. In semantically rich GF grammars, texts, dialogues, etc,
|
-- about on this level. In semantically rich GF grammars, texts, dialogues, etc,
|
||||||
-- will of course play an important role as categories not reducible to utterances.
|
-- will of course play an important role as categories not reducible to utterances.
|
||||||
-- An example is proof texts, whose semantics show a dependence between premises
|
-- An example is proof texts, whose semantics show a dependence between premises
|
||||||
|
-- and conclusions. Another example is intersentential anaphora.
|
||||||
|
|
||||||
|
Utterance = SS ;
|
||||||
|
|
||||||
|
indicUtt : Sentence -> Utterance = \x -> postfixSS "." (defaultSentence x) ;
|
||||||
|
interrogUtt : Question -> Utterance = \x -> postfixSS "?" (defaultQuestion x) ;
|
||||||
|
|
||||||
advSentencePhr : Adverb -> Sentence -> Utterance =\ a,sen ->
|
advSentencePhr : Adverb -> Sentence -> Utterance =\ a,sen ->
|
||||||
{s = a.s ++ ","++ sen.s};
|
{s = a.s ++ ","++ sen.s};
|
||||||
@@ -851,8 +926,10 @@ oper
|
|||||||
{s = v.s ++ v.s2 ++ v.s3!Masc!Sg} ;
|
{s = v.s ++ v.s2 ++ v.s3!Masc!Sg} ;
|
||||||
|
|
||||||
--2 Questions
|
--2 Questions
|
||||||
|
--
|
||||||
-- Questions are either direct ("Ты счастлив?")
|
-- Questions are either direct ("Ты счастлив?")
|
||||||
-- or indirect ("Потом он спросил счастлив ли ты").
|
-- or indirect ("Потом он спросил счастлив ли ты").
|
||||||
|
|
||||||
param
|
param
|
||||||
QuestForm = DirQ | IndirQ ;
|
QuestForm = DirQ | IndirQ ;
|
||||||
|
|
||||||
@@ -885,12 +962,12 @@ isThere : NounPhrase -> Question = \bar ->
|
|||||||
questVerbPhrase
|
questVerbPhrase
|
||||||
({s = \\_ => ["есть ли"] ; n = bar.n ; p = P3; g = bar.g; anim = bar.anim; pron = bar.pron})
|
({s = \\_ => ["есть ли"] ; n = bar.n ; p = P3; g = bar.g; anim = bar.anim; pron = bar.pron})
|
||||||
(predVerbGroup True Present (predNounPhrase bar)) ;
|
(predVerbGroup True Present (predNounPhrase bar)) ;
|
||||||
|
|
||||||
--3 Wh-questions
|
--3 Wh-questions
|
||||||
--
|
--
|
||||||
-- Wh-questions are of two kinds: ones that are like $NP - VP$ sentences,
|
-- Wh-questions are of two kinds: ones that are like $NP - VP$ sentences,
|
||||||
-- others that are like $S/NP - NP$ sentences.
|
-- others that are like $S/NP - NP$ sentences.
|
||||||
|
|
||||||
intVerbPhrase : IntPron -> VerbPhrase -> Question = \kto,spit ->
|
intVerbPhrase : IntPron -> VerbPhrase -> Question = \kto,spit ->
|
||||||
{s = table { _ => (predVerbPhrase kto spit).s!True!ClIndic Present Simul}
|
{s = table { _ => (predVerbPhrase kto spit).s!True!ClIndic Present Simul}
|
||||||
} ;
|
} ;
|
||||||
@@ -907,12 +984,16 @@ isThere : NounPhrase -> Question = \bar ->
|
|||||||
-- expressions. In addition, they can be formed by adding prepositions
|
-- expressions. In addition, they can be formed by adding prepositions
|
||||||
-- to interrogative pronouns, in the same way as adverbials are formed
|
-- to interrogative pronouns, in the same way as adverbials are formed
|
||||||
-- from noun phrases. N.B. we rely on record subtyping when ignoring the
|
-- from noun phrases. N.B. we rely on record subtyping when ignoring the
|
||||||
-- position component.
|
-- position component.
|
||||||
|
|
||||||
IntAdverb = SS ;
|
IntAdverb = SS ;
|
||||||
|
|
||||||
-- A question adverbial can be applied to anything, and whether this makes
|
-- A question adverbial can be applied to anything, and whether this makes
|
||||||
-- sense is a semantic question.
|
-- sense is a semantic question.
|
||||||
|
|
||||||
|
questAdverbial_1 : IntAdverb -> NounPhrase -> VerbPhrase -> Question =
|
||||||
|
\kak, tu, pozhivaesh ->
|
||||||
|
{s = \\q => kak.s ++ tu.s ! (mkPronForm Nom No NonPoss) ++
|
||||||
pozhivaesh.s2 ++ pozhivaesh.s ! VFin (gNum (pgen2gen tu.g) tu.n) tu.p ++
|
pozhivaesh.s2 ++ pozhivaesh.s ! VFin (gNum (pgen2gen tu.g) tu.n) tu.p ++
|
||||||
pozhivaesh.s3 ! (pgen2gen tu.g) ! tu.n } ;
|
pozhivaesh.s3 ! (pgen2gen tu.g) ! tu.n } ;
|
||||||
|
|
||||||
@@ -951,7 +1032,7 @@ isThere : NounPhrase -> Question = \bar ->
|
|||||||
|
|
||||||
ListSentence : Type = SD2 ;
|
ListSentence : Type = SD2 ;
|
||||||
|
|
||||||
twoSentence : (_,_ : Sentence) -> ListSentence = CO.twoSS ;
|
twoSentence : (_,_ : Sentence) -> ListSentence = CO.twoSS ;
|
||||||
|
|
||||||
consSentence : ListSentence -> Sentence -> ListSentence =
|
consSentence : ListSentence -> Sentence -> ListSentence =
|
||||||
CO.consSS CO.comma ;
|
CO.consSS CO.comma ;
|
||||||
@@ -965,6 +1046,20 @@ isThere : NounPhrase -> Question = \bar ->
|
|||||||
ss (CO.conjunctX c xs) ;
|
ss (CO.conjunctX c xs) ;
|
||||||
|
|
||||||
-- To coordinate a list of sentences by a distributed conjunction, we place
|
-- To coordinate a list of sentences by a distributed conjunction, we place
|
||||||
|
-- the first part (e.g. "как") in front of the first element, the second
|
||||||
|
-- part ("так и") between the last two elements, and commas in the other slots.
|
||||||
|
-- For sentences this is really not used.
|
||||||
|
|
||||||
|
conjunctDistrSentence : ConjunctionDistr -> ListSentence -> Sentence =
|
||||||
|
\c,xs ->
|
||||||
|
ss (CO.conjunctDistrX c xs) ;
|
||||||
|
|
||||||
|
--3 Coordinating adverbs
|
||||||
|
--
|
||||||
|
ListAdverb : Type = CO.ListX ;
|
||||||
|
|
||||||
|
twoAdverb : (_,_ : Adverb) -> ListAdverb = CO.twoSS;
|
||||||
|
|
||||||
consAdverb : ListAdverb -> Adverb -> ListAdverb =
|
consAdverb : ListAdverb -> Adverb -> ListAdverb =
|
||||||
CO.consSS CO.comma ;
|
CO.consSS CO.comma ;
|
||||||
|
|
||||||
@@ -1074,13 +1169,20 @@ isThere : NounPhrase -> Question = \bar ->
|
|||||||
\if, A, B ->
|
\if, A, B ->
|
||||||
ss (subjunctVariants if A.s B.s) ;
|
ss (subjunctVariants if A.s B.s) ;
|
||||||
|
|
||||||
|
subjunctImperative : Subjunction -> Sentence -> Imperative -> Imperative =
|
||||||
|
\if, A, B ->
|
||||||
|
{s = \\g,n => subjunctVariants if A.s (B.s ! g ! n)} ;
|
||||||
|
|
||||||
subjunctQuestion : Subjunction -> Sentence -> Question -> Question =
|
subjunctQuestion : Subjunction -> Sentence -> Question -> Question =
|
||||||
\if, A, B ->
|
\if, A, B ->
|
||||||
{s = \\q => subjunctVariants if A.s (B.s ! q)} ;
|
{s = \\q => subjunctVariants if A.s (B.s ! q)} ;
|
||||||
|
|
||||||
subjQS : Subjunction -> Sentence -> Question -> Question =
|
subjQS : Subjunction -> Sentence -> Question -> Question =
|
||||||
\ if, sen, que ->
|
\ if, sen, que ->
|
||||||
|
{s = \\qf => if.s ++ sen.s ++ que.s ! qf };
|
||||||
|
|
||||||
|
subjunctVerbPhrase: VerbPhrase -> Subjunction -> Sentence -> VerbPhrase =
|
||||||
|
\V, if, A -> adVerbPhrase V (mkAdverb (if.s ++ A.s)) ;
|
||||||
|
|
||||||
subjunctVariants : Subjunction -> Str -> Str -> Str = \if,A,B ->
|
subjunctVariants : Subjunction -> Str -> Str -> Str = \if,A,B ->
|
||||||
variants {if.s ++ A ++ "," ++ B ; B ++ "," ++ if.s ++ A} ;
|
variants {if.s ++ A ++ "," ++ B ; B ++ "," ++ if.s ++ A} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user