diff options
| author | aarne <aarne@cs.chalmers.se> | 2008-12-17 15:41:38 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2008-12-17 15:41:38 +0000 |
| commit | 124738068a401b872369b8f4fb957bbdcd1bda87 (patch) | |
| tree | 1038c6c8d514a5f74ed81e7f46496104bf9385dc | |
| parent | cb44a12c1be3141f69e9bb9cfb4ae6abe7ac68eb (diff) | |
completed Russian grammar with missing syntax functions (marked ---- AR 17/12/2008); their effects should be checked
| -rw-r--r-- | next-lib/src/prelude/Coordination.gf | 9 | ||||
| -rw-r--r-- | next-lib/src/russian/AdjectiveRus.gf | 18 | ||||
| -rw-r--r-- | next-lib/src/russian/ConjunctionRus.gf | 9 | ||||
| -rw-r--r-- | next-lib/src/russian/NounRus.gf | 34 | ||||
| -rw-r--r-- | next-lib/src/russian/SentenceRus.gf | 35 | ||||
| -rw-r--r-- | next-lib/src/russian/VerbRus.gf | 78 |
6 files changed, 156 insertions, 27 deletions
diff --git a/next-lib/src/prelude/Coordination.gf b/next-lib/src/prelude/Coordination.gf index 499b45306..4c7f55f40 100644 --- a/next-lib/src/prelude/Coordination.gf +++ b/next-lib/src/prelude/Coordination.gf @@ -125,5 +125,14 @@ oper s2 = xs.s2 } ; + consrTable3 : (P,Q,R : Type) -> Str -> {s : P => Q => R => Str} -> + ListTable3 P Q R -> ListTable3 P Q R = + \P,Q,R,c,x,xs -> + {s1 = table P {p => table Q {q => table R { + r => x.s ! p ! q ! r ++ c ++ xs.s1 ! p ! q ! r + }}} ; + s2 = xs.s2 + } ; + } ; diff --git a/next-lib/src/russian/AdjectiveRus.gf b/next-lib/src/russian/AdjectiveRus.gf index 1cd91e71e..5a977e371 100644 --- a/next-lib/src/russian/AdjectiveRus.gf +++ b/next-lib/src/russian/AdjectiveRus.gf @@ -16,6 +16,24 @@ flags coding=utf8 ; p = True
} ;
+ ---- AR 17/12/2008
+ UseComparA bolshoj =
+ {s = \\af => bolshoj.s ! Compar ! af ;
+ p = True
+ } ;
+
+ ---- AR 17/12/2008
+ CAdvAP ad ap np = let adp = ad.s in { ---- should be ad.p
+ s = \\af => ad.s ++ ap.s ! af ++ adp ++ np.s ! (mkPronForm Gen Yes NonPoss) ;
+ p = True ----?
+ } ;
+
+ ---- AR 17/12/2008
+ AdjOrd a = {
+ s = a.s ;
+ p = True ---- ?
+ } ;
+
-- $SuperlA$ belongs to determiner syntax in $Noun$.
ComplA2 vlublen tu =
diff --git a/next-lib/src/russian/ConjunctionRus.gf b/next-lib/src/russian/ConjunctionRus.gf index 0377fe36c..9810b5d22 100644 --- a/next-lib/src/russian/ConjunctionRus.gf +++ b/next-lib/src/russian/ConjunctionRus.gf @@ -21,6 +21,9 @@ concrete ConjunctionRus of Conjunction = ConjAP c xs = conjunctDistrTable AdjForm c xs ** {p = xs.p} ;
+ ---- AR 17/12/2008
+ ConjRS c xs = conjunctDistrTable3 GenNum Case Animacy c xs ** {p = xs.p} ;
+
-- These fun's are generated from the list cat's.
BaseS = twoSS ;
@@ -50,6 +53,9 @@ concrete ConjunctionRus of Conjunction = anim = conjAnim x.anim y.anim
} ;
+ ---- AR 17/12/2008
+ BaseRS x y = twoTable3 GenNum Case Animacy x y ** {c = y.c} ;
+ ConsRS xs x = consrTable3 GenNum Case Animacy comma xs x ** {c = xs.c} ;
@@ -63,7 +69,8 @@ concrete ConjunctionRus of Conjunction = -- if and only if all elements are prefix.
[AP] = {s1,s2 : AdjForm => Str ; p : Bool} ;
-
+ ---- AR 17/12/2008
+ [RS] = {s1,s2 : GenNum => Case => Animacy => Str} ;
oper
diff --git a/next-lib/src/russian/NounRus.gf b/next-lib/src/russian/NounRus.gf index 65ea54584..a9347ac32 100644 --- a/next-lib/src/russian/NounRus.gf +++ b/next-lib/src/russian/NounRus.gf @@ -70,7 +70,7 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { g = quant.g;
c = quant.c
} ;
-
+{-
DetArtOrd quant num ord = {
s = \\af => quant.s !af ++ num.s! (caseAF af) ! (genAF af) ++ ord.s!af ;
n = num.n ;
@@ -84,7 +84,7 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { g = quant.g;
c = quant.c
} ;
-
+-}
-- MassDet = {s = \\_=>[] ; c=Nom; g = PNoGen; n = Sg} ;
MassNP okhotnik = {
@@ -92,7 +92,7 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { a = agrP3 Sg (PGen okhotnik.g) ;
anim = okhotnik.anim
} ;
-
+{-
DetArtSg kazhduj okhotnik = {
s = \\c => -- art case always Nom (AR 17/6/2008)
kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g Sg) ++
@@ -108,7 +108,7 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { n = agrP3 Pl (case kazhduj.g of {PNoGen => PGen okhotnik.g; _ => kazhduj.g}) ;
anim = okhotnik.anim
} ;
-
+-}
PossPron p = {s = \\af => p.s ! mkPronForm (caseAF af) No (Poss (gennum (genAF af) (numAF af) )); c=Nom; g = PNoGen} ;
NumCard c = c ;
@@ -158,6 +158,22 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { c2 = f.c3 ;
} ;
+ ---- AR 17/12/2008
+ Use2N3 f = {
+ s = f.s ;
+ g = f.g ;
+ anim = f.anim ;
+ c2 = f.c2
+ } ;
+
+ ---- AR 17/12/2008
+ Use3N3 f = {
+ s = f.s ;
+ g = f.g ;
+ anim = f.anim ;
+ c2 = f.c3
+ } ;
+
-- The two main functions of adjective are in predication ("Иван - молод")
-- and in modification ("молодой человек"). Predication will be defined
@@ -195,10 +211,20 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { anim = idea.anim
} ;
+ ---- AR 17/12/2008
ApposCN cn s = {
s = \\nf => cn.s ! nf ++ s.s ! (case nf of {NF n c => PF c No NonPoss}) ;
g = cn.g ;
anim = cn.anim
} ;
+
+ RelNP np rel = {
+ s = \\c => np.s ! c ++ rel.s ! (gennum (pgen2gen np.a.g) np.a.n) ! extCase c ! np.anim ;
+ a = np.a ;
+ anim = np.anim ;
+ nComp = np.nComp
+ } ;
+
+
}
diff --git a/next-lib/src/russian/SentenceRus.gf b/next-lib/src/russian/SentenceRus.gf index cf2b64637..3b3dc8b70 100644 --- a/next-lib/src/russian/SentenceRus.gf +++ b/next-lib/src/russian/SentenceRus.gf @@ -37,16 +37,29 @@ concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { (sc.s ++ ne ++ vizhu ++ tebya) (sc.s ++ vizhu ++ ne ++ tebya) } ; -{- - SlashV2 ivan lubit = { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ - lubit.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ; - s2=lubit.s2; c=lubit.c }; - - SlashVVV2 ivan khotet lubit = - { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ khotet.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ++ lubit.s! VFORM Act VINF ; - s2=lubit.s2; - c=lubit.c }; --} + + + ---- AR 17/12/2008 + SlashVP Ya tebyaNeVizhu = { + s = \\b,clf => + let { + ya = Ya.s ! (case clf of { + ClInfinit => (mkPronForm Acc No NonPoss); + _ => (mkPronForm Nom No NonPoss) + }); + ne = case b of {Pos=>""; Neg=>"не"}; + vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.a.g Ya.a.n)! Ya.a.p; + khorosho = tebyaNeVizhu.s2 ; + tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.a.g) ! Ya.a.n + } + in + if_then_else Str tebyaNeVizhu.negBefore + (ya ++ ne ++ vizhu ++ tebya ++ khorosho) + (ya ++ vizhu ++ ne ++ tebya ++ khorosho) ; + s2=tebyaNeVizhu.s2 ; + c=tebyaNeVizhu.c + } ; + AdvSlash slash adv = { s = \\b,clf => slash.s ! b ! clf ++ adv.s ; c = slash.c; @@ -110,6 +123,8 @@ concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { AdvS a s = {s = a.s ++ "," ++ s.s} ; ---- AR 19/6/2007 + ---- AR 17/12/2008 + RelS s r = {s = s.s ++ "," ++ r.s ! gennum Neut Sg ! Nom ! Inanimate} ; ---- ? } diff --git a/next-lib/src/russian/VerbRus.gf b/next-lib/src/russian/VerbRus.gf index 13f19b797..c69f64211 100644 --- a/next-lib/src/russian/VerbRus.gf +++ b/next-lib/src/russian/VerbRus.gf @@ -191,30 +191,82 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { c = dat.c } ; -{- - ComplV3 dat tu pivo = - let - tebepivo = dat.s2 ++ - tu.s ! PF dat.c No NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss - in - {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tebepivo ; + ---- AR 17/12/2008 + SlashV2Q dat esliOnPridet = + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ esliOnPridet.s ! QDir ; asp = dat.asp ; w = Act; negBefore = True; s2 = ""; - s3 = \\g,n=> "" + s3 = \\g,n=> "" ; + sc = dat.s2 ; + c = dat.c } ; + ---- AR 17/12/2008 + SlashV2S vidit tuUlubaeshsya = + {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) + ++ [", что"] ++ tuUlubaeshsya.s ; + asp = vidit.asp; + w = Act; + s2=""; + negBefore = True; + s3 = \\g,n => "" ; + sc = vidit.s2 ; + c = vidit.c + } ; - ReflV2 v = - { s = \\clf,gn,p => v.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ v.s2 ++ sebya!v.c; - asp = v.asp ; + ---- AR 17/12/2008 + SlashV2V putatsya bezhat = + { s = \\clf,gn,p => putatsya.s ! (getActVerbForm clf (genGNum gn) + (numGNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; + asp = putatsya.asp ; w = Act; negBefore = True; s2 = ""; + s3 =\\g,n => "" ; + sc = putatsya.s2 ; + c = putatsya.c + } ; + + ---- AR 17/12/2008 + ReflVP vp = + { s = \\clf,gn,p => vp.s ! clf ! gn ! p ++ vp.s2 ++ sebya ! vp.c; + asp = vp.asp ; + w = Act ; + negBefore = True; + s2 = ""; s3 = \\g,n=> "" } ; --} + + ---- AR 17/12/2008 + SlashVV putatsya bezhat = + { s = \\clf,gn,p => putatsya.s ! (getActVerbForm clf (genGNum gn) + (numGNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; + asp = putatsya.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 =\\g,n => "" ; + sc = bezhat.s2 ; + c = bezhat.c + } ; + + ---- AR 17/12/2008 + SlashV2VNP putatsya np bezhat = + { s = \\clf,gn,p => + putatsya.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ + np.s ! (mkPronForm putatsya.c No NonPoss) ++ ---- ? + bezhat.s!ClInfinit !gn!p ; + asp = putatsya.asp ; + w = Act; + negBefore = True; + s2 = ""; + s3 =\\g,n => "" ; + sc = bezhat.s2 ; ---- ? + c = bezhat.c + } ; + -- To generate "сказал, что Иван гуляет" / "не сказал, что Иван гуляет": ComplVS vidit tuUlubaeshsya = @@ -226,6 +278,8 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { negBefore = True; s3 = \\g,n => "" } ; + + -- 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. |
