forked from GitHub/gf-rgl
*** empty log message ***
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
--1 The Top-Level Russian Resource Grammar: Combination Rules
|
--1 The Top-Level Russian Resource Grammar: Combination Rules
|
||||||
--
|
--
|
||||||
-- Aarne Ranta, Janna Khegai 2003 -- 2004
|
-- Aarne Ranta, Janna Khegai 2003 -- 2005
|
||||||
--
|
--
|
||||||
-- This is the Russian concrete syntax of the multilingual resource
|
-- This is the Russian concrete syntax of the multilingual resource
|
||||||
-- grammar. Most of the work is done in the file $SyntaxRus.gf$.
|
-- grammar. Most of the work is done in the file $SyntaxRus.gf$.
|
||||||
@@ -47,6 +47,8 @@ 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} ;
|
||||||
|
-- "Det" without "Number" field
|
||||||
|
|
||||||
N2 = Function ;
|
N2 = Function ;
|
||||||
-- = CommNounPhrase ** Complement ;
|
-- = CommNounPhrase ** Complement ;
|
||||||
@@ -63,7 +65,7 @@ lincat
|
|||||||
-- = Verb ** {s2 : Str ; s3 : Gender => Number => Str ;
|
-- = Verb ** {s2 : Str ; s3 : Gender => Number => Str ;
|
||||||
-- negBefore: Bool} ;
|
-- negBefore: Bool} ;
|
||||||
V2 = TransVerb ;
|
V2 = TransVerb ;
|
||||||
-- = Verbum ** {s2 : Str ; c: Case } ;
|
-- = Verbum ** Complement ;
|
||||||
V3 = DitransVerb ;
|
V3 = DitransVerb ;
|
||||||
-- = TransVerb ** {s4 : Str; c2: Case} ;
|
-- = TransVerb ** {s4 : Str; c2: Case} ;
|
||||||
VS = SentenceVerb ;
|
VS = SentenceVerb ;
|
||||||
@@ -71,32 +73,52 @@ lincat
|
|||||||
VV = VerbVerb ;
|
VV = VerbVerb ;
|
||||||
-- = Verbum ;
|
-- = Verbum ;
|
||||||
|
|
||||||
|
VCl = {s : Bool => Anteriority => Str} ;
|
||||||
|
-- infinitive verb phrase (in other languages very similar to VPI,
|
||||||
|
-- but without Bool=>Anteriority)
|
||||||
|
VPI = VerbPhraseInf ;
|
||||||
|
-- {s : Str; a: Aspect; w:Voice; s2 : Str ;
|
||||||
|
-- s3 : Gender => Number => Str ; negBefore: Bool} ;
|
||||||
|
-- almost the same as VP, but VF is fixed to the infinitive form
|
||||||
|
-- and the tense field is supressed
|
||||||
|
|
||||||
AdV = Adverb ;
|
Adv = Adverb ; -- sentence adverb e.g. "now", "in the house"
|
||||||
-- = {s : Str} ;
|
-- = {s : Str} ;
|
||||||
|
AdV = Adverb ;
|
||||||
|
AdA = Adverb ; -- ad-adjective e.g. "very"
|
||||||
|
AdC = Adverb ; -- conjoining adverb e.g. "therefore", "otherwise"
|
||||||
Prep = Preposition;
|
Prep = Preposition;
|
||||||
-- = {s : Str ; c: Case } ;
|
-- = {s : Str ; c: Case } ;
|
||||||
|
PP = Adverb ;
|
||||||
|
|
||||||
|
Cl = Clause ; -- clause (variable tense) e.g. "John walks"/"John walked"
|
||||||
|
-- = {s : Bool => ClForm => Str} ;
|
||||||
S = Sentence ;
|
S = Sentence ;
|
||||||
-- = {s : Str} ;
|
-- = {s : Str} ;
|
||||||
Slash = SentenceSlashNounPhrase ;
|
Slash = SentenceSlashNounPhrase ;
|
||||||
|
-- sentence without NP, e.g. "John waits for (...)"
|
||||||
-- = Sentence ** Complement ;
|
-- = Sentence ** Complement ;
|
||||||
|
|
||||||
RP = RelPron ;
|
RP = RelPron ;
|
||||||
-- = {s : GenNum => Case => Animacy => Str} ;
|
-- = {s : GenNum => Case => Animacy => Str} ;
|
||||||
RC = RelClause ;
|
RS = RelPron ;
|
||||||
-- = RelPron ;
|
RCl = RelClause ;
|
||||||
|
-- = {s : Bool => ClForm => GenNum => Case => Animacy => Str} ;
|
||||||
|
|
||||||
IP = IntPron ;
|
IP = IntPron ;
|
||||||
-- = NounPhrase ;
|
-- = NounPhrase ;
|
||||||
Qu = Question ;
|
IDet = Determiner ;
|
||||||
|
-- = Adjective ** {n: Number; g: PronGen; c: Case} ;
|
||||||
|
|
||||||
|
IAdv = Adverb ;
|
||||||
|
-- = {s : Str} ;
|
||||||
|
|
||||||
|
QS = Question ; -- question w. fixed tense
|
||||||
-- = {s : QuestForm => Str} ;
|
-- = {s : QuestForm => Str} ;
|
||||||
|
QCl = {s :Bool => ClForm => QuestForm => Str};
|
||||||
|
|
||||||
Imp = Imperative ;
|
Imp = Imperative ;
|
||||||
-- = { s: Gender => Number => Str } ;
|
-- = { s: Gender => Number => Str } ;
|
||||||
Phr = Utterance ;
|
|
||||||
-- = {s : Str} ;
|
|
||||||
|
|
||||||
Conj = Conjunction ;
|
Conj = Conjunction ;
|
||||||
-- = {s : Str ; n : Number} ;
|
-- = {s : Str ; n : Number} ;
|
||||||
@@ -110,10 +132,44 @@ 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} ;
|
||||||
|
|
||||||
PP = Adverb ;
|
Phr = Utterance ;
|
||||||
Cl = Clause ;
|
-- = {s : Str} ;
|
||||||
-- = {s : Bool => ClForm => Str} ;
|
Text = {s : Str} ;
|
||||||
|
|
||||||
|
---- next
|
||||||
|
|
||||||
|
VQ = Verbum ;
|
||||||
|
-- = {s : VerbForm => Str ; asp : Aspect } ;
|
||||||
|
VA = Verbum ;
|
||||||
|
V0 = Verbum ;
|
||||||
|
V2A = TransVerb ;
|
||||||
|
-- = Verbum ** Complement ;
|
||||||
|
V2V = TransVerb ;
|
||||||
|
V2S = TransVerb ;
|
||||||
|
V2Q = TransVerb ;
|
||||||
|
|
||||||
|
AS = Adverb ;
|
||||||
|
-- = {s : Str} ;
|
||||||
|
A2S = Adverb ** Complement;
|
||||||
|
AV = Adjective ;
|
||||||
|
-- = {s : AdjForm => Str} ;
|
||||||
|
A2V = AdjCompl ;
|
||||||
|
-- = Adjective ** Complement ;
|
||||||
|
|
||||||
|
-- NB: it is difficult to play the sonata
|
||||||
|
-- vs. it (the sonata) is difficult to play
|
||||||
|
|
||||||
|
-- also : John is easy (for you) to please vs. John is eager to please
|
||||||
|
|
||||||
|
|
||||||
|
-- similar implementation in all the languages, s-field is dummy:
|
||||||
|
|
||||||
|
TP = {s : Str ; b : Bool ; t : ClTense ; a : Anteriority} ; -- combination of the three below
|
||||||
|
Tense = {s : Str ; t : ClTense} ;
|
||||||
|
Ant = {s : Str ; a : Anteriority} ; --For time agreement:
|
||||||
|
Pol = {s : Str ; p : Bool} ; --Positive or negative statement
|
||||||
|
Subj = {s : Str} ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ lin
|
|||||||
|
|
||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
ComplA2 = complAdj ;
|
ComplA2 = complAdj ;
|
||||||
|
-- ComplAV : AV -> VPI -> AP ; -- "eager to leave"
|
||||||
|
-- ComplObjA2V : A2V -> NP -> VPI -> AP ; -- "easy for us to convince"
|
||||||
PredVP = predVerbPhrase ;
|
PredVP = predVerbPhrase ;
|
||||||
UseA = adj2adjPhrase ;
|
UseA = adj2adjPhrase ;
|
||||||
ModAP = modCommNounPhrase ;
|
ModAP = modCommNounPhrase ;
|
||||||
@@ -16,20 +18,14 @@ lin
|
|||||||
AppN3 = appFun2 ;
|
AppN3 = appFun2 ;
|
||||||
PositADeg = positAdjPhrase ;
|
PositADeg = positAdjPhrase ;
|
||||||
ComparADeg = comparAdjPhrase ;
|
ComparADeg = comparAdjPhrase ;
|
||||||
SuperlNP = superlNounPhrase ;
|
--- SuperlNP = superlNounPhrase ;
|
||||||
|
-- SuperlADeg : ADeg -> AP ; -- "the oldest"
|
||||||
|
|
||||||
|
|
||||||
CNthatS = nounThatSentence ;
|
CNthatS = nounThatSentence ;
|
||||||
UseInt i = useInt i.s;
|
UseInt i = useInt i.s;
|
||||||
NoNum = noNum ;
|
NoNum = noNum ;
|
||||||
|
|
||||||
--- these two by AR 3/6/2004
|
|
||||||
SymbPN i = {s = \\_ => i.s ; g = Neut ; anim = Inanimate} ; ---
|
|
||||||
SymbCN cn s =
|
|
||||||
{s = \\n,c => cn.s ! n ! c ++ s.s ;
|
|
||||||
g = cn.g ;
|
|
||||||
anim = cn.anim
|
|
||||||
} ;
|
|
||||||
|
|
||||||
|
|
||||||
DetNP = detNounPhrase ;
|
DetNP = detNounPhrase ;
|
||||||
IndefOneNP = indefNounPhrase Sg ;
|
IndefOneNP = indefNounPhrase Sg ;
|
||||||
@@ -37,6 +33,8 @@ 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"
|
||||||
|
-- NDetNum : NDet -> Num -> NP ; -- "these (5)"
|
||||||
|
|
||||||
PosVG = predVerbGroup True Present ;
|
PosVG = predVerbGroup True Present ;
|
||||||
NegVG = predVerbGroup False Present ;
|
NegVG = predVerbGroup False Present ;
|
||||||
@@ -53,13 +51,68 @@ lin
|
|||||||
PredVV = complVerbVerb ;
|
PredVV = complVerbVerb ;
|
||||||
VTrans = verbOfTransVerb ;
|
VTrans = verbOfTransVerb ;
|
||||||
|
|
||||||
|
-- The main uses of verbs and verb phrases have been moved to the
|
||||||
|
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
||||||
|
-- $Clause$ (shallow many-place predication structure).
|
||||||
|
|
||||||
|
-- PredAS : AS -> S -> Cl ; -- "it is good that he comes"
|
||||||
|
-- PredV0 : V0 -> Cl ; -- "it is raining"
|
||||||
|
|
||||||
|
-- Partial saturation.
|
||||||
|
|
||||||
|
-- UseV2 : V2 -> V ; -- "loves"
|
||||||
|
|
||||||
|
-- ComplA2S : A2S -> NP -> AS ; -- "good for John"
|
||||||
|
|
||||||
|
-- UseV2V : V2V -> VV ;
|
||||||
|
-- UseV2S : V2S -> VS ;
|
||||||
|
-- UseV2Q : V2Q -> VQ ;
|
||||||
|
-- UseA2S : A2S -> AS ;
|
||||||
|
-- UseA2V : A2V -> AV ;
|
||||||
|
|
||||||
|
|
||||||
|
-- Formation of tensed phrases.
|
||||||
|
|
||||||
|
-- AdjPart : V -> A ; -- past participle, e.g. "forgotten"
|
||||||
|
|
||||||
|
-- UseCl : TP -> Cl -> S ;
|
||||||
|
-- UseRCl : TP -> RCl -> RS ;
|
||||||
|
-- UseQCl : TP -> QCl -> QS ;
|
||||||
|
|
||||||
|
-- UseVCl : Pol -> Ant -> VCl -> VPI ;
|
||||||
|
|
||||||
|
-- s field is superficial:
|
||||||
|
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 = ClPresent} ;
|
||||||
|
TPast = {s = [] ; t = ClPast} ;
|
||||||
|
TFuture = {s = [] ; t = ClFuture} ;
|
||||||
|
TConditional = {s = [] ; t = ClConditional} ;
|
||||||
|
|
||||||
|
ASimul = {s = [] ; a = Simul} ;
|
||||||
|
AAnter = {s = [] ; a = Anter} ;
|
||||||
|
|
||||||
|
PPos = {s = [] ; p = True} ;
|
||||||
|
PNeg = {s = [] ; p = False} ;
|
||||||
|
|
||||||
|
|
||||||
|
-- AdvPP : PP -> Adv ; -- "in London", "after the war"
|
||||||
|
-- AdvAdv : AdA -> Adv -> Adv ; -- "very well"
|
||||||
|
|
||||||
AdjAdv a = mkAdverb (a.s ! AdvF) ;
|
AdjAdv a = mkAdverb (a.s ! AdvF) ;
|
||||||
PrepNP p = prepPhrase p ;
|
PrepNP p = prepPhrase p ;
|
||||||
AdvVP = adVerbPhrase ;
|
AdvVPI = adVerbPhraseInf ;
|
||||||
--LocNP = locativeNounPhrase ;
|
---AdvVP = adVerbPhrase ;
|
||||||
|
---LocNP = locativeNounPhrase ;
|
||||||
AdvCN = advCommNounPhrase ;
|
AdvCN = advCommNounPhrase ;
|
||||||
AdvAP = advAdjPhrase ;
|
AdvAP = advAdjPhrase ;
|
||||||
|
|
||||||
|
|
||||||
|
-- SlashV2 : NP -> V2 -> Slash ; -- "(whom) John doesn't love"
|
||||||
|
-- SlashVV2 : NP -> VV -> V2 -> Slash ; -- "(which song do you) want to play"
|
||||||
|
-- SlashAdv : Cl -> Prep -> Slash ; -- "(whom) John walks with"
|
||||||
|
|
||||||
PosSlashV2 = slashTransVerb True ;
|
PosSlashV2 = slashTransVerb True ;
|
||||||
NegSlashV2 = slashTransVerb False ;
|
NegSlashV2 = slashTransVerb False ;
|
||||||
OneVP = predVerbPhrase (pron2NounPhrase pronKtoTo Animate) ;
|
OneVP = predVerbPhrase (pron2NounPhrase pronKtoTo Animate) ;
|
||||||
@@ -71,28 +124,38 @@ lin
|
|||||||
RelSlash = relSlash ;
|
RelSlash = relSlash ;
|
||||||
ModRC = modRelClause ;
|
ModRC = modRelClause ;
|
||||||
RelSuch = relSuch ;
|
RelSuch = relSuch ;
|
||||||
|
-- RelCl : Cl -> RCl ; -- "such that it is even"
|
||||||
|
|
||||||
|
|
||||||
WhoOne = intPronKto Sg ;
|
WhoOne = intPronKto Sg ;
|
||||||
WhoMany = intPronKto Pl ;
|
WhoMany = intPronKto Pl ;
|
||||||
WhatOne = intPronChto Sg ;
|
WhatOne = intPronChto Sg ;
|
||||||
WhatMany = intPronChto Pl ;
|
WhatMany = intPronChto Pl ;
|
||||||
FunIP = funIntPron ;
|
FunIP = funIntPron ;
|
||||||
|
-- IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
||||||
|
|
||||||
NounIPOne = nounIntPron Sg ;
|
NounIPOne = nounIntPron Sg ;
|
||||||
NounIPMany = nounIntPron Pl ;
|
NounIPMany = nounIntPron Pl ;
|
||||||
|
|
||||||
QuestVP = questVerbPhrase ;
|
QuestVP = questVerbPhrase ;
|
||||||
IntVP = intVerbPhrase ;
|
---IntVP = intVerbPhrase ;
|
||||||
IntSlash = intSlash ;
|
IntSlash = intSlash ;
|
||||||
QuestAdv = questAdverbial ;
|
-- QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||||
IsThereNP = isThere ;
|
|
||||||
|
|
||||||
ImperVP = imperVerbPhrase ;
|
|
||||||
|
QuestAdv = questAdverbial ;
|
||||||
|
|
||||||
|
|
||||||
|
---ImperVP = imperVerbPhrase ;
|
||||||
|
-- PosImpVP, NegImpVP : VCl -> Imp ; -- "(don't) be a man"
|
||||||
|
|
||||||
IndicPhrase = indicUtt ;
|
IndicPhrase = indicUtt ;
|
||||||
QuestPhrase = interrogUtt ;
|
QuestPhrase = interrogUtt ;
|
||||||
ImperOne = imperUtterance Masc Sg ;
|
ImperOne = imperUtterance Masc Sg ;
|
||||||
ImperMany = imperUtterance Masc Pl ;
|
ImperMany = imperUtterance Masc Pl ;
|
||||||
AdvS = advSentence ;
|
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 ;
|
||||||
@@ -109,11 +172,24 @@ lin
|
|||||||
ConjNP = conjunctNounPhrase ;
|
ConjNP = conjunctNounPhrase ;
|
||||||
ConjDNP = conjunctDistrNounPhrase ;
|
ConjDNP = conjunctDistrNounPhrase ;
|
||||||
|
|
||||||
|
-- ConjAdv : Conj -> ListAdv -> Adv ; -- "quickly or slowly"
|
||||||
|
-- ConjDAdv : ConjD -> ListAdv -> Adv ; -- "both badly and slowly"
|
||||||
|
-- TwoAdv : Adv -> Adv -> ListAdv ;
|
||||||
|
-- ConsAdv : ListAdv -> Adv -> ListAdv ;
|
||||||
|
|
||||||
|
|
||||||
SubjS = subjunctSentence ;
|
SubjS = subjunctSentence ;
|
||||||
SubjImper = subjunctImperative ;
|
SubjImper = subjunctImperative ;
|
||||||
SubjQu = subjunctQuestion ;
|
SubjQu = subjunctQuestion ;
|
||||||
|
-- SubjQS : Subj -> S -> QS -> QS ; -- "if you are new, who are you?"
|
||||||
SubjVP = subjunctVerbPhrase ;
|
SubjVP = subjunctVerbPhrase ;
|
||||||
|
|
||||||
|
-- This rule makes a subordinate clause into a sentence adverb, which
|
||||||
|
-- can be attached to e.g. noun phrases. It might even replace the
|
||||||
|
-- previous subjunction rules.
|
||||||
|
|
||||||
|
-- AdvSubj : Subj -> S -> Adv ; -- "when he arrives"
|
||||||
|
|
||||||
PhrNP = useNounPhrase ;
|
PhrNP = useNounPhrase ;
|
||||||
PhrOneCN = useCommonNounPhrase Sg ;
|
PhrOneCN = useCommonNounPhrase Sg ;
|
||||||
PhrManyCN = useCommonNounPhrase Pl ;
|
PhrManyCN = useCommonNounPhrase Pl ;
|
||||||
@@ -122,16 +198,23 @@ lin
|
|||||||
OnePhr p = p ;
|
OnePhr p = p ;
|
||||||
ConsPhr = cc2 ;
|
ConsPhr = cc2 ;
|
||||||
|
|
||||||
|
-- PhrVPI : VPI -> Phr ; -- "Tända ljus."
|
||||||
|
|
||||||
|
--2 Special constructs.
|
||||||
|
--
|
||||||
|
-- These constructs tend to have language-specific syntactic realizations.
|
||||||
|
|
||||||
|
--- IsThereNP = isThere ;
|
||||||
|
-- ExistCN = existCN ;
|
||||||
|
-- ExistNumCN = existNumCN ;
|
||||||
|
|
||||||
|
OneNP = npOne ;
|
||||||
|
|
||||||
--New in the "lib"-version from Swedish:
|
--New in the "lib"-version from Swedish:
|
||||||
|
|
||||||
AdvPP p = p ;
|
AdvPP p = p ;
|
||||||
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
||||||
PrepS p = ss (p.s ++ ",") ;
|
PrepS p = ss (p.s ++ ",") ;
|
||||||
IntCN cn s =
|
|
||||||
{s = \\n,c => cn.s ! n ! c ++ s.s ;
|
|
||||||
g = cn.g ;
|
|
||||||
anim = cn.anim
|
|
||||||
} ;
|
|
||||||
PredVG = predVerbGroupClause ;
|
PredVG = predVerbGroupClause ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -43,6 +43,15 @@ oper
|
|||||||
NounPhrase : Type = { s : PronForm => Str ; n : Number ;
|
NounPhrase : Type = { s : PronForm => Str ; n : Number ;
|
||||||
p : Person ; g: PronGen ; anim : Animacy ; pron: Bool} ;
|
p : Person ; g: PronGen ; anim : Animacy ; pron: Bool} ;
|
||||||
|
|
||||||
|
-- No direct correspondance in Russian. Usually expressed by infinitive:
|
||||||
|
-- "Если очень захотеть, можно в космос улететь"
|
||||||
|
-- (If one really wants one can fly into the space).
|
||||||
|
-- Note that the modal verb "can" is trasferred into adverb
|
||||||
|
-- "можно" (it is possible) in Russian
|
||||||
|
-- The closest subject is "ты" (you), which is omitted in the final sentence:
|
||||||
|
-- "Если очень захочешь, можешь в космос улететь"
|
||||||
|
npOne: NounPhrase = { s=\\_=>""; n=Sg; p=P2; g=PNoGen; anim=Animate;pron=False};
|
||||||
|
|
||||||
-- The following construction has to be refined for genitive forms:
|
-- The following construction has to be refined for genitive forms:
|
||||||
-- "we two", "us two" are OK, but "our two" is not.
|
-- "we two", "us two" are OK, but "our two" is not.
|
||||||
-- actually also "Animacy" for numerals 1-4 should be resent
|
-- actually also "Animacy" for numerals 1-4 should be resent
|
||||||
@@ -408,8 +417,10 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
|||||||
|
|
||||||
VerbPhrase : Type = Verb ** {s2 : Str ; s3 : Gender => Number => Str ;
|
VerbPhrase : Type = Verb ** {s2 : Str ; s3 : Gender => Number => Str ;
|
||||||
negBefore: Bool} ;
|
negBefore: Bool} ;
|
||||||
|
|
||||||
|
VerbPhraseInf : Type = {s : Str; a: Aspect; w:Voice; s2 : Str ;
|
||||||
s3 : Gender => Number => Str ; negBefore: Bool} ;
|
s3 : Gender => Number => Str ; negBefore: Bool} ;
|
||||||
-- VerbGroup is new in "lib"-verion of the resource.
|
-- VerbGroup is new in "lib"-verion of the resource.
|
||||||
-- Unlike VerbPhrase, VerbGroup does not have RusTense parameter fixed.
|
-- Unlike VerbPhrase, VerbGroup does not have RusTense parameter fixed.
|
||||||
-- It also not yet negated (s2):
|
-- It also not yet negated (s2):
|
||||||
|
|
||||||
@@ -417,7 +428,7 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
|||||||
|
|
||||||
-- A verb can be made into a verb phrase with an empty complement.
|
-- A verb can be made into a verb phrase with an empty complement.
|
||||||
-- There are two versions, depending on if we want to negate the verb (Bool).
|
-- There are two versions, depending on if we want to negate the verb (Bool).
|
||||||
|
|
||||||
predVerbGroup : Bool -> RusTense -> VerbGroup -> VerbPhrase = \b,t, vidit ->
|
predVerbGroup : Bool -> RusTense -> VerbGroup -> VerbPhrase = \b,t, vidit ->
|
||||||
(extVerb vidit vidit.w t)** {
|
(extVerb vidit vidit.w t)** {
|
||||||
s2 = negation b ;
|
s2 = negation b ;
|
||||||
@@ -519,6 +530,10 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
|||||||
--
|
--
|
||||||
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \poet, khorosho ->
|
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \poet, khorosho ->
|
||||||
{s = \\vf => khorosho.s ++ poet.s ! vf ; s2 = poet.s2; s3 = poet.s3;
|
{s = \\vf => khorosho.s ++ poet.s ! vf ; s2 = poet.s2; s3 = poet.s3;
|
||||||
|
a = poet.a; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ;
|
||||||
|
|
||||||
|
adVerbPhraseInf : VerbPhraseInf -> Adverb -> VerbPhraseInf = \poet, khorosho ->
|
||||||
|
{s = khorosho.s ++ poet.s ; s2 = poet.s2; s3 = poet.s3;
|
||||||
a = poet.a; w = poet.w; negBefore = poet.negBefore } ;
|
a = poet.a; w = poet.w; negBefore = poet.negBefore } ;
|
||||||
|
|
||||||
-- Adverbials are typically generated by prefixing prepositions.
|
-- Adverbials are typically generated by prefixing prepositions.
|
||||||
@@ -572,8 +587,14 @@ oper
|
|||||||
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)
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
param
|
||||||
|
Anteriority = Simul | Anter ;
|
||||||
|
-- for compatibility with Rules.gf:
|
||||||
|
ClTense = ClPresent | ClPast | ClFuture | ClConditional;
|
||||||
|
|
||||||
ClForm = ClIndic RusTense Anteriority | ClCondit | ClInfinit ;
|
ClForm = ClIndic RusTense Anteriority | ClCondit | ClInfinit ;
|
||||||
-- "naked infinitive" clauses
|
-- "naked infinitive" clauses
|
||||||
@@ -588,7 +609,7 @@ oper
|
|||||||
ClInfinit => (mkPronForm Acc No NonPoss);
|
ClInfinit => (mkPronForm Acc No NonPoss);
|
||||||
_ =>(mkPronForm Nom No NonPoss)
|
_ =>(mkPronForm Nom No NonPoss)
|
||||||
});
|
});
|
||||||
vizhu = tebyaNeVizhu.s ! (case c of {
|
ne = tebyaNeVizhu.s2 ! b;
|
||||||
vizhu = tebyaNeVizhu.s ! (case c of {
|
vizhu = tebyaNeVizhu.s ! (case c of {
|
||||||
ClInfinit => VFORM tebyaNeVizhu.w (VIMP Ya.n Ya.p);
|
ClInfinit => VFORM tebyaNeVizhu.w (VIMP Ya.n Ya.p);
|
||||||
ClIndic t _ => VFORM tebyaNeVizhu.w (VIND (pgNum Ya.g Ya.n) (getVTense t Ya.p));
|
ClIndic t _ => VFORM tebyaNeVizhu.w (VIND (pgNum Ya.g Ya.n) (getVTense t Ya.p));
|
||||||
@@ -671,6 +692,12 @@ oper
|
|||||||
negBefore = True;
|
negBefore = True;
|
||||||
s3 = table{_=> table{_ => ""}} })) **
|
s3 = table{_=> table{_ => ""}} })) **
|
||||||
complementOfTransVerb lubit ;
|
complementOfTransVerb lubit ;
|
||||||
|
|
||||||
|
thereIs : NounPhrase -> Sentence = \bar ->
|
||||||
|
{s = "есть" ++ bar.s ! PF Nom No NonPoss} ;
|
||||||
|
|
||||||
|
--existCN : CommNoun -> Clause = \ bar ->
|
||||||
|
-- {s = "есть" ++ bar.s ! PF Nom No NonPoss} ;
|
||||||
|
|
||||||
--existNumCN: Numeral -> CommNoun -> Clause=\tri, bara ->
|
--existNumCN: Numeral -> CommNoun -> Clause=\tri, bara ->
|
||||||
-- {s = "есть" ++ bara.s ! PF Nom No NonPoss} ;
|
-- {s = "есть" ++ bara.s ! PF Nom No NonPoss} ;
|
||||||
@@ -706,17 +733,18 @@ oper
|
|||||||
mama.s ! nu ! c ++
|
mama.s ! nu ! c ++
|
||||||
mama.s2 ++ kotoruj.s ! gn ! mama.c ! anim
|
mama.s2 ++ kotoruj.s ! gn ! mama.c ! anim
|
||||||
} ;
|
} ;
|
||||||
-- slash expressions ("я вижу").
|
|
||||||
|
-- Relative clauses can be formed from both verb phrases ("видит Машу") and
|
||||||
-- slash expressions ("я вижу").
|
-- slash expressions ("я вижу").
|
||||||
|
|
||||||
|
RelClause : Type = {s : Bool => ClForm => GenNum => Case => Animacy => Str} ;
|
||||||
|
|
||||||
|
|
||||||
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 -> SentenceSlashNounPhrase -> RelClause =
|
} ;
|
||||||
|
|
||||||
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause =
|
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause =
|
||||||
\kotoruj, yaVizhu ->
|
\kotoruj, yaVizhu ->
|
||||||
@@ -724,7 +752,7 @@ oper
|
|||||||
++ yaVizhu.s
|
++ yaVizhu.s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- A 'degenerate' relative clause is the one often used in mathematics, e.g.
|
||||||
-- "число x, такое что x - четное".
|
-- "число x, такое что x - четное".
|
||||||
|
|
||||||
relSuch : Sentence -> RelClause = \A ->
|
relSuch : Sentence -> RelClause = \A ->
|
||||||
@@ -733,7 +761,7 @@ oper
|
|||||||
-- The main use of relative clauses is to modify common nouns.
|
-- The main use of relative clauses is to modify common nouns.
|
||||||
-- The result is a common noun, out of which noun phrases can be formed
|
-- The result is a common noun, out of which noun phrases can be formed
|
||||||
-- by determiners. A comma is used before the relative clause.
|
-- by determiners. A comma is used before the relative clause.
|
||||||
\chelovek,kotorujSmeetsya ->
|
|
||||||
modRelClause : CommNounPhrase -> RelClause -> CommNounPhrase =
|
modRelClause : CommNounPhrase -> RelClause -> CommNounPhrase =
|
||||||
\chelovek,kotorujSmeetsya ->
|
\chelovek,kotorujSmeetsya ->
|
||||||
{ s = \\n,c => chelovek.s ! n ! c ++ "," ++
|
{ s = \\n,c => chelovek.s ! n ! c ++ "," ++
|
||||||
@@ -904,6 +932,9 @@ isThere : NounPhrase -> Question = \bar ->
|
|||||||
imperUtterance : Gender -> Number -> Imperative -> Utterance = \g,n,I ->
|
imperUtterance : Gender -> Number -> Imperative -> Utterance = \g,n,I ->
|
||||||
ss (I.s ! g ! n ++ "!") ;
|
ss (I.s ! g ! n ++ "!") ;
|
||||||
--2 Sentence adverbials
|
--2 Sentence adverbials
|
||||||
|
--
|
||||||
|
-- This class covers adverbials such as "otherwise", "therefore", which are prefixed
|
||||||
|
-- to a sentence to form a phrase.
|
||||||
|
|
||||||
advSentence : SS -> Sentence -> Utterance = \sledovatelno, mamaMulaRamu ->
|
advSentence : SS -> Sentence -> Utterance = \sledovatelno, mamaMulaRamu ->
|
||||||
ss (sledovatelno.s ++ mamaMulaRamu.s ++ ".") ;
|
ss (sledovatelno.s ++ mamaMulaRamu.s ++ ".") ;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ param
|
|||||||
Case = Nom | Gen | Dat | Acc | Inst | Prepos ;
|
Case = Nom | Gen | Dat | Acc | Inst | Prepos ;
|
||||||
Voice = Act | Pass ;
|
Voice = Act | Pass ;
|
||||||
Aspect = Imperfective | Perfective ;
|
Aspect = Imperfective | Perfective ;
|
||||||
Tense = Present | Past | Future ;
|
RusTense = Present | Past | Future ;
|
||||||
Degree = Pos | Comp | Super ;
|
Degree = Pos | Comp | Super ;
|
||||||
Person = P1 | P2 | P3 ;
|
Person = P1 | P2 | P3 ;
|
||||||
AfterPrep = Yes | No ;
|
AfterPrep = Yes | No ;
|
||||||
@@ -236,7 +236,7 @@ param
|
|||||||
VTense = VPresent Person | VPast | VFuture Person ;
|
VTense = VPresent Person | VPast | VFuture Person ;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
getVTense : Tense -> Person -> VTense= \t,p ->
|
getVTense : RusTense -> Person -> VTense= \t,p ->
|
||||||
case t of { Present => VPresent p ; Past => VPast; Future => VFuture p } ;
|
case t of { Present => VPresent p ; Past => VPast; Future => VFuture p } ;
|
||||||
|
|
||||||
getVoice: VerbForm -> Voice = \vf ->
|
getVoice: VerbForm -> Voice = \vf ->
|
||||||
@@ -248,7 +248,7 @@ oper
|
|||||||
-- For writing an application grammar one usually doesn't need
|
-- For writing an application grammar one usually doesn't need
|
||||||
-- the whole inflection table, since each verb is used in
|
-- the whole inflection table, since each verb is used in
|
||||||
-- a particular context that determines some of the parameters
|
-- a particular context that determines some of the parameters
|
||||||
-- (Tense and Voice while Aspect is fixed from the beginning) for certain usage.
|
-- (RusTense and Voice while Aspect is fixed from the beginning) for certain usage.
|
||||||
-- So we define the "Verb" type, that have these parameters fixed.
|
-- So we define the "Verb" type, that have these parameters fixed.
|
||||||
-- The conjugation parameters left (Gender, Number, Person)
|
-- The conjugation parameters left (Gender, Number, Person)
|
||||||
-- are combined in the "VF" type:
|
-- are combined in the "VF" type:
|
||||||
@@ -258,9 +258,9 @@ param VF =
|
|||||||
VFin GenNum Person | VImper Number Person | VInf | VSubj GenNum;
|
VFin GenNum Person | VImper Number Person | VInf | VSubj GenNum;
|
||||||
|
|
||||||
oper
|
oper
|
||||||
Verb : Type = {s : VF => Str ; t: Tense ; a : Aspect ; w: Voice} ;
|
Verb : Type = {s : VF => Str ; t: RusTense ; a : Aspect ; w: Voice} ;
|
||||||
|
|
||||||
extVerb : Verbum -> Voice -> Tense -> Verb = \aller, vox, t ->
|
extVerb : Verbum -> Voice -> RusTense -> Verb = \aller, vox, t ->
|
||||||
{ s = table {
|
{ s = table {
|
||||||
VFin gn p => case t of {
|
VFin gn p => case t of {
|
||||||
Present => aller.s ! VFORM vox (VIND gn (VPresent p)) ;
|
Present => aller.s ! VFORM vox (VIND gn (VPresent p)) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user