mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-09-16 07:16:02 -06:00
*** empty log message ***
This commit is contained in:
@@ -43,11 +43,20 @@ oper
|
||||
NounPhrase : Type = { s : PronForm => Str ; n : Number ;
|
||||
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:
|
||||
-- "we two", "us two" are OK, but "our two" is not.
|
||||
-- actually also "Animacy" for numerals 1-4 should be resent
|
||||
|
||||
Numeral : Type = {s : Case => Gender => Str} ;
|
||||
Numeral : Type = {s : Case => Gender => Str} ;
|
||||
|
||||
pronWithNum : NounPhrase -> Numeral -> NounPhrase = \mu,dva ->
|
||||
{s = \\pf => mu.s!pf ++ dva.s ! (extCase pf) ! (pgen2gen mu.g) ;
|
||||
@@ -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 ;
|
||||
negBefore: Bool} ;
|
||||
|
||||
VerbPhraseInf : Type = {s : Str; a: Aspect; w:Voice; s2 : Str ;
|
||||
s3 : Gender => Number => Str ; negBefore: Bool} ;
|
||||
-- VerbGroup is new in "lib"-verion of the resource.
|
||||
-- Unlike VerbPhrase, VerbGroup does not have Tense parameter fixed.
|
||||
-- Unlike VerbPhrase, VerbGroup does not have RusTense parameter fixed.
|
||||
-- It also not yet negated (s2):
|
||||
|
||||
VerbGroup : Type = Verbum ** {w: Voice; s2 : Bool => Str ; s3 : Gender => Number => Str ; negBefore: Bool};
|
||||
@@ -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.
|
||||
-- There are two versions, depending on if we want to negate the verb (Bool).
|
||||
|
||||
predVerbGroup : Bool -> Tense -> VerbGroup -> VerbPhrase = \b,t, vidit ->
|
||||
predVerbGroup : Bool -> RusTense -> VerbGroup -> VerbPhrase = \b,t, vidit ->
|
||||
(extVerb vidit vidit.w t)** {
|
||||
s2 = negation b ;
|
||||
s3 = vidit.s3 ;
|
||||
@@ -451,7 +462,7 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
||||
-- Verb phrases can also be formed from adjectives (" молод"),
|
||||
-- common nouns (" человек"), and noun phrases (" самый молодой").
|
||||
-- The third rule is overgenerating: " каждый человек" has to be ruled out
|
||||
-- on semantic grounds.
|
||||
-- on semantic grounds.␍
|
||||
-- Note: we omit a dash "-" because it will cause problems with negation word order:
|
||||
-- "Я не - волшебник". Alternatively, we can consider verb-based VP and
|
||||
-- all the rest.
|
||||
@@ -518,6 +529,10 @@ let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
|
||||
adVerbPhrase : VerbPhrase -> Adverb -> VerbPhrase = \poet, khorosho ->
|
||||
{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 } ;
|
||||
|
||||
-- Adverbials are typically generated by prefixing prepositions.
|
||||
-- The rule for creating locative noun phrases by the preposition "в"
|
||||
@@ -572,8 +587,14 @@ oper
|
||||
(ya ++ ne ++ vizhu ++ tebya)
|
||||
(ya ++ vizhu ++ ne ++ tebya)␍
|
||||
} ;
|
||||
|
||||
param
|
||||
ClForm = ClIndic Tense | ClCondit | ClInfinit ; -- "naked infinitive" clauses
|
||||
Anteriority = Simul | Anter ;
|
||||
-- for compatibility with Rules.gf:
|
||||
ClTense = ClPresent | ClPast | ClFuture | ClConditional;
|
||||
|
||||
ClForm = ClIndic RusTense Anteriority | ClCondit | ClInfinit ;
|
||||
-- "naked infinitive" clauses
|
||||
|
||||
oper
|
||||
Clause = {s : Bool => ClForm => Str} ;
|
||||
@@ -588,7 +609,7 @@ oper
|
||||
ne = tebyaNeVizhu.s2 ! b;
|
||||
vizhu = tebyaNeVizhu.s ! (case c of {
|
||||
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));
|
||||
ClCondit => VFORM tebyaNeVizhu.w (VIND (pgNum Ya.g Ya.n) VPast)
|
||||
});
|
||||
tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n
|
||||
@@ -633,7 +654,7 @@ oper
|
||||
-- in the parameter structure.
|
||||
|
||||
VerbVerb : Type = Verbum ;
|
||||
|
||||
␍
|
||||
-- To generate "can walk"/"can't walk"; "tries to walk"/"does not try to walk":
|
||||
-- The contraction of "not" is not provided, since it would require changing
|
||||
-- the verb parameter type.
|
||||
@@ -671,6 +692,12 @@ oper
|
||||
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 ->
|
||||
-- {s = "есть" ++ bara.s ! PF Nom No NonPoss} ;
|
||||
|
||||
--2 Coordination
|
||||
--
|
||||
-- Coordination is to some extent orthogonal to the rest of syntax, and
|
||||
@@ -706,17 +733,18 @@ oper
|
||||
-- Relative clauses can be formed from both verb phrases ("видит Машу") and
|
||||
-- slash expressions ("я вижу").
|
||||
|
||||
RelClause : Type = RelPron ;
|
||||
RelClause : Type = {s : Bool => ClForm => GenNum => Case => Animacy => Str} ;
|
||||
|
||||
|
||||
relVerbPhrase : RelPron -> VerbPhrase -> RelClause = \kotoruj, gulyaet ->
|
||||
{ s = \\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 ++
|
||||
gulyaet.s3 ! genGNum gn ! nu
|
||||
} ;
|
||||
|
||||
relSlash : RelPron -> SentenceSlashNounPhrase -> RelClause =
|
||||
\kotoruj, yaVizhu ->
|
||||
{s = \\gn, _ , anim => yaVizhu.s2 ++ kotoruj.s ! gn ! yaVizhu.c ! anim
|
||||
{s = \\b,clf,gn, _ , anim => yaVizhu.s2 ++ kotoruj.s ! gn ! yaVizhu.c ! anim
|
||||
++ yaVizhu.s
|
||||
} ;
|
||||
|
||||
@@ -724,7 +752,7 @@ oper
|
||||
-- "число x, такое что x - четное".
|
||||
|
||||
relSuch : Sentence -> RelClause = \A ->
|
||||
{s = \\gn,c, anim => takoj.s ! AF c anim gn ++ "что" ++ A.s } ;
|
||||
{s = \\b,clf,gn,c, anim => takoj.s ! AF c anim gn ++ "что" ++ A.s } ;
|
||||
|
||||
-- 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
|
||||
@@ -733,8 +761,8 @@ oper
|
||||
modRelClause : CommNounPhrase -> RelClause -> CommNounPhrase =
|
||||
\chelovek,kotorujSmeetsya ->
|
||||
{ s = \\n,c => chelovek.s ! n ! c ++ "," ++
|
||||
kotorujSmeetsya.s ! gNum chelovek.g n ! Nom ! chelovek.anim;
|
||||
g = chelovek.g ;
|
||||
kotorujSmeetsya.s ! True ! ClIndic Present Simul ! gNum chelovek.g n ! Nom ! chelovek.anim;
|
||||
g = chelovek.g ;
|
||||
anim = chelovek.anim
|
||||
} ;
|
||||
|
||||
@@ -904,6 +932,9 @@ isThere : NounPhrase -> Question = \bar ->
|
||||
advSentence : SS -> Sentence -> Utterance = \sledovatelno, mamaMulaRamu ->
|
||||
ss (sledovatelno.s ++ mamaMulaRamu.s ++ ".") ;
|
||||
|
||||
advClause: Clause -> Adverb -> Clause = \muPostroimGorod , skoro ->
|
||||
{ s= \\b,clf => skoro.s++muPostroimGorod.s!b!clf};
|
||||
|
||||
--3 Coordinating sentences
|
||||
--
|
||||
-- We need a category of lists of sentences. It is a discontinuous
|
||||
@@ -1140,7 +1171,7 @@ VFORM _ (VIND (ASg _) (VFuture P1))=> "буду"++ masha.s ! (mkPronForm Inst N
|
||||
-- infinitive does not save GenNum,
|
||||
-- but indicative does for the sake of adjectival predication !
|
||||
VFORM _ (VIND gn (VPresent _)) => zloj.s ! AF Nom Animate gn ;
|
||||
VFORM _ (VIND (ASg Fem) VPast) => "была" ++ zloj.s! AF Nom Animate (ASg Fem);
|
||||
VFORM _ (VIND (ASg Fem) VPast) => "была" ++ zloj.s! AF Nom Animate (ASg Fem);␍
|
||||
VFORM _ (VIND (ASg Masc) VPast) => "был" ++ zloj.s! AF Nom Animate (ASg Masc);
|
||||
VFORM _ (VIND (ASg Neut) VPast) => "был" ++ zloj.s! AF Nom Animate (ASg Neut);
|
||||
VFORM _ (VIND APl VPast) => "были" ++ zloj.s! AF Nom Animate APl;
|
||||
|
||||
Reference in New Issue
Block a user