*** empty log message ***

This commit is contained in:
janna
2004-01-04 21:03:27 +00:00
parent 1dcf3b8f50
commit 122d2592b2
4 changed files with 192 additions and 136 deletions

View File

@@ -269,7 +269,7 @@ oper pronChtoTo: Pronoun =
{ s = table {
PF Nom _ _ => "что-то" ;
PF Gen _ _ => "чего-то" ;
PF Dat _ _ => "чему-то" ;
PF Dat _ _ => "чему-то" ;
PF Acc _ _ => "что-то" ;
PF Inst _ _ => "чем-то" ;
PF Prepos _ _ => "чём-то"
@@ -1022,7 +1022,7 @@ oper verbPredpochitat : Verbum = verbDecl Imperfective First "предпочит
-- 2 Adverbs
oper vsegda: Adverb = { s = "всегда" } ;
oper chorosho: Adverb = { s = "хорошо" } ;
@@ -1051,52 +1051,67 @@ oper AspectVoice: Type = { s : VerbConj => Str ; asp: Aspect } ;
oper verbBegat : Verbum = verbDecl Imperfective First "бега" "ю" "бегал" "бегай" "бегать";
oper verbPrinimat : Verbum = verbDecl Imperfective First "принима" "ю" "принимал" "принимай" "принимать";
oper verbDokazuvat : Verbum = verbDecl Imperfective First "доказыва" "ю" "доказывал" "доказывай" "доказывать";
oper verbPredpochitat : Verbum = verbDecl Imperfective First "предпочита" "ю" "предпочитал" "предпочитай" "предпочитать";
oper verbPredpochitat : Verbum = verbDecl Imperfective First "предпочита" "ю" "предпочитал" "предпочитай" "предпочитать";
oper verbOtpravlyat : Verbum = verbDecl Imperfective First "отправля" "ю" "отправлял" "отправляй" "отправлять";
oper verbSlomat : Verbum = verbDecl Perfective First "слома" "ю" "сломал" "сломай" "сломать";
oper verbByut : Verbum = verbDecl Perfective First "буд" "у" "был" "будь" "быть";
oper verbMoch : Verbum = verbDecl Imperfective First "мог" "у" "мог" "моги" "мочь";
-- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink) :
oper verbDavat : Verbum = verbDecl Imperfective FirstE "да" "ю" "давал" "давай" "давать";
oper verbPit : Verbum = verbDecl Imperfective FirstE "пь" "ю" "пил" "пей" "пить";
oper verbMoch : Verbum = verbDeclMoch Imperfective First "мог" "у" "мог" "моги" "мочь" "мож";
-- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink) :
oper verbDavat : Verbum = verbDecl Imperfective FirstE "да" "ю" "давал" "давай" "давать";
oper verbPit : Verbum = verbDecl Imperfective FirstE "пь" "ю" "пил" "пей" "пить";
--3 Second conjugation (in Present) verbs :
oper verbLubit : Verbum = verbDecl Imperfective Second "люб" "лю" "любил" "люби" "любить";
oper verbGovorit : Verbum = verbDecl Imperfective Second "говор" "ю" "говорил" "говори" "говорить";
oper verbBolet_2 : Verbum = verbDecl Imperfective Second "бол" "ю" "болел" "боли" "болеть";
oper verbPoranit : Verbum = verbDecl Perfective Second "поран" "ю" "поранил" "порань" "поранить";
oper verbLubit : Verbum = verbDecl Imperfective Second "люб" "лю" "любил" "люби" "любить";
oper verbGovorit : Verbum = verbDecl Imperfective Second "говор" "ю" "говорил" "говори" "говорить";
oper verbBolet_2 : Verbum = verbDecl Imperfective Second "бол" "ю" "болел" "боли" "болеть";
oper verbPoranit : Verbum = verbDecl Perfective Second "поран" "ю" "поранил" "порань" "поранить";
-- Irregular Mixed:
oper verbKhotet : Verbum = verbDecl Imperfective Mixed "хоч" "у" "хотел" "хоти" "хотеть";
-- Irregular
oper verbDolzhen : Verbum = verbDecl Imperfective Dolzhen "долж" "ен" "долж" ["будь должен"] ["быть должным"] ;
-- To reduces the redundancies in the definitions
-- we introduce some intermediate types,
-- Irregular
oper verbDolzhen : Verbum = verbDecl Imperfective Dolzhen "долж" "ен" "долж" ["будь должен"] ["быть должным"] ;
-- To reduces the redundancies in the definitions
-- we introduce some intermediate types,
-- so that the full type can be described as a combination
-- so that the full type can be described as a combination
-- of the intermediate types. For example "AspectVoice"
-- is a type for defining a pattern for a particular
-- aspect and voice.
oper AspectVoice: Type = { s : VerbConj => Str ; asp: Aspect } ;
-- "PresentVerb" takes care of the present tense conjugation.
param PresentVF = PRF GenNum Person;
oper AspectVoice: Type = { s : VerbConj => Str ; asp: Aspect } ;
-- "PresentVerb" takes care of the present tense conjugation.
param PresentVF = PRF Number Person ;
oper PresentVerb : Type = PresentVF => Str ;
oper PresentVerb : Type = PresentVF => Str ;
oper presentConjDolzhen: Str -> Str -> PresentVerb = \del, sgP1End ->
table {
PRF APl _ => del+ "ны" ;
PRF (ASg Masc) P1 => del+ sgP1End ;
PRF (ASg Fem) P1 => del+ "на" ;
PRF (ASg Neut) P1 => del+ "но" ;
PRF (ASg Masc) P2 => del+ sgP1End ;
PRF (ASg Fem) P2 => del+ "на" ;
PRF Sg P2 => del+ sgP1End ;
PRF Sg P3 => del+ "на" ;
PRF Pl _ => del+ "ны"
};
oper presentConjMixed: Str -> Str -> PresentVerb = \del, sgP1End ->
PRF (ASg Neut) P2 => del+ "но" ;
PRF (ASg Masc) P3 => del+ sgP1End ;
PRF (ASg Fem) P3 => del+ "на" ;
PRF (ASg Neut) P3 => del+ "но" };
oper presentConjMixed: Str -> Str -> PresentVerb = \del, sgP1End ->
table {
PRF (ASg _) P1 => del+ sgP1End ;
PRF (ASg _) P2 => del+ "ешь" ;
PRF (ASg _) P3 => del+ "ет" ;
PRF APl P1 => del+ "им" ;
PRF APl P2 => del+ "ите" ;
PRF APl P3 => del+ "ят"
};
oper presentConj2: Str -> Str -> PresentVerb = \del, sgP1End ->
table {
PRF (ASg _) P1 => del+ sgP1End ;
PRF (ASg _) P2 => del+ "ишь" ;
PRF (ASg _) P3 => del+ "ит" ;
@@ -1140,6 +1155,14 @@ oper verbDecl: Aspect -> Conjugation -> Str -> Str -> Str -> Str ->Str -> Verbum
-- "PastVerb" takes care of the past tense conjugation.
param PastVF = PSF GenNum ;
oper PastVerb : Type = PastVF => Str ;
oper pastConj: Str -> PastVerb = \del ->
table {
PSF (ASg Masc) => del ;
PSF (ASg Fem) => del +"а" ;
PSF (ASg Neut) => del+"о" ;
PSF APl => del+ "и"
};
oper pastConjDolzhen: Str -> PastVerb = \del ->
table {
@@ -1206,25 +1229,25 @@ oper
VIMP Sg P2 => av.s ! (VIMP Sg P2 ) +"сь";
VIMP Pl P2 => av.s! (VIMP Pl P2) +"сь";
VIMP Sg P3 => av.s ! (VIMP Sg P3) +"ся";
VIMP Pl P3 => av.s ! (VIMP Pl P3) +"ся";
VIMP Pl P3 => av.s ! (VIMP Pl P3) +"ся";
VSUB (ASg Masc) => pv ! (PSF (ASg Masc)) + "ся"+[" бы"];
VSUB (ASg Fem) => pv ! (PSF (ASg Fem)) + "сь"+[" бы"];
VSUB (ASg Neut) => pv ! (PSF (ASg Neut)) + "сь"+[" бы"];
VSUB APl => pv ! (PSF APl) + "сь"+[" бы"] ;
-- case av.asp of { Imperfective =>
av.s ! (VIND (VPresent Sg P1)) + "сь" ;
-- Perfective = > nonExist
-- } ;
VIND (VPresent Sg P2) => av.s ! (VIND (VPresent Sg P2))+ "ся" ;
VIND (VPresent Sg P3) => av.s ! (VIND (VPresent Sg P3))+ "ся" ;
VIND (VPresent Pl P1) => av.s !( VIND (VPresent Pl P1)) + "ся" ;
VIND (VPresent Pl P2) => av.s !( VIND (VPresent Pl P2)) + "сь'" ;
VIND (VPresent Pl P3) => av.s !( VIND (VPresent Pl P3)) + "ся" ;
VIND (VFuture Sg P1) => av.s ! (VIND (VFuture Sg P1)) + "сь";
VIND (VFuture Sg P2) => av.s! (VIND (VFuture Sg P2) )+ "ся";
VIND (VPresent Sg P1) =>
-- case av.asp of { Imperfective =>
av.s ! (VIND (VPresent Sg P1)) + "сь" ;
-- Perfective = > nonExist
-- } ;
VIND (VPresent Sg P2) => av.s ! (VIND (VPresent Sg P2))+ "ся" ;
VIND (VPresent Sg P3) => av.s ! (VIND (VPresent Sg P3))+ "ся" ;
VIND (VPresent Pl P1) => av.s !( VIND (VPresent Pl P1)) + "ся" ;
VIND (VPresent Pl P2) => av.s !( VIND (VPresent Pl P2)) + "сь'" ;
VIND (VPresent Pl P3) => av.s !( VIND (VPresent Pl P3)) + "ся" ;
VIND (VFuture Sg P1) => av.s ! (VIND (VFuture Sg P1)) + "сь";
VIND (VFuture Sg P2) => av.s! (VIND (VFuture Sg P2) )+ "ся";
VIND (VFuture Sg P3) => av.s! (VIND (VFuture Sg P3)) + "ся";
VIND (VFuture Pl P1) => av.s! (VIND (VFuture Pl P1) )+ "ся";
@@ -1237,12 +1260,12 @@ oper
VIND (VPast APl) => av.s ! (VIND (VPast APl)) + "сь"
} ;
asp = av.asp
};
};
-- Generation the imperfective active pattern given
oper
-- a number of basic conjugation forms.
oper
imperfectiveActivePattern : Str -> Str -> PresentVerb -> PastVerb -> AspectVoice =
\inf, imper, presentFuture, past -> { s= table {
@@ -1254,12 +1277,12 @@ oper
VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF (ASg Masc) P3) ;
VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF APl P3) ;
VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"];
VSUB (ASg Neut) => past ! (PSF (ASg Neut) )+[" бы"];
VSUB APl => past ! (PSF APl) +[" бы"];
VIND (VPresent Sg P1) => presentFuture ! ( PRF Sg P1);
VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"];
VSUB (ASg Neut) => past ! (PSF (ASg Neut) )+[" бы"];
VSUB APl => past ! (PSF APl) +[" бы"];
VIND (VPresent Sg P1) => presentFuture ! ( PRF (ASg Masc) P1);
VIND (VPresent Sg P2) => presentFuture! (PRF (ASg Masc) P2) ;
VIND (VPresent Sg P3) => presentFuture ! (PRF (ASg Masc) P3) ;

View File

@@ -59,9 +59,9 @@ lin
ThisNP = det2NounPhrase etotDet ; -- inanimate form only
ThatNP = det2NounPhrase totDet ; -- inanimate form only
TheseNP n = { s =\\_ => [] ; n = Pl; p = P3; g=Fem ; anim = Animate ; pron = True} ;
TheseNP n = { s =\\_ => [] ; n = Pl; p = P3; g= PGen Fem ; anim = Animate ; pron = True} ;
-- missing in Russian
ThoseNP n = { s =\\_ => [] ; n = Pl; p = P3; g=Fem ; anim = Animate ; pron = True} ;
ThoseNP n = { s =\\_ => [] ; n = Pl; p = P3; g=PGen Fem ; anim = Animate ; pron = True} ;
-- missing in Russian
EverybodyNP = mkNounPhrase Pl (noun2CommNounPhrase (eEnd_Decl "вс")) ;
@@ -85,6 +85,7 @@ WantVV = extVerb verbKhotet Act Present ;
OrConj = ss "или" ** {n = Sg} ;
BothAnd = sd2 "как" [", так"] ** {n = Pl} ;
EitherOr = sd2 "либо" [", либо"] ** {n = Sg} ;
-- comma is not visible in GUI!
-- In case of "neither.. no" expression double negation is not
-- only possible, but also required in Russian.

View File

@@ -41,51 +41,56 @@ oper
oper
NounPhrase : Type = { s : PronForm => Str ; n : Number ;
p : Person ; g: Gender ; anim : Animacy ; pron: Bool} ;
p : Person ; g: PronGen ; anim : Animacy ; pron: Bool} ;
-- 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} ;
pronWithNum : NounPhrase -> Numeral -> NounPhrase = \mu,dva ->
{s = \\pf => mu.s!pf ++ dva.s ! (extCase pf) ! mu.g ;
{s = \\pf => mu.s!pf ++ dva.s ! (extCase pf) ! (pgen2gen mu.g) ;
n = mu.n ; p = mu.p; g = mu.g ; pron = mu.pron; anim = mu.anim } ;
noNum : Numeral = {s = \\_,_ => []} ;
-- unclear how to tell apart the numbers from their string representation,
-- so just leave a decimal representation, without case-suffixes:
useInt : Str -> Numeral = \i ->
{s = table {
Nom => table {_ => i };
Gen => table {_ => i ++ "'-х"};
Dat => table {_ => i ++ "'-м"};
Acc => table {_ => i };
Inst => table {_ => i ++ "-мя"};
Prepos => table {_ => i ++ "'-х"}
{s = table { _ => table {_ => i }
-- Nom => table {_ => i };
-- Gen => table {_ => i ++ "-х"};
-- Dat => table {_ => i ++ "'-м"};
-- Acc => table {_ => i };
-- Inst => table {_ => i ++ "-мя"};
-- Prepos => table {_ => i ++ "-х"}
}
} ;
-- A function specific for Russian for setting the gender for
-- personal pronouns in first and second person, singular :
setNPGender : Gender -> NounPhrase -> NounPhrase = \gen, pronI ->
{ s = pronI.s ; g = gen ; anim = pronI.anim ;
{ s = pronI.s ; g = PGen gen; anim = pronI.anim ;
n = pronI.n ; nComp = pronI.nComp ; p = pronI.p ; pron = pronI.pron } ;
mkNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n,chelovek ->
{s = \\cas => chelovek.s ! n ! (extCase cas) ;
n = n ; g = chelovek.g ; p = P3 ; pron =False ;
n = n ; g = PGen chelovek.g ; p = P3 ; pron =False ;
anim = chelovek.anim
} ;
pron2NounPhrase : Pronoun -> Animacy -> NounPhrase = \ona, anim ->
{s = ona.s ; n = ona.n ; g = pgen2gen ona.g ;
{s = ona.s ; n = ona.n ; g = ona.g ;
pron = ona.pron; p = ona.p ; anim = anim } ;
det2NounPhrase : Adjective -> NounPhrase = \eto ->
{s = \\pf => eto.s ! (AF (extCase pf) Inanimate (ASg Neut)); n = Sg ; g = Neut ; pron = False ; p = P3 ; anim = Inanimate } ;
{s = \\pf => eto.s ! (AF (extCase pf) Inanimate (ASg Neut)); n = Sg ; g = PGen Neut ; pron = False ; p = P3 ; anim = Inanimate } ;
nameNounPhrase : ProperName -> NounPhrase =
\masha -> {s = \\c => masha.s ! (extCase c) ;
p = P3; g = masha.g ; anim = masha.anim ;
p = P3; g = PGen masha.g ; anim = masha.anim ;
n = Sg; nComp = Sg; pron = False} ;
@@ -120,17 +125,18 @@ oper
n = kazhduj.n ;
p = P3 ;
pron = False;
g = case kazhduj.g of { PNoGen => okhotnik.g; _=> pgen2gen kazhduj.g } ;
g = kazhduj.g ;
anim = okhotnik.anim
} ;
indefNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n ->
indefNounPhraseNum n noNum ;
-- a problem: "2 бутылки", but "5 бутылок" in Nominative case! Ignored for the moment:
indefNounPhraseNum : Number -> Numeral ->CommNounPhrase -> NounPhrase =
\n,dva,mashina ->
{s = \\c => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ;
n = n ; p = P3; g = mashina.g ; anim = mashina.anim ;
n = n ; p = P3; g = PGen mashina.g ; anim = mashina.anim ;
pron = False
} ;
@@ -157,7 +163,7 @@ oper
False => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ++
masha.s ! (mkPronForm Gen No (Poss (gNum mashina.g n)))
} ;
n = n ; p = P3 ; g = mashina.g ; anim = mashina.anim ; pron = False
n = n ; p = P3 ; g = PGen mashina.g ; anim = mashina.anim ; pron = False
} ;
-- Constructions like "the idea that two is even" are formed at the
@@ -181,13 +187,25 @@ oper
-- Coercions between the compound gen-num type and gender and number:
gNum : Gender -> Number -> GenNum = \g,n ->
case n of {Sg => case g of
case n of
{ Sg => case g of
{ Fem => ASg Fem ;
Masc => ASg Masc ;
Neut => ASg Neut
-- _ => variants {ASg Masc ; ASg Fem}
} ; Pl => APl} ;
Neut => ASg Neut } ;
Pl => APl
} ;
pgNum : PronGen -> Number -> GenNum = \g,n ->
case n of
{ Sg => case g of
{ PGen Fem => ASg Fem ;
PGen Masc => ASg Masc ;
PGen Neut => ASg Neut ;
_ => ASg Masc } ;
Pl => APl
} ;
-- _ => variants {ASg Masc ; ASg Fem} } ;
-- "variants" version cause "no term variants" error during linearization
--3 Adjective phrases
@@ -234,7 +252,7 @@ oper
p = P3 ;
pron = False;
anim = dom.anim ;
g = dom.g
g = PGen dom.g
} ;
@@ -288,9 +306,11 @@ oper
-- of the readings is meaningful.
appFunComm : Function -> NounPhrase -> CommNounPhrase = \mama,ivan ->
{s = \\n, cas =>
mama.s ! n ! cas ++ mama.s2 ++
ivan.s ! (mkPronForm mama.c No (Poss (gNum mama.g n)));
{s = \\n, cas => case ivan.pron of
{ True => ivan.s ! (mkPronForm cas No (Poss (gNum mama.g n))) ++ mama.s ! n ! cas;
False => mama.s ! n ! cas ++ mama.s2 ++
ivan.s ! (mkPronForm mama.c Yes (Poss (gNum mama.g n)))
};
g = mama.g ;
anim = mama.anim
} ;
@@ -303,6 +323,12 @@ oper
mkFun : CommNoun -> Str -> Case -> Function = \f,p,c ->
(n2n f) ** {s2 = p ; c = c} ;
-- The commonest cases are functions with Genitive.
funGen : CommNoun -> Function = \urovenCen ->
mkFun urovenCen [] Gen ;
-- The following is an aggregate corresponding to the original function application
-- producing "детство Ивана" and "Иваново детство". It does not appear in the
-- resource abstract syntax any longer.
@@ -310,19 +336,14 @@ oper
-- must also be included
-- Such possesive form is only possible with proper names in Russian :
appFun : Bool -> Function -> NounPhrase -> NounPhrase = \coll,detstvo, ivan ->
let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
variants {
indefNounPhrase nf (appFunComm detstvo ivan) ; -- detstvoIvana
npGenDet nf noNum ivan detstvo
} ;
appFun : Bool -> Function -> NounPhrase -> NounPhrase = \coll,detstvo, ivan ->
let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
variants {
indefNounPhrase nf (appFunComm detstvo ivan) ; -- detstvoIvana
npGenDet nf noNum ivan detstvo
} ;
-- The commonest cases are functions with Genitive.
funGen : CommNoun -> Function = \urovenCen ->
mkFun urovenCen [] Gen ;
--3 Modification of common nouns
--
-- The two main functions of adjective are in predication ("Иван - молод")
@@ -400,19 +421,21 @@ oper
verbOfPhrase : VerbPhrase -> Verb = \v ->
{s = v.s; t = v.t ; a = v.a ; w =v.w} ;
-- Verb phrases can also be formed from adjectives ("- молод"),
-- common nouns ("- человек"), and noun phrases ("- самый молодой").
-- The third rule is overgenerating: "- каждый человек" has to be ruled out
-- 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.
-- Note: in some case we can even omit a dash "-" :
-- "Я думаю, что это хорошая машина".
-- 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.
predAdverb : Adverb -> VerbGroup = \zloj ->
{ s= \\vf => case vf of {
VFin _ _ => "-" ++ zloj.s ;
VImper _ _ => "";
VInf => "";
VFin _ _ => zloj.s ;
VImper Sg _ => "будь" ++ zloj.s;
VImper Pl _ => "будьте" ++ zloj.s;
-- person is ignored !
VInf => "быть" ++ zloj.s;
VSubj _ => ""
} ;
t = Present ;
@@ -423,11 +446,14 @@ oper
predAdjective : AdjPhrase -> VerbGroup = \zloj ->
{ s= \\vf => case vf of {
VFin gn _ => case (numGNum gn) of {
Sg => "-" ++ zloj.s ! AF Nom Animate (ASg (genGNum gn)) ;
Pl => "-" ++ zloj.s ! AF Nom Animate APl
Sg => zloj.s ! AF Nom Animate (ASg (genGNum gn)) ;
Pl => zloj.s ! AF Nom Animate APl
} ;
VImper _ _ => "";
VInf => "";
VImper Sg _ => "будь" ++ zloj.s ! AF Inst Animate (ASg Masc);
VImper Pl _ => "будьте" ++ zloj.s ! AF Inst Animate APl ;
-- person is ignored !
VInf => "быть" ++ zloj.s ! AF Inst Animate (ASg Masc) ;
-- infinitive does not save GenNum info!
VSubj _ => ""
} ;
t = Present ;
@@ -437,10 +463,11 @@ oper
predCommNoun : CommNounPhrase -> VerbGroup = \chelovek ->
{ s= \\vf => case vf of {
VFin gn _ => "-" ++
(indefNounPhrase (numGNum gn) chelovek ).s ! (mkPronForm Nom No NonPoss) ;
VImper _ _ => "";
VInf => "";
VFin gn _ => (indefNounPhrase (numGNum gn) chelovek ).s ! (mkPronForm Nom No NonPoss) ;
VImper Sg _ => "будь"++ (indefNounPhrase Sg chelovek ).s ! (mkPronForm Inst No NonPoss) ;
VImper Pl _ => "будьте"++(indefNounPhrase Pl chelovek ).s ! (mkPronForm Inst No NonPoss);
-- person is ignored !
VInf => "быть" ++ (indefNounPhrase Sg chelovek ).s ! (mkPronForm Inst No NonPoss) ;
VSubj _ => ""
} ;
t = Present ;
@@ -450,9 +477,11 @@ oper
predNounPhrase : NounPhrase -> VerbGroup = \masha ->
{ s= \\vf => case vf of {
VFin _ _ => "-" ++ masha.s ! (mkPronForm Nom No NonPoss) ;
VImper _ _ => "";
VInf => "";
VFin _ _ => masha.s ! (mkPronForm Nom No NonPoss) ;
VImper Sg _ => "будь" ++ masha.s ! (mkPronForm Inst No NonPoss);
VImper Pl _ => "будьте" ++ masha.s ! (mkPronForm Inst No NonPoss);
VInf => "быть" ++ masha.s ! (mkPronForm Inst No NonPoss);
-- infinitive does not save Number parameter!
VSubj _ => ""
} ;
t = Present ;
@@ -497,7 +526,7 @@ oper
\dat,tu,pivo ->
let
tebepivo = dat.s2 ++
tu.s ! PF dat.c Yes NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss
tu.s ! PF dat.c No NonPoss ++ dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss
in
{s = \\vf => (dat.s ! vf) ++ tebepivo ;
t = dat.t ;
@@ -557,8 +586,8 @@ oper
let
{ ya = Ya.s ! (mkPronForm Nom No NonPoss);
ne = tebyaNeVizhu.s2;
vizhu = tebyaNeVizhu.s ! VFin (gNum Ya.g Ya.n) Ya.p;
tebya = tebyaNeVizhu.s3 ! Ya.g ! Ya.n
vizhu = tebyaNeVizhu.s ! VFin (pgNum Ya.g Ya.n) Ya.p;
tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n
}
in
if_then_else Str tebyaNeVizhu.negBefore
@@ -572,7 +601,7 @@ oper
\b,Ser,Jag,Dig -> { s =
let {
menya = Jag.s ! (mkPronForm Gen Yes NonPoss) ;
bolit = Ser.s ! VFin (gNum Dig.g Dig.n) Dig.p ;
bolit = Ser.s ! VFin (gNum (pgen2gen Dig.g) Dig.n) Dig.p ;
golova = Dig.s ! (mkPronForm Nom No NonPoss) ;
ne = negation b
} in
@@ -639,9 +668,7 @@ oper
complementOfTransVerb lubit ;
thereIs : NounPhrase -> Sentence = \bar ->
predVerbPhrase
({s = \\_ => "есть" ; n = bar.n ; p = P3; g = bar.g; anim = bar.anim; pron = bar.pron })
(predVerbGroup True (predNounPhrase bar)) ;
{s = "есть" ++ bar.s ! PF Nom No NonPoss} ;
--2 Coordination
--
@@ -722,11 +749,15 @@ oper
-- to a relative pronoun to create a new one. We can reuse the rule applying
-- functions to noun phrases!
funIntPron : Function -> IntPron -> IntPron =
appFun False ;
funIntPron : Function -> NounPhrase -> NounPhrase = \detstvo, ivan ->
indefNounPhrase ivan.n (appFunComm detstvo ivan) ; -- detstvoIvana
-- bug version:
-- funIntPron : Function -> IntPron -> IntPron =
-- appFun False ;
-- There is a variety of simple interrogative pronouns:
-- "какая машина", "кто", "что".
-- "какая машина", "кто", "что".
nounIntPron : Number -> CommNounPhrase -> IntPron = \n, x ->
@@ -740,7 +771,7 @@ oper
PF Acc _ _ => "кого" ;
PF Inst _ _ => "кем" ;
PF Prepos _ _ => ["о ком"]
g = Masc ;
} ;
g = PGen Masc ;
anim = Animate ;
n = num ;
@@ -757,8 +788,8 @@ oper
PF Dat _ _ => "чему" ;
PF Acc _ _ => "что" ;
PF Inst _ _ => "чем" ;
} ;
g = Neut ;
PF Prepos _ _=> ["о чем"]
} ;
g = PGen Neut ;
anim = Inanimate ;
@@ -806,8 +837,8 @@ oper
-- but we are not considering this case.
questVerbPhrase : NounPhrase -> VerbPhrase -> Question =
spish = spish.s ! VFin (gNum tu.g tu.n) tu.p
++ spish.s2 ++ spish.s3 ! tu.g ! tu.n } in
\tu,spish ->
let { vu = tu.s ! (mkPronForm Nom No NonPoss);
spish = spish.s2 ++ spish.s ! VFin (gNum (pgen2gen tu.g) tu.n) tu.p
++ spish.s3 ! (pgen2gen tu.g) ! tu.n } in
{ s = table {
@@ -850,8 +881,8 @@ isThere : NounPhrase -> Question = \bar ->
-- sense is a semantic question.
questAdverbial : IntAdverb -> NounPhrase -> VerbPhrase -> Question =
pozhivaesh.s2 ++ pozhivaesh.s ! VFin (gNum tu.g tu.n) tu.p ++
pozhivaesh.s3 ! tu.g ! tu.n } ;
\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.s3 ! (pgen2gen tu.g) ! tu.n } ;
@@ -860,7 +891,7 @@ isThere : NounPhrase -> Question = \bar ->
-- We only consider second-person imperatives.
Imperative: Type = { s: Gender => Number => Str } ;
{s = \\g, n => budGotov.s ! VImper n P2 ++ budGotov.s2 ++ budGotov.s3 ! g ! n} ;
imperVerbPhrase : VerbPhrase -> Imperative = \budGotov ->
{s = \\g, n => budGotov.s2 ++ budGotov.s ! VImper n P2 ++ budGotov.s3 ! g ! n} ;
@@ -928,17 +959,17 @@ isThere : NounPhrase -> Question = \bar ->
--3 Coordinating noun phrases
--
-- The structure is the same as for sentences. The result is either always plural
ListNounPhrase : Type = { s1,s2 : PronForm => Str ; g: Gender ;
-- or plural if any of the components is, depending on the conjunction.
ListNounPhrase : Type = { s1,s2 : PronForm => Str ; g: PronGen ;
anim : Animacy ; n : Number ; p : Person ; pron : Bool } ;
g = conjGender x.g y.g ; p = conjPerson x.p y.p ;
twoNounPhrase : (_,_ : NounPhrase) -> ListNounPhrase = \x,y ->
CO.twoTable PronForm x y ** {n = conjNumber x.n y.n ;
g = conjPGender x.g y.g ; p = conjPerson x.p y.p ;
pron = conjPron x.pron y.pron ; anim = conjAnim x.anim y.anim } ;
{n = conjNumber xs.n x.n ; g = conjGender x.g xs.g ;
consNounPhrase : ListNounPhrase -> NounPhrase -> ListNounPhrase = \xs,x ->
CO.consTable PronForm CO.comma xs x **
{n = conjNumber xs.n x.n ; g = conjPGender x.g xs.g ;
anim = conjAnim x.anim xs.anim ;
@@ -982,6 +1013,7 @@ isThere : NounPhrase -> Question = \bar ->
-- "Маша или Оля - красивая", "Антон или Олег - красивый",
-- "Маша или Олег - красивый".
-- The later is not totally correct, but there is no correct way to say that.
conjGender : Gender -> Gender -> Gender = \_,m -> m ;
conjPGender : PronGen -> PronGen -> PronGen = \_,m -> m ;

View File

@@ -21,7 +21,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
public MouseEvent m2;
public static String selectedText="";
public static boolean debug = true;
public static boolean debug = false;
public static boolean debug3 = false;
public static boolean debug2 = true;
public static boolean selectionCheck = false;