*** 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
+79 -56
View File
@@ -269,7 +269,7 @@ oper pronChtoTo: Pronoun =
PF Nom _ _ => "что-то" ; PF Nom _ _ => "что-то" ;
PF Gen _ _ => "чего-то" ; PF Gen _ _ => "чего-то" ;
PF Dat _ _ => "чему-то" ; PF Dat _ _ => "чему-то" ;
PF Acc _ _ => "чего-то" ; PF Acc _ _ => "что-то" ;
PF Inst _ _ => "чем-то" ; PF Inst _ _ => "чем-то" ;
PF Prepos _ _ => "чём-то" PF Prepos _ _ => "чём-то"
} ; } ;
@@ -1022,7 +1022,7 @@ oper verbPredpochitat : Verbum = verbDecl Imperfective First "предпочит
oper verbOtpravlyat : Verbum = verbDecl Imperfective First "отправля" "ю" "отправлял" "отправляй" "отправлять"; oper verbOtpravlyat : Verbum = verbDecl Imperfective First "отправля" "ю" "отправлял" "отправляй" "отправлять";
oper verbSlomat : Verbum = verbDecl Perfective First "слома" "ю" "сломал" "сломай" "сломать"; oper verbSlomat : Verbum = verbDecl Perfective First "слома" "ю" "сломал" "сломай" "сломать";
oper verbByut : Verbum = verbDecl Perfective First "буд" "у" "был" "будь" "быть"; oper verbByut : Verbum = verbDecl Perfective First "буд" "у" "был" "будь" "быть";
oper verbMoch : Verbum = verbDecl Imperfective First "мог" "у" "мог" "моги" "мочь"; oper verbMoch : Verbum = verbDeclMoch Imperfective First "мог" "у" "мог" "моги" "мочь" "мож";
-- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink) : -- Verbs with vowel "ё": "даёшь" (give), "пьёшь" (drink) :
oper verbDavat : Verbum = verbDecl Imperfective FirstE "да" "ю" "давал" "давай" "давать"; oper verbDavat : Verbum = verbDecl Imperfective FirstE "да" "ю" "давал" "давай" "давать";
@@ -1051,52 +1051,67 @@ oper AspectVoice: Type = { s : VerbConj => Str ; asp: Aspect } ;
-- "PresentVerb" takes care of the present tense conjugation. -- "PresentVerb" takes care of the present tense conjugation.
param PresentVF = PRF Number Person ; param PresentVF = PRF GenNum Person;
oper PresentVerb : Type = PresentVF => Str ; oper PresentVerb : Type = PresentVF => Str ;
oper presentConjDolzhen: Str -> Str -> PresentVerb = \del, sgP1End -> oper presentConjDolzhen: Str -> Str -> PresentVerb = \del, sgP1End ->
table { table {
PRF Sg P1 => del+ sgP1End ; PRF APl _ => del+ "ны" ;
PRF Sg P2 => del+ sgP1End ; PRF (ASg Masc) P1 => del+ sgP1End ;
PRF Sg P3 => del+ "на" ; PRF (ASg Fem) P1 => del+ "на" ;
PRF Pl _ => del+ "ны" PRF (ASg Neut) P1 => del+ "но" ;
}; PRF (ASg Masc) P2 => del+ sgP1End ;
PRF (ASg Fem) P2 => del+ "на" ;
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 -> oper presentConjMixed: Str -> Str -> PresentVerb = \del, sgP1End ->
table { table {
PRF Sg P1 => del+ sgP1End ; PRF (ASg _) P1 => del+ sgP1End ;
PRF Sg P2 => del+ "ешь" ; PRF (ASg _) P2 => del+ "ешь" ;
PRF Sg P3 => del+ "ет" ; PRF (ASg _) P3 => del+ "ет" ;
PRF Pl P1 => del+ "им" ; PRF APl P1 => del+ "им" ;
PRF Pl P2 => del+ "ите'" ; PRF APl P2 => del+ "ите" ;
PRF Pl P3 => del+ "ят" PRF APl P3 => del+ "ят"
}; };
oper presentConj2: Str -> Str -> PresentVerb = \del, sgP1End -> oper presentConj2: Str -> Str -> PresentVerb = \del, sgP1End ->
table { table {
PRF Sg P1 => del+ sgP1End ; PRF (ASg _) P1 => del+ sgP1End ;
PRF Sg P2 => del+ "ишь" ; PRF (ASg _) P2 => del+ "ишь" ;
PRF Sg P3 => del+ "ит" ; PRF (ASg _) P3 => del+ "ит" ;
PRF Pl P1 => del+ "им" ; PRF APl P1 => del+ "им" ;
PRF Pl P2 => del+ "ите'" ; PRF APl P2 => del+ "ите" ;
PRF Pl P3 => del+ "ят" PRF APl P3 => del+ "ят"
}; };
oper presentConj1E: Str -> Str -> PresentVerb = \del, sgP1End -> oper presentConj1E: Str -> Str -> PresentVerb = \del, sgP1End ->
table { table {
PRF Sg P1 => del+ sgP1End ; PRF (ASg _) P1 => del+ sgP1End ;
PRF Sg P2 => del+ "ёшь" ; PRF (ASg _) P2 => del+ "ёшь" ;
PRF Sg P3 => del+ "ёт" ; PRF (ASg _) P3 => del+ "ёт" ;
PRF Pl P1 => del+ "ём" ;␍ PRF APl P1 => del+ "ём" ;␍
PRF Pl P2 => del+ "ёте'" ; PRF APl P2 => del+ "ёте" ;
PRF Pl P3 => del+ sgP1End + "т" PRF APl P3 => del+ sgP1End + "т"
}; };
oper presentConj1: Str -> Str -> PresentVerb = \del, sgP1End -> oper presentConj1: Str -> Str -> PresentVerb = \del, sgP1End ->
table { table {
PRF Sg P1 => del+ sgP1End ; PRF (ASg _) P1 => del+ sgP1End ;
PRF Sg P2 => del+ "ешь" ; PRF (ASg _) P2 => del+ "ешь" ;
PRF Sg P3 => del+ "ет" ; PRF (ASg _) P3 => del+ "ет" ;
PRF Pl P1 => del+ "ем" ;␍ PRF APl P1 => del+ "ем" ;␍
PRF Pl P2 => del+ "ете'" ; PRF APl P2 => del+ "ете" ;
PRF Pl P3 => del+ sgP1End + "т" PRF APl P3 => del+ sgP1End + "т"
};
oper presentConj1Moch: Str -> Str -> Str -> PresentVerb = \del, sgP1End, altRoot ->
table {
PRF (ASg _) P1 => del + sgP1End ;
PRF (ASg _) P2 => altRoot + "ешь" ;
PRF (ASg _) P3 => altRoot + "ет" ;
PRF APl P1 => altRoot + "ем" ;␍
PRF APl P2 => altRoot + "ете" ;
PRF APl P3 => del+ sgP1End + "т"
}; };
-- "PastVerb" takes care of the past tense conjugation. -- "PastVerb" takes care of the past tense conjugation.
@@ -1140,6 +1155,14 @@ oper verbDecl: Aspect -> Conjugation -> Str -> Str -> Str -> Str ->Str -> Verbum
} }
}; };
-- for verbs like "мочь" ("can") with changing consonants (first conjugation):
-- "могу - можешь"
oper verbDeclMoch: Aspect -> Conjugation -> Str -> Str -> Str -> Str ->Str -> Str -> Verbum =
\a, c, del, sgP1End, sgMascPast, imperSgP2, inf, altRoot -> case a of
{ Perfective => mkVerb (perfectiveActivePattern inf imperSgP2 (presentConj1Moch del sgP1End altRoot) (pastConj sgMascPast)) (pastConj sgMascPast);
Imperfective => mkVerb (imperfectiveActivePattern inf imperSgP2 (presentConj1Moch del sgP1End altRoot) (pastConj sgMascPast)) (pastConj sgMascPast)
};
-- "mkVerb" produce the passive forms from -- "mkVerb" produce the passive forms from
-- the active forms using the "mkPassive" method. -- the active forms using the "mkPassive" method.
-- Passive is expressed in Russian by so called reflexive verbs, -- Passive is expressed in Russian by so called reflexive verbs,
@@ -1206,25 +1229,25 @@ oper
VIMP Pl P1 => ["давайте "] + inf ; VIMP Pl P1 => ["давайте "] + inf ;
VIMP Sg P2 => imper ; VIMP Sg P2 => imper ;
VIMP Pl P2 => imper+"те" ; VIMP Pl P2 => imper+"те" ;
VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF Sg P3) ; VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF (ASg Masc) P3) ;
VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF Pl P3) ; VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF APl P3) ;
VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"]; VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"];
VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"];␍ VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"];␍
VSUB (ASg Neut) => past ! (PSF (ASg Neut) )+[" бы"]; VSUB (ASg Neut) => past ! (PSF (ASg Neut) )+[" бы"];
VSUB APl => past ! (PSF APl) +[" бы"];␍ VSUB APl => past ! (PSF APl) +[" бы"];␍
VIND (VPresent Sg P1) => presentFuture ! ( PRF Sg P1); VIND (VPresent Sg P1) => presentFuture ! ( PRF (ASg Masc) P1);
VIND (VPresent Sg P2) => presentFuture! (PRF Sg P2) ; VIND (VPresent Sg P2) => presentFuture! (PRF (ASg Masc) P2) ;
VIND (VPresent Sg P3) => presentFuture ! (PRF Sg P3) ; VIND (VPresent Sg P3) => presentFuture ! (PRF (ASg Masc) P3) ;
VIND (VPresent Pl P1) => presentFuture ! (PRF Pl P1);␍ VIND (VPresent Pl P1) => presentFuture ! (PRF APl P1);␍
VIND (VPresent Pl P2) => presentFuture ! (PRF Pl P2); VIND (VPresent Pl P2) => presentFuture ! (PRF APl P2);
VIND (VPresent Pl P3) => presentFuture ! (PRF Pl P3); VIND (VPresent Pl P3) => presentFuture ! (PRF APl P3);
VIND (VFuture Sg P1) => ["буду "] + presentFuture ! (PRF Sg P1) ; VIND (VFuture Sg P1) => ["буду "] + presentFuture ! (PRF (ASg Masc) P1) ;
VIND (VFuture Sg P2) => ["будешь"] + presentFuture ! (PRF Sg P2) ; VIND (VFuture Sg P2) => ["будешь"] + presentFuture ! (PRF (ASg Masc) P2) ;
VIND (VFuture Sg P3) => ["будет "] + presentFuture ! (PRF Sg P3) ; VIND (VFuture Sg P3) => ["будет "] + presentFuture ! (PRF (ASg Masc) P3) ;
VIND (VFuture Pl P1) => ["будем "] + presentFuture ! (PRF Pl P1) ;␍ VIND (VFuture Pl P1) => ["будем "] + presentFuture ! (PRF APl P1) ;␍
VIND (VFuture Pl P2) => ["будете "] + presentFuture ! (PRF Pl P2) ; VIND (VFuture Pl P2) => ["будете "] + presentFuture ! (PRF APl P2) ;
VIND (VFuture Pl P3) => ["будут "] + presentFuture ! (PRF Pl P3) ;␍ VIND (VFuture Pl P3) => ["будут "] + presentFuture ! (PRF APl P3) ;␍
VIND (VPast (ASg Masc)) => past ! (PSF (ASg Masc)) ; VIND (VPast (ASg Masc)) => past ! (PSF (ASg Masc)) ;
VIND (VPast (ASg Fem)) => past ! (PSF (ASg Fem) ) ; VIND (VPast (ASg Fem)) => past ! (PSF (ASg Fem) ) ;
@@ -1237,12 +1260,12 @@ oper
oper perfectiveActivePattern: Str -> Str -> PresentVerb -> PastVerb -> AspectVoice = oper perfectiveActivePattern: Str -> Str -> PresentVerb -> PastVerb -> AspectVoice =
\inf, imper, presentFuture, past -> { s= table { \inf, imper, presentFuture, past -> { s= table {
VINF => inf ; VINF => inf ;
VIMP Sg P1 => ["давайте "]+ presentFuture ! (PRF Sg P1); VIMP Sg P1 => ["давайте "]+ presentFuture ! (PRF (ASg Masc) P1);
VIMP Pl P1 => ["давайте "] + presentFuture ! (PRF Pl P1); VIMP Pl P1 => ["давайте "] + presentFuture ! (PRF APl P1);
VIMP Sg P2 => imper ; VIMP Sg P2 => imper ;
VIMP Pl P2 => imper+"те" ; VIMP Pl P2 => imper+"те" ;
VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF Sg P3) ; VIMP Sg P3 => ["пускай "] + presentFuture ! (PRF (ASg Masc) P3) ;
VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF Pl P3) ; VIMP Pl P3 => ["пускай "] + presentFuture ! (PRF APl P3) ;
VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"]; VSUB (ASg Masc) => past ! (PSF (ASg Masc)) +[" бы"];
VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"];␍ VSUB (ASg Fem) => past ! (PSF (ASg Fem)) +[" бы"];␍
@@ -1254,12 +1277,12 @@ oper
VIND (VPresent Pl P1) => nonExist ; VIND (VPresent Pl P1) => nonExist ;
VIND (VPresent Pl P2) => nonExist ; VIND (VPresent Pl P2) => nonExist ;
VIND (VPresent Pl P3) => [] ; VIND (VPresent Pl P3) => [] ;
VIND (VFuture Sg P1) => presentFuture ! (PRF Sg P1) ; VIND (VFuture Sg P1) => presentFuture ! (PRF (ASg Masc) P1) ;
VIND (VFuture Sg P2) => presentFuture ! (PRF Sg P2) ; VIND (VFuture Sg P2) => presentFuture ! (PRF (ASg Masc) P2) ;
VIND (VFuture Sg P3) => presentFuture ! (PRF Sg P3) ; VIND (VFuture Sg P3) => presentFuture ! (PRF (ASg Masc) P3) ;
VIND (VFuture Pl P1) => presentFuture ! (PRF Pl P1) ;␍ VIND (VFuture Pl P1) => presentFuture ! (PRF APl P1) ;␍
VIND (VFuture Pl P2) => presentFuture ! (PRF Pl P2) ; VIND (VFuture Pl P2) => presentFuture ! (PRF APl P2) ;
VIND (VFuture Pl P3) => presentFuture ! (PRF Pl P3) ; VIND (VFuture Pl P3) => presentFuture ! (PRF APl P3) ;
VIND (VPast (ASg Masc)) => past ! (PSF (ASg Masc)) ; VIND (VPast (ASg Masc)) => past ! (PSF (ASg Masc)) ;
VIND (VPast (ASg Fem)) => past ! (PSF (ASg Fem) ) ; VIND (VPast (ASg Fem)) => past ! (PSF (ASg Fem) ) ;
VIND (VPast (ASg Neut) ) => past ! (PSF (ASg Neut)) ; VIND (VPast (ASg Neut) ) => past ! (PSF (ASg Neut)) ;
+3 -2
View File
@@ -59,9 +59,9 @@ lin
ThisNP = det2NounPhrase etotDet ; -- inanimate form only ThisNP = det2NounPhrase etotDet ; -- inanimate form only
ThatNP = det2NounPhrase totDet ; -- 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 -- 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 -- missing in Russian
EverybodyNP = mkNounPhrase Pl (noun2CommNounPhrase (eEnd_Decl "вс")) ; EverybodyNP = mkNounPhrase Pl (noun2CommNounPhrase (eEnd_Decl "вс")) ;
@@ -85,6 +85,7 @@ WantVV = extVerb verbKhotet Act Present ;
OrConj = ss "или" ** {n = Sg} ; OrConj = ss "или" ** {n = Sg} ;
BothAnd = sd2 "как" [", так"] ** {n = Pl} ; BothAnd = sd2 "как" [", так"] ** {n = Pl} ;
EitherOr = sd2 "либо" [", либо"] ** {n = Sg} ; EitherOr = sd2 "либо" [", либо"] ** {n = Sg} ;
-- comma is not visible in GUI!
-- In case of "neither.. no" expression double negation is not -- In case of "neither.. no" expression double negation is not
-- only possible, but also required in Russian. -- only possible, but also required in Russian.
+109 -77
View File
@@ -41,51 +41,56 @@ oper
oper oper
NounPhrase : Type = { s : PronForm => Str ; n : Number ; 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: -- 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
Numeral : Type = {s : Case => Gender => Str} ; Numeral : Type = {s : Case => Gender => Str} ;
pronWithNum : NounPhrase -> Numeral -> NounPhrase = \mu,dva -> 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 } ; n = mu.n ; p = mu.p; g = mu.g ; pron = mu.pron; anim = mu.anim } ;
noNum : Numeral = {s = \\_,_ => []} ; 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 -> useInt : Str -> Numeral = \i ->
{s = table { {s = table { _ => table {_ => i }
Nom => table {_ => i }; -- Nom => table {_ => i };
Gen => table {_ => i ++ "'-х"}; -- Gen => table {_ => i ++ "-х"};
Dat => table {_ => i ++ "'-м"}; -- Dat => table {_ => i ++ "'-м"};
Acc => table {_ => i }; -- Acc => table {_ => i };
Inst => table {_ => i ++ "-мя"}; -- Inst => table {_ => i ++ "-мя"};
Prepos => table {_ => i ++ "'-х"} -- Prepos => table {_ => i ++ "-х"}
} }
} ; } ;
-- A function specific for Russian for setting the gender for -- A function specific for Russian for setting the gender for
-- personal pronouns in first and second person, singular : -- personal pronouns in first and second person, singular :
setNPGender : Gender -> NounPhrase -> NounPhrase = \gen, pronI -> 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 } ; n = pronI.n ; nComp = pronI.nComp ; p = pronI.p ; pron = pronI.pron } ;
mkNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n,chelovek -> mkNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n,chelovek ->
{s = \\cas => chelovek.s ! n ! (extCase cas) ; {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 anim = chelovek.anim
} ; } ;
pron2NounPhrase : Pronoun -> Animacy -> NounPhrase = \ona, 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 } ; pron = ona.pron; p = ona.p ; anim = anim } ;
det2NounPhrase : Adjective -> NounPhrase = \eto -> 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 = nameNounPhrase : ProperName -> NounPhrase =
\masha -> {s = \\c => masha.s ! (extCase c) ; \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} ; n = Sg; nComp = Sg; pron = False} ;
@@ -120,17 +125,18 @@ oper
n = kazhduj.n ; n = kazhduj.n ;
p = P3 ; p = P3 ;
pron = False; pron = False;
g = case kazhduj.g of { PNoGen => okhotnik.g; _=> pgen2gen kazhduj.g } ; g = kazhduj.g ;
anim = okhotnik.anim anim = okhotnik.anim
} ; } ;
indefNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n -> indefNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n ->
indefNounPhraseNum n noNum ; indefNounPhraseNum n noNum ;
-- a problem: "2 бутылки", but "5 бутылок" in Nominative case! Ignored for the moment:
indefNounPhraseNum : Number -> Numeral ->CommNounPhrase -> NounPhrase = indefNounPhraseNum : Number -> Numeral ->CommNounPhrase -> NounPhrase =
\n,dva,mashina -> \n,dva,mashina ->
{s = \\c => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ; {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 pron = False
} ; } ;
@@ -157,7 +163,7 @@ oper
False => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ++ False => dva.s ! (extCase c) ! mashina.g ++ mashina.s ! n ! (extCase c) ++
masha.s ! (mkPronForm Gen No (Poss (gNum mashina.g n))) 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 -- 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: -- Coercions between the compound gen-num type and gender and number:
gNum : Gender -> Number -> GenNum = \g,n -> gNum : Gender -> Number -> GenNum = \g,n ->
case n of {Sg => case g of case n of
{ Sg => case g of
{ Fem => ASg Fem ; { Fem => ASg Fem ;
Masc => ASg Masc ; Masc => ASg Masc ;
Neut => ASg Neut Neut => ASg Neut } ;
-- _ => variants {ASg Masc ; ASg Fem} Pl => APl
} ; 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 --3 Adjective phrases
@@ -234,7 +252,7 @@ oper
p = P3 ; p = P3 ;
pron = False; pron = False;
anim = dom.anim ; anim = dom.anim ;
g = dom.g g = PGen dom.g
} ; } ;
@@ -288,9 +306,11 @@ oper
-- of the readings is meaningful. -- of the readings is meaningful.
appFunComm : Function -> NounPhrase -> CommNounPhrase = \mama,ivan -> appFunComm : Function -> NounPhrase -> CommNounPhrase = \mama,ivan ->
{s = \\n, cas => {s = \\n, cas => case ivan.pron of
mama.s ! n ! cas ++ mama.s2 ++ { True => ivan.s ! (mkPronForm cas No (Poss (gNum mama.g n))) ++ mama.s ! n ! cas;
ivan.s ! (mkPronForm mama.c No (Poss (gNum mama.g n))); False => mama.s ! n ! cas ++ mama.s2 ++
ivan.s ! (mkPronForm mama.c Yes (Poss (gNum mama.g n)))
};
g = mama.g ; g = mama.g ;
anim = mama.anim anim = mama.anim
} ; } ;
@@ -303,6 +323,12 @@ oper
mkFun : CommNoun -> Str -> Case -> Function = \f,p,c -> mkFun : CommNoun -> Str -> Case -> Function = \f,p,c ->
(n2n f) ** {s2 = p ; c = 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 -- The following is an aggregate corresponding to the original function application
-- producing "детство Ивана" and "Иваново детство". It does not appear in the -- producing "детство Ивана" and "Иваново детство". It does not appear in the
-- resource abstract syntax any longer. -- resource abstract syntax any longer.
@@ -310,19 +336,14 @@ oper
-- must also be included -- must also be included
-- Such possesive form is only possible with proper names in Russian : -- Such possesive form is only possible with proper names in Russian :
appFun : Bool -> Function -> NounPhrase -> NounPhrase = \coll,detstvo, ivan -> appFun : Bool -> Function -> NounPhrase -> NounPhrase = \coll,detstvo, ivan ->
let {n = ivan.n ; nf = if_then_else Number coll Sg n} in let {n = ivan.n ; nf = if_then_else Number coll Sg n} in
variants { variants {
indefNounPhrase nf (appFunComm detstvo ivan) ; -- detstvoIvana indefNounPhrase nf (appFunComm detstvo ivan) ; -- detstvoIvana
npGenDet nf noNum ivan detstvo npGenDet nf noNum ivan detstvo
} ; } ;
-- The commonest cases are functions with Genitive.
funGen : CommNoun -> Function = \urovenCen ->
mkFun urovenCen [] Gen ;
--3 Modification of common nouns --3 Modification of common nouns
-- --
-- The two main functions of adjective are in predication ("Иван - молод") -- The two main functions of adjective are in predication ("Иван - молод")
@@ -400,19 +421,21 @@ oper
verbOfPhrase : VerbPhrase -> Verb = \v -> verbOfPhrase : VerbPhrase -> Verb = \v ->
{s = v.s; t = v.t ; a = v.a ; w =v.w} ; {s = v.s; t = v.t ; a = v.a ; w =v.w} ;
-- Verb phrases can also be formed from adjectives (" молод"),
-- Verb phrases can also be formed from adjectives ("- молод"), -- common nouns (" человек"), and noun phrases (" самый молодой").
-- common nouns ("- человек"), and noun phrases ("- самый молодой"). -- The third rule is overgenerating: " каждый человек" has to be ruled out
-- The third rule is overgenerating: "- каждый человек" has to be ruled out
-- on semantic grounds. -- 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 -> predAdverb : Adverb -> VerbGroup = \zloj ->
{ s= \\vf => case vf of { { s= \\vf => case vf of {
VFin _ _ => "-" ++ zloj.s ; VFin _ _ => zloj.s ;
VImper _ _ => ""; VImper Sg _ => "будь" ++ zloj.s;
VInf => ""; VImper Pl _ => "будьте" ++ zloj.s;
-- person is ignored !
VInf => "быть" ++ zloj.s;
VSubj _ => "" VSubj _ => ""
} ; } ;
t = Present ; t = Present ;
@@ -423,11 +446,14 @@ oper
predAdjective : AdjPhrase -> VerbGroup = \zloj -> predAdjective : AdjPhrase -> VerbGroup = \zloj ->
{ s= \\vf => case vf of { { s= \\vf => case vf of {
VFin gn _ => case (numGNum gn) of { VFin gn _ => case (numGNum gn) of {
Sg => "-" ++ zloj.s ! AF Nom Animate (ASg (genGNum gn)) ; Sg => zloj.s ! AF Nom Animate (ASg (genGNum gn)) ;
Pl => "-" ++ zloj.s ! AF Nom Animate APl Pl => zloj.s ! AF Nom Animate APl
} ; } ;
VImper _ _ => ""; VImper Sg _ => "будь" ++ zloj.s ! AF Inst Animate (ASg Masc);
VInf => ""; 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 _ => "" VSubj _ => ""
} ; } ;
t = Present ; t = Present ;
@@ -437,10 +463,11 @@ oper
predCommNoun : CommNounPhrase -> VerbGroup = \chelovek -> predCommNoun : CommNounPhrase -> VerbGroup = \chelovek ->
{ s= \\vf => case vf of { { s= \\vf => case vf of {
VFin gn _ => "-" ++ VFin gn _ => (indefNounPhrase (numGNum gn) chelovek ).s ! (mkPronForm Nom No NonPoss) ;
(indefNounPhrase (numGNum gn) chelovek ).s ! (mkPronForm Nom No NonPoss) ; VImper Sg _ => "будь"++ (indefNounPhrase Sg chelovek ).s ! (mkPronForm Inst No NonPoss) ;
VImper _ _ => ""; VImper Pl _ => "будьте"++(indefNounPhrase Pl chelovek ).s ! (mkPronForm Inst No NonPoss);
VInf => ""; -- person is ignored !
VInf => "быть" ++ (indefNounPhrase Sg chelovek ).s ! (mkPronForm Inst No NonPoss) ;
VSubj _ => "" VSubj _ => ""
} ; } ;
t = Present ; t = Present ;
@@ -450,9 +477,11 @@ oper
predNounPhrase : NounPhrase -> VerbGroup = \masha -> predNounPhrase : NounPhrase -> VerbGroup = \masha ->
{ s= \\vf => case vf of { { s= \\vf => case vf of {
VFin _ _ => "-" ++ masha.s ! (mkPronForm Nom No NonPoss) ; VFin _ _ => masha.s ! (mkPronForm Nom No NonPoss) ;
VImper _ _ => ""; VImper Sg _ => "будь" ++ masha.s ! (mkPronForm Inst No NonPoss);
VInf => ""; VImper Pl _ => "будьте" ++ masha.s ! (mkPronForm Inst No NonPoss);
VInf => "быть" ++ masha.s ! (mkPronForm Inst No NonPoss);
-- infinitive does not save Number parameter!
VSubj _ => "" VSubj _ => ""
} ; } ;
t = Present ; t = Present ;
@@ -497,7 +526,7 @@ oper
\dat,tu,pivo -> \dat,tu,pivo ->
let let
tebepivo = dat.s2 ++ 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 in
{s = \\vf => (dat.s ! vf) ++ tebepivo ; {s = \\vf => (dat.s ! vf) ++ tebepivo ;
t = dat.t ; t = dat.t ;
@@ -557,8 +586,8 @@ oper
let let
{ ya = Ya.s ! (mkPronForm Nom No NonPoss); { ya = Ya.s ! (mkPronForm Nom No NonPoss);
ne = tebyaNeVizhu.s2; ne = tebyaNeVizhu.s2;
vizhu = tebyaNeVizhu.s ! VFin (gNum Ya.g Ya.n) Ya.p; vizhu = tebyaNeVizhu.s ! VFin (pgNum Ya.g Ya.n) Ya.p;
tebya = tebyaNeVizhu.s3 ! 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
@@ -572,7 +601,7 @@ oper
\b,Ser,Jag,Dig -> { s = \b,Ser,Jag,Dig -> { s =
let { let {
menya = Jag.s ! (mkPronForm Gen Yes NonPoss) ; 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) ; golova = Dig.s ! (mkPronForm Nom No NonPoss) ;
ne = negation b ne = negation b
} in } in
@@ -639,9 +668,7 @@ oper
complementOfTransVerb lubit ; complementOfTransVerb lubit ;
thereIs : NounPhrase -> Sentence = \bar -> thereIs : NounPhrase -> Sentence = \bar ->
predVerbPhrase {s = "есть" ++ bar.s ! PF Nom No NonPoss} ;
({s = \\_ => "есть" ; n = bar.n ; p = P3; g = bar.g; anim = bar.anim; pron = bar.pron })
(predVerbGroup True (predNounPhrase bar)) ;
--2 Coordination --2 Coordination
-- --
@@ -722,11 +749,15 @@ oper
-- to a relative pronoun to create a new one. We can reuse the rule applying -- to a relative pronoun to create a new one. We can reuse the rule applying
-- functions to noun phrases! -- functions to noun phrases!
funIntPron : Function -> IntPron -> IntPron = funIntPron : Function -> NounPhrase -> NounPhrase = \detstvo, ivan ->
appFun False ; indefNounPhrase ivan.n (appFunComm detstvo ivan) ; -- detstvoIvana
-- bug version:
-- funIntPron : Function -> IntPron -> IntPron =
-- appFun False ;
-- There is a variety of simple interrogative pronouns: -- There is a variety of simple interrogative pronouns:
-- "какая машина", "кто", "что". -- "какая машина", "кто", "что".
nounIntPron : Number -> CommNounPhrase -> IntPron = \n, x -> nounIntPron : Number -> CommNounPhrase -> IntPron = \n, x ->
detNounPhrase (kakojDet ** {n = n ; g = PNoGen; c = Nom}) x ; detNounPhrase (kakojDet ** {n = n ; g = PNoGen; c = Nom}) x ;
@@ -740,7 +771,7 @@ oper
PF Inst _ _ => "кем" ; PF Inst _ _ => "кем" ;
PF Prepos _ _ => ["о ком"] PF Prepos _ _ => ["о ком"]
} ; } ;
g = Masc ; g = PGen Masc ;
anim = Animate ; anim = Animate ;
n = num ; n = num ;
p = P3 ; p = P3 ;
@@ -757,8 +788,8 @@ oper
PF Acc _ _ => "что" ; PF Acc _ _ => "что" ;
PF Inst _ _ => "чем" ; PF Inst _ _ => "чем" ;
PF Prepos _ _=> ["о чем"] PF Prepos _ _=> ["о чем"]
} ; } ;
g = Neut ; g = PGen Neut ;
anim = Inanimate ; anim = Inanimate ;
n = num ; n = num ;
p = P3 ; p = P3 ;
@@ -806,8 +837,8 @@ oper
questVerbPhrase : NounPhrase -> VerbPhrase -> Question = questVerbPhrase : NounPhrase -> VerbPhrase -> Question =
\tu,spish -> \tu,spish ->
let { vu = tu.s ! (mkPronForm Nom No NonPoss); let { vu = tu.s ! (mkPronForm Nom No NonPoss);
spish = spish.s ! VFin (gNum tu.g tu.n) tu.p spish = spish.s2 ++ spish.s ! VFin (gNum (pgen2gen tu.g) tu.n) tu.p
++ spish.s2 ++ spish.s3 ! tu.g ! tu.n } in ++ spish.s3 ! (pgen2gen tu.g) ! tu.n } in
{ s = table { { s = table {
DirQ => vu ++ spish ; DirQ => vu ++ spish ;
IndirQ => spish ++ "ли" ++ vu IndirQ => spish ++ "ли" ++ vu
@@ -850,8 +881,8 @@ isThere : NounPhrase -> Question = \bar ->
questAdverbial : IntAdverb -> NounPhrase -> VerbPhrase -> Question = questAdverbial : IntAdverb -> NounPhrase -> VerbPhrase -> Question =
\kak, tu, pozhivaesh -> \kak, tu, pozhivaesh ->
{s = \\q => kak.s ++ tu.s ! (mkPronForm Nom No NonPoss) ++ {s = \\q => kak.s ++ tu.s ! (mkPronForm Nom No NonPoss) ++
pozhivaesh.s2 ++ pozhivaesh.s ! VFin (gNum tu.g tu.n) tu.p ++ pozhivaesh.s2 ++ pozhivaesh.s ! VFin (gNum (pgen2gen tu.g) tu.n) tu.p ++
pozhivaesh.s3 ! tu.g ! tu.n } ; pozhivaesh.s3 ! (pgen2gen tu.g) ! tu.n } ;
--2 Imperatives --2 Imperatives
-- --
@@ -860,7 +891,7 @@ isThere : NounPhrase -> Question = \bar ->
Imperative: Type = { s: Gender => Number => Str } ; Imperative: Type = { s: Gender => Number => Str } ;
imperVerbPhrase : VerbPhrase -> Imperative = \budGotov -> imperVerbPhrase : VerbPhrase -> Imperative = \budGotov ->
{s = \\g, n => budGotov.s ! VImper n P2 ++ budGotov.s2 ++ budGotov.s3 ! g ! n} ; {s = \\g, n => budGotov.s2 ++ budGotov.s ! VImper n P2 ++ budGotov.s3 ! g ! n} ;
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 ++ "!") ;
@@ -928,17 +959,17 @@ isThere : NounPhrase -> Question = \bar ->
-- The structure is the same as for sentences. The result is either always plural -- The structure is the same as for sentences. The result is either always plural
-- or plural if any of the components is, depending on the conjunction. -- or plural if any of the components is, depending on the conjunction.
ListNounPhrase : Type = { s1,s2 : PronForm => Str ; g: Gender ; ListNounPhrase : Type = { s1,s2 : PronForm => Str ; g: PronGen ;
anim : Animacy ; n : Number ; p : Person ; pron : Bool } ; anim : Animacy ; n : Number ; p : Person ; pron : Bool } ;
twoNounPhrase : (_,_ : NounPhrase) -> ListNounPhrase = \x,y -> twoNounPhrase : (_,_ : NounPhrase) -> ListNounPhrase = \x,y ->
CO.twoTable PronForm x y ** {n = conjNumber x.n y.n ; CO.twoTable PronForm x y ** {n = conjNumber x.n y.n ;
g = conjGender x.g y.g ; p = conjPerson x.p y.p ; g = conjPGender x.g y.g ; p = conjPerson x.p y.p ;
pron = conjPron x.pron y.pron ; anim = conjAnim x.anim y.anim } ; pron = conjPron x.pron y.pron ; anim = conjAnim x.anim y.anim } ;
consNounPhrase : ListNounPhrase -> NounPhrase -> ListNounPhrase = \xs,x -> consNounPhrase : ListNounPhrase -> NounPhrase -> ListNounPhrase = \xs,x ->
CO.consTable PronForm CO.comma xs x ** CO.consTable PronForm CO.comma xs x **
{n = conjNumber xs.n x.n ; g = conjGender x.g xs.g ; {n = conjNumber xs.n x.n ; g = conjPGender x.g xs.g ;
anim = conjAnim x.anim xs.anim ; anim = conjAnim x.anim xs.anim ;
p = conjPerson xs.p x.p; pron = conjPron xs.pron x.pron} ; p = conjPerson xs.p x.p; pron = conjPron xs.pron x.pron} ;
@@ -982,6 +1013,7 @@ isThere : NounPhrase -> Question = \bar ->
-- The later is not totally correct, but there is no correct way to say that. -- The later is not totally correct, but there is no correct way to say that.
conjGender : Gender -> Gender -> Gender = \_,m -> m ; conjGender : Gender -> Gender -> Gender = \_,m -> m ;
conjPGender : PronGen -> PronGen -> PronGen = \_,m -> m ;
conjAnim : Animacy -> Animacy -> Animacy = \_,m -> m ; conjAnim : Animacy -> Animacy -> Animacy = \_,m -> m ;
+1 -1
View File
@@ -21,7 +21,7 @@ public class GFEditor2 extends JFrame implements ActionListener, CaretListener,
public MouseEvent m2; public MouseEvent m2;
public static String selectedText=""; public static String selectedText="";
public static boolean debug = true; public static boolean debug = false;
public static boolean debug3 = false; public static boolean debug3 = false;
public static boolean debug2 = true; public static boolean debug2 = true;
public static boolean selectionCheck = false; public static boolean selectionCheck = false;