diff --git a/next-lib/src/bulgarian/AllBul.gf b/next-lib/src/bulgarian/AllBul.gf index 8efb34903..80ad02165 100644 --- a/next-lib/src/bulgarian/AllBul.gf +++ b/next-lib/src/bulgarian/AllBul.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../slavic +--# -path=.:../abstract:../common:prelude concrete AllBul of AllBulAbs = LangBul, diff --git a/next-lib/src/bulgarian/CatBul.gf b/next-lib/src/bulgarian/CatBul.gf index 78989e9d3..1e679ed2a 100644 --- a/next-lib/src/bulgarian/CatBul.gf +++ b/next-lib/src/bulgarian/CatBul.gf @@ -1,4 +1,4 @@ -concrete CatBul of Cat = CatSlavic with (ResSlavic = ResBul) ** open Prelude, (R = ParamX) in { +concrete CatBul of Cat = open ResBul, Prelude, (R = ParamX) in { flags coding=cp1251; optimize=all_subs; @@ -42,7 +42,7 @@ concrete CatBul of Cat = CatSlavic with (ResSlavic = ResBul) ** open Prelude, (R QCl = {s : ResBul.Tense => Anteriority => Polarity => QForm => Str} ; IP = {s : Role => QForm => Str; gn : GenNum} ; IComp = {s : QForm => Str} ; - IDet = {s : Gender => Animacy => QForm => Str; n : Number ; nonEmpty : Bool} ; + IDet = {s : DGender => QForm => Str; n : Number ; nonEmpty : Bool} ; IQuant = {s : GenNum => QForm => Str} ; -- Relative @@ -71,9 +71,10 @@ concrete CatBul of Cat = CatSlavic with (ResSlavic = ResBul) ** open Prelude, (R -- Noun + CN = {s : NForm => Str; g : DGender} ; NP = {s : Role => Str; a : Agr} ; Pron = {s : Role => Str; gen : AForm => Str; a : Agr} ; - Det = {s : Bool => Gender => Animacy => Role => Str; n : Number; countable : Bool; spec : Species} ; + Det = {s : Bool => DGender => Role => Str; n : Number; countable : Bool; spec : Species} ; Predet = {s : GenNum => Str} ; Ord = {s : AForm => Str} ; Num = {s : DGenderSpecies => Str; n : Number; nonEmpty : Bool} ; @@ -89,6 +90,8 @@ concrete CatBul of Cat = CatSlavic with (ResSlavic = ResBul) ** open Prelude, (R -- Structural Conj = {s : Str; distr : Bool; conj : Bool; n : Number} ; + Subj = {s : Str} ; + Prep = {s : Str; c : Case} ; -- Open lexical classes, e.g. Lexicon @@ -101,6 +104,9 @@ concrete CatBul of Cat = CatSlavic with (ResSlavic = ResBul) ** open Prelude, (R A = {s : AForm => Str; adv : Str} ; A2 = {s : AForm => Str; adv : Str; c2 : Str} ; + N = {s : NForm => Str; g : DGender} ; + N2 = {s : NForm => Str; g : DGender} ** {c2 : Preposition} ; + N3 = {s : NForm => Str; g : DGender} ** {c2,c3 : Preposition} ; PN = {s : Str; g : Gender} ; diff --git a/next-lib/src/bulgarian/ConjunctionBul.gf b/next-lib/src/bulgarian/ConjunctionBul.gf index 8a1523a02..23664cd1f 100644 --- a/next-lib/src/bulgarian/ConjunctionBul.gf +++ b/next-lib/src/bulgarian/ConjunctionBul.gf @@ -16,7 +16,7 @@ concrete ConjunctionBul of Conjunction = ConjNP conj ss = { s = \\role => (linCoordSep [])!conj.distr!conj.conj++ss.s!conj.distr!conj.conj!role; - a = {gn = conjGenNum (gennum Masc conj.n) ss.a.gn; p = ss.a.p} + a = {gn = conjGenNum (gennum DMasc conj.n) ss.a.gn; p = ss.a.p} } ; ConjAP conj ss = { diff --git a/next-lib/src/bulgarian/LangBul.gf b/next-lib/src/bulgarian/LangBul.gf index f0a0bd4f0..d92b2533a 100644 --- a/next-lib/src/bulgarian/LangBul.gf +++ b/next-lib/src/bulgarian/LangBul.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../slavic +--# -path=.:../abstract:../common:src/prelude concrete LangBul of Lang = GrammarBul, diff --git a/next-lib/src/bulgarian/MorphoBul.gf b/next-lib/src/bulgarian/MorphoBul.gf index d19e93f9d..6ba3c52ec 100644 --- a/next-lib/src/bulgarian/MorphoBul.gf +++ b/next-lib/src/bulgarian/MorphoBul.gf @@ -21,10 +21,10 @@ resource MorphoBul = ResBul ** open oper --2 Determiners - mkDeterminerSg : Str -> Str -> Str -> {s : Bool => Gender => Animacy => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako -> - {s = \\_,g,_,_ => table Gender [vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ; - mkDeterminerPl : Str -> {s : Bool => Gender => Animacy => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> - {s = \\_,_,_,_ => vsicki; sp = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ; + mkDeterminerSg : Str -> Str -> Str -> {s : Bool => DGender => Role => Str; n : Number; countable : Bool ; spec : Species} = \vseki,vsiaka,vsiako -> + {s = \\_,g,_ => table DGender [vseki;vseki;vsiaka;vsiako] ! g; n = Sg; countable = False; spec = Indef} ; + mkDeterminerPl : Str -> {s : Bool => DGender => Role => Str ; n : Number; countable : Bool ; spec : Species} = \vsicki -> + {s = \\_,_,_ => vsicki; sp = \\_,_ => vsicki; n = Pl; countable = False; spec = Indef} ; mkQuant : Str -> Str -> Str -> Str -> {s : Bool => AForm => Str; nonEmpty : Bool; spec : Species} = \tozi,tazi,towa,tezi -> { s = \\_ => table { @@ -105,7 +105,7 @@ oper --2 Nouns - mkNoun : Str -> Str -> Str -> Str -> Gender -> Animacy -> N = \sg,pl,count,voc,g,anim -> { + mkNoun : Str -> Str -> Str -> Str -> DGender -> N = \sg,pl,count,voc,g -> { s = table { NF Sg Indef => sg ; NF Sg Def => case sg of { @@ -158,7 +158,6 @@ oper NFVocative => voc } ; g = g ; - anim = anim ; lock_N = <> } ; diff --git a/next-lib/src/bulgarian/MorphoFunsBul.gf b/next-lib/src/bulgarian/MorphoFunsBul.gf index 04962bdac..a553e932a 100644 --- a/next-lib/src/bulgarian/MorphoFunsBul.gf +++ b/next-lib/src/bulgarian/MorphoFunsBul.gf @@ -142,7 +142,7 @@ oper -- prepN2 : N -> Prep -> N2 ; - prepN2 n p = {s = n.s; g = n.g; anim=n.anim ; c2 = p; lock_N2 = <>} ; + prepN2 n p = {s = n.s; g = n.g; c2 = p; lock_N2 = <>} ; dirN2 : N -> N2 ; dirN2 n = prepN2 n noPrep ; @@ -152,7 +152,7 @@ oper -- prepN3 : N -> Prep -> Prep -> N3 ; - prepN3 n p q = {s = n.s; g = n.g; anim=n.anim ; c2 = p; c3 = q; lock_N3 = <>} ; + prepN3 n p q = {s = n.s; g = n.g; c2 = p; c3 = q; lock_N3 = <>} ; dirN3 : N -> Prep -> N3 ; dirN3 n p = prepN3 n noPrep p ; diff --git a/next-lib/src/bulgarian/NounBul.gf b/next-lib/src/bulgarian/NounBul.gf index 89aa34e69..e9206e443 100644 --- a/next-lib/src/bulgarian/NounBul.gf +++ b/next-lib/src/bulgarian/NounBul.gf @@ -22,7 +22,7 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { } } } ; - s = det.s ! True ! cn.g ! cn.anim ! role ++ cn.s ! nf + s = det.s ! True ! cn.g ! role ++ cn.s ! nf in case role of { RObj Dat => "" ++ s; _ => s @@ -31,12 +31,12 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { } ; DetNP det = - { s = \\role => let s = det.s ! False ! Neut ! Inanimate ! role + { s = \\role => let s = det.s ! False ! DNeut ! role in case role of { RObj Dat => "" ++ s; _ => s } ; - a = {gn = gennum Neut det.n; p = P3} ; + a = {gn = gennum DNeut det.n; p = P3} ; } ; UsePN pn = { s = table { @@ -63,19 +63,19 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { } ; DetQuant quant num = { - s = \\sp,g,anim,c => let sp' = case num.nonEmpty of { True => True ; - False => sp } - in quant.s ! sp' ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++ - num.s ! dgenderSpecies g anim quant.spec c ; + s = \\sp,g,c => let sp' = case num.nonEmpty of { True => True ; + False => sp } + in quant.s ! sp' ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++ + num.s ! dgenderSpecies g quant.spec c ; n = num.n ; countable = num.nonEmpty ; spec = case num.nonEmpty of {True=>Indef; _=>quant.spec} } ; DetQuantOrd = \quant, num, ord -> { - s = \\_,g,anim,c => quant.s ! True ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++ - num.s ! dgenderSpecies g anim quant.spec c ++ - ord.s ! aform (gennum g num.n) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ; + s = \\_,g,c => quant.s ! True ! aform (gennum g num.n) (case c of {RVoc=>Indef; _=>Def}) c ++ + num.s ! dgenderSpecies g quant.spec c ++ + ord.s ! aform (gennum g num.n) (case num.nonEmpty of {True=>Indef; _=>quant.spec}) c ; n = num.n ; countable = num.nonEmpty ; spec=Indef @@ -144,21 +144,11 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { UseN noun = noun ; UseN2 noun = noun ; - ComplN2 f x = { - s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! RObj f.c2.c ; - g=f.g ; - anim = f.anim - } ; + ComplN2 f x = {s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! RObj f.c2.c; g=f.g} ; + ComplN3 f x = {s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! RObj f.c2.c; c2 = f.c3; g=f.g} ; - ComplN3 f x = { - s = \\nf => f.s ! nf ++ f.c2.s ++ x.s ! RObj f.c2.c ; - c2 = f.c3 ; - g=f.g ; - anim = f.anim - } ; - - Use2N3 f = {s = f.s ; g=f.g ; anim=f.anim ; c2 = f.c2} ; - Use3N3 f = {s = f.s ; g=f.g ; anim=f.anim ; c2 = f.c3} ; + Use2N3 f = {s = f.s ; g=f.g ; c2 = f.c2} ; + Use3N3 f = {s = f.s ; g=f.g ; c2 = f.c3} ; AdjCN ap cn = { @@ -166,27 +156,20 @@ concrete NounBul of Noun = CatBul ** open ResBul, Prelude in { True => (ap.s ! nform2aform nf cn.g) ++ (cn.s ! (indefNForm nf)) ; False => (cn.s ! nf) ++ (ap.s ! nform2aform (indefNForm nf) cn.g) } ; - g = cn.g ; - anim = cn.anim + g = cn.g } ; RelCN cn rs = { s = \\nf => cn.s ! nf ++ rs.s ! {gn=gennum cn.g (numNForm nf); p=P3} ; - g = cn.g ; - anim = cn.anim + g = cn.g } ; AdvCN cn ad = { s = \\nf => cn.s ! nf ++ ad.s ; - g = cn.g ; - anim = cn.anim + g = cn.g } ; - SentCN cn sc = {s = \\nf => cn.s ! nf ++ sc.s; g=Neut; anim=Inanimate} ; + SentCN cn sc = {s = \\nf => cn.s ! nf ++ sc.s; g=DNeut} ; - ApposCN cn np = { - s = \\nf => cn.s ! nf ++ np.s ! RSubj; - g=cn.g ; - anim = cn.anim - } ; + ApposCN cn np = {s = \\nf => cn.s ! nf ++ np.s ! RSubj; g=cn.g} ; RelNP np rs = { s = \\r => np.s ! r ++ rs.s ! np.a ; diff --git a/next-lib/src/bulgarian/ParadigmsBul.gf b/next-lib/src/bulgarian/ParadigmsBul.gf index d7b777ce6..d633d3a1f 100644 --- a/next-lib/src/bulgarian/ParadigmsBul.gf +++ b/next-lib/src/bulgarian/ParadigmsBul.gf @@ -13,8 +13,7 @@ oper (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN002 : Str -> N ; mkN002 base = let v0 = tk 2 base; v1 = last (base) @@ -22,8 +21,7 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN002a : Str -> N ; mkN002a base = let v0 = tk 2 base; v1 = last (base) @@ -31,8 +29,7 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN003 : Str -> N ; mkN003 base = let v0 = tk 3 base; v1 = last (base) @@ -40,56 +37,49 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN004 : Str -> N ; mkN004 base = let v0 = tk 4 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN005 : Str -> N ; mkN005 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN006 : Str -> N ; mkN006 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN007 : Str -> N ; mkN007 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN007b : Str -> N ; mkN007b base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"") - Masc - Inanimate ; + DMasc ; mkN007a : Str -> N ; mkN007a base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN008 : Str -> N ; mkN008 base = let v0 = tk 2 base; v1 = last (base) @@ -97,16 +87,14 @@ oper (v0+v1+"") (v0+""+v1+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN008a : Str -> N ; mkN008a base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN009 : Str -> N ; mkN009 base = let v0 = tk 2 base; v1 = last (base) @@ -114,96 +102,84 @@ oper (v0+v1+"") (v0+""+v1+"") (v0+v1+"") - Masc - Inanimate ; + DMasc ; mkN009a : Str -> N ; mkN009a base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN010 : Str -> N ; mkN010 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN011 : Str -> N ; mkN011 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN012 : Str -> N ; mkN012 base = let v0 = tk 3 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN013 : Str -> N ; mkN013 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN014 : Str -> N ; mkN014 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN014a : Str -> N ; mkN014a base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Masc - Inanimate ; + DMasc ; mkN015 : Str -> N ; mkN015 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN016 : Str -> N ; mkN016 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN017 : Str -> N ; mkN017 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN018 : Str -> N ; mkN018 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN018a : Str -> N ; mkN018a base = let v0 = tk 2 base; v1 = last (base) @@ -211,24 +187,21 @@ oper (v0+"") (v0+"-") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN019 : Str -> N ; mkN019 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN019a : Str -> N ; mkN019a base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN020 : Str -> N ; mkN020 base = let v0 = tk 3 base; v1 = last (tk 2 base) @@ -236,248 +209,217 @@ oper (v0+""+v1+"") (v0+"-") (v0+v1+"") - Masc - Inanimate ; + DMasc ; mkN021 : Str -> N ; mkN021 base = let v0 = tk 3 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN022 : Str -> N ; mkN022 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN023 : Str -> N ; mkN023 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN024a : Str -> N ; mkN024a base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN024 : Str -> N ; mkN024 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN025 : Str -> N ; mkN025 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"-") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN026 : Str -> N ; mkN026 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN027 : Str -> N ; mkN027 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN028 : Str -> N ; mkN028 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN028a : Str -> N ; mkN028a base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN029 : Str -> N ; mkN029 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN030 : Str -> N ; mkN030 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN031 : Str -> N ; mkN031 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN031a : Str -> N ; mkN031a base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN032 : Str -> N ; mkN032 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN032a : Str -> N ; mkN032a base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN033 : Str -> N ; mkN033 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN034 : Str -> N ; mkN034 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN035 : Str -> N ; mkN035 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN035a : Str -> N ; mkN035a base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN036 : Str -> N ; mkN036 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN037 : Str -> N ; mkN037 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN038 : Str -> N ; mkN038 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Animate ; + DMascPersonal ; mkN039 : Str -> N ; mkN039 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN040 : Str -> N ; mkN040 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"-") (v0+"") - Masc - Inanimate ; + DMasc ; mkN040a : Str -> N ; mkN040a base = let v0 = base in mkNoun (v0) (v0+"-") (v0+"-") (v0+"-") - Masc - Inanimate ; + DMasc ; mkN041 : Str -> N ; mkN041 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN041a : Str -> N ; mkN041a base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Fem - Inanimate ; + DFem ; mkN041b : Str -> N ; mkN041b base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Fem - Inanimate ; + DFem ; mkN042 : Str -> N ; mkN042 base = let v0 = base in mkNoun (v0) (v0) (v0) (v0+"-") - Fem - Inanimate ; + DFem ; mkN043 : Str -> N ; mkN043 base = let v0 = tk 3 base; v1 = last (tk 1 base) @@ -485,8 +427,7 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN043a : Str -> N ; mkN043a base = let v0 = tk 4 base; v1 = last (tk 2 base) @@ -494,64 +435,56 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN044 : Str -> N ; mkN044 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN045 : Str -> N ; mkN045 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN046 : Str -> N ; mkN046 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN047 : Str -> N ; mkN047 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN048 : Str -> N ; mkN048 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Fem - Inanimate ; + DFem ; mkN049 : Str -> N ; mkN049 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN050 : Str -> N ; mkN050 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN051 : Str -> N ; mkN051 base = let v0 = tk 2 base; v1 = last (base) @@ -559,24 +492,21 @@ oper (v0+v1+"") (v0+v1+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN052 : Str -> N ; mkN052 base = let v0 = tk 5 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN052a : Str -> N ; mkN052a base = let v0 = tk 6 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN053 : Str -> N ; mkN053 base = let v0 = tk 3 base; v1 = last (base) @@ -584,32 +514,28 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+"-") - Fem - Inanimate ; + DFem ; mkN054 : Str -> N ; mkN054 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN055 : Str -> N ; mkN055 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN056 : Str -> N ; mkN056 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN057 : Str -> N ; mkN057 base = let v0 = tk 3 base; v1 = last (tk 1 base) @@ -617,160 +543,140 @@ oper (v0+""+v1+"") (v0+""+v1+"") (v0+""+v1+"") - Neut - Inanimate ; + DNeut ; mkN057a : Str -> N ; mkN057a base = let v0 = tk 4 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN058 : Str -> N ; mkN058 base = let v0 = tk 3 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN059 : Str -> N ; mkN059 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN060 : Str -> N ; mkN060 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN061 : Str -> N ; mkN061 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN062 : Str -> N ; mkN062 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN063 : Str -> N ; mkN063 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN064 : Str -> N ; mkN064 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN065 : Str -> N ; mkN065 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0) - Neut - Inanimate ; + DNeut ; mkN066 : Str -> N ; mkN066 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN067 : Str -> N ; mkN067 base = let v0 = tk 2 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN068 : Str -> N ; mkN068 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN069 : Str -> N ; mkN069 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0) - Neut - Inanimate ; + DNeut ; mkN070 : Str -> N ; mkN070 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0) - Neut - Inanimate ; + DNeut ; mkN071 : Str -> N ; mkN071 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN072 : Str -> N ; mkN072 base = let v0 = tk 1 base in mkNoun (v0+"") (v0+"") (v0+"") (v0+"") - Neut - Inanimate ; + DNeut ; mkN073 : Str -> N ; mkN073 base = let v0 = base in mkNoun (v0) (v0+"") (v0+"") (v0) - Neut - Inanimate ; + DNeut ; mkN074 : Str -> N ; mkN074 base = let v0 = tk 1 base in mkNoun (v0+"-") (v0) (v0) (v0+"-") - Neut - Inanimate ; + DNeut ; mkN075 : Str -> N ; mkN075 base = let v0 = tk 1 base in mkNoun (v0+"-") (v0) (v0) (v0+"-") - Neut - Inanimate ; + DNeut ; mkA076 : Str -> A ; mkA076 base = let v0 = base in mkAdjective (v0) diff --git a/next-lib/src/bulgarian/QuestionBul.gf b/next-lib/src/bulgarian/QuestionBul.gf index 33781a46b..36f78a1eb 100644 --- a/next-lib/src/bulgarian/QuestionBul.gf +++ b/next-lib/src/bulgarian/QuestionBul.gf @@ -43,18 +43,18 @@ concrete QuestionBul of Question = CatBul ** open ResBul, Prelude in { => NFPlCount ; _ => NF idet.n Indef } - in idet.s ! cn.g ! cn.anim ! qform ++ cn.s ! nf ; + in idet.s ! cn.g ! qform ++ cn.s ! nf ; gn = gennum cn.g idet.n } ; IdetIP idet = { - s = \\_ => idet.s ! Neut ! Inanimate ; - gn = gennum Neut idet.n + s = \\_ => idet.s ! DNeut ; + gn = gennum DNeut idet.n } ; IdetQuant iquant num = { - s = \\g,anim,qform => iquant.s ! gennum g num.n ! qform ++ - num.s ! dgenderSpecies g anim Indef RSubj ; + s = \\g,qform => iquant.s ! gennum g num.n ! qform ++ + num.s ! dgenderSpecies g Indef RSubj ; n = num.n ; nonEmpty = num.nonEmpty } ; diff --git a/next-lib/src/bulgarian/ResBul.gf b/next-lib/src/bulgarian/ResBul.gf index bb92432e8..09072eda0 100644 --- a/next-lib/src/bulgarian/ResBul.gf +++ b/next-lib/src/bulgarian/ResBul.gf @@ -7,7 +7,7 @@ -- implement $Test$, it moreover contains regular lexical -- patterns needed for $Lex$. -instance ResBul of ResSlavic = ParamX, DiffBul, CommonSlavic ** open Prelude in { +resource ResBul = ParamX ** open Prelude in { flags coding=cp1251 ; optimize=all ; @@ -21,8 +21,27 @@ instance ResBul of ResSlavic = ParamX, DiffBul, CommonSlavic ** open Prelude in param Role = RSubj | RObj Case | RVoc ; + Case = Acc | Dat; - param + NForm = + NF Number Species + | NFSgDefNom + | NFPlCount + | NFVocative + ; + + GenNum = GSg Gender | GPl ; + +-- Agreement of $NP$ is a record. We'll add $Gender$ later. + + oper + Agr = {gn : GenNum ; p : Person} ; + + param + Gender = Masc | Fem | Neut ; + + Species = Indef | Def ; + -- The plural never makes a gender distinction. --2 For $Verb$ @@ -60,6 +79,13 @@ instance ResBul of ResSlavic = ParamX, DiffBul, CommonSlavic ** open Prelude in ; --2 For $Numeral$ + + DGender = + DMasc + | DMascPersonal + | DFem + | DNeut + ; DGenderSpecies = DMascIndef @@ -80,6 +106,9 @@ instance ResBul of ResSlavic = ParamX, DiffBul, CommonSlavic ** open Prelude in --2 Transformations between parameter types oper + agrP3 : GenNum -> Agr = \gn -> + {gn = gn; p = P3} ; + conjGenNum : GenNum -> GenNum -> GenNum = \a,b -> case of { => GSg g ; @@ -91,6 +120,23 @@ instance ResBul of ResSlavic = ParamX, DiffBul, CommonSlavic ** open Prelude in p = conjPerson a.p b.p } ; + gennum : DGender -> Number -> GenNum = \g,n -> + case n of { + Sg => GSg (case g of { + DMasc => Masc ; + DMascPersonal => Masc ; + DFem => Fem ; + DNeut => Neut + }) ; + Pl => GPl + } ; + + numGenNum : GenNum -> Number = \gn -> + case gn of { + GSg _ => Sg ; + GPl => Pl + } ; + aform : GenNum -> Species -> Role -> AForm = \gn,spec,role -> case gn of { GSg g => case of { @@ -100,30 +146,25 @@ instance ResBul of ResSlavic = ParamX, DiffBul, CommonSlavic ** open Prelude in GPl => APl spec } ; - dgenderSpecies : Gender -> Animacy -> Species -> Role -> DGenderSpecies = - \g,anim,spec,role -> - case of { - => case anim of { - Inanimate => DMascIndef ; - Animate => DMascPersonalIndef - } ; - => case anim of { - Inanimate => case role of { - RSubj => DMascDefNom ; - _ => DMascDef - } ; - Animate => case role of { - RSubj => DMascPersonalDefNom ; - _ => DMascPersonalDef - } - } ; - => DFemIndef ; - => DFemDef ; - => DNeutIndef ; - => DNeutDef + dgenderSpecies : DGender -> Species -> Role -> DGenderSpecies = + \g,spec,role -> case of { + => DMascIndef ; + => case role of { + RSubj => DMascDefNom ; + _ => DMascDef + } ; + => DMascPersonalIndef ; + => case role of { + RSubj => DMascPersonalDefNom ; + _ => DMascPersonalDef + } ; + => DFemIndef ; + => DFemDef ; + => DNeutIndef ; + => DNeutDef } ; - nform2aform : NForm -> Gender -> AForm + nform2aform : NForm -> DGender -> AForm = \nf,g -> case nf of { NF n spec => aform (gennum g n) spec (RObj Acc) ; NFSgDefNom => aform (gennum g Sg) Def RSubj ; diff --git a/next-lib/src/bulgarian/SentenceBul.gf b/next-lib/src/bulgarian/SentenceBul.gf index 7c4ae219f..9966b538d 100644 --- a/next-lib/src/bulgarian/SentenceBul.gf +++ b/next-lib/src/bulgarian/SentenceBul.gf @@ -68,5 +68,5 @@ concrete SentenceBul of Sentence = CatBul ** open Prelude, ResBul in { AdvS a s = {s = a.s ++ "," ++ s.s} ; - RelS s r = {s = s.s ++ "," ++ r.s ! {gn=gennum Neut Sg; p=P3}} ; + RelS s r = {s = s.s ++ "," ++ r.s ! {gn=gennum DNeut Sg; p=P3}} ; } diff --git a/next-lib/src/bulgarian/StructuralBul.gf b/next-lib/src/bulgarian/StructuralBul.gf index b01b4e6f4..4ff725d26 100644 --- a/next-lib/src/bulgarian/StructuralBul.gf +++ b/next-lib/src/bulgarian/StructuralBul.gf @@ -28,7 +28,7 @@ concrete StructuralBul of Structural = CatBul ** every_Det = mkDeterminerSg "" "" ""; everything_NP = mkNP "" (GSg Neut) P3 ; everywhere_Adv = ss "" ; - few_Det = {s = \\_,_,_,_ => ""; n = Pl; countable = True; spec = Indef} ; + few_Det = {s = \\_,_,_ => ""; n = Pl; countable = True; spec = Indef} ; --- first_Ord = ss "first" ; DEPRECATED for_Prep = mkPrep "" Acc ; from_Prep = mkPrep "" Acc ; @@ -37,7 +37,7 @@ concrete StructuralBul of Structural = CatBul ** here7to_Adv = ss [" "] ; here7from_Adv = ss [" "] ; how_IAdv = mkIAdv "" ; - how8many_IDet = {s = \\_,_ => table QForm ["";""]; n = Pl; nonEmpty = False} ; + how8many_IDet = {s = \\_ => table QForm ["";""]; n = Pl; nonEmpty = False} ; if_Subj = ss "" ; in8front_Prep = mkPrep "" Acc ; i_Pron = mkPron "" "" "" "" "" "" "" "" "" "" "" "" (GSg Masc) P1 ; diff --git a/next-lib/src/bulgarian/SymbolBul.gf b/next-lib/src/bulgarian/SymbolBul.gf index 609badfba..814cbbf71 100644 --- a/next-lib/src/bulgarian/SymbolBul.gf +++ b/next-lib/src/bulgarian/SymbolBul.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../slavic +--# -path=.:abstract:common concrete SymbolBul of Symbol = CatBul ** open Prelude, ResBul in { @@ -15,9 +15,7 @@ lin a = agrP3 (gennum cn.g Sg) } ; CNSymbNP det cn xs = { - s = \\c => - det.s ! False ! cn.g ! Inanimate ! RSubj ++ ---- AR 2/12: Inanimate - cn.s ! NF det.n Indef ++ xs.s ; + s = \\c => det.s ! False ! cn.g ! RSubj ++ cn.s ! NF det.n Indef ++ xs.s ; a = agrP3 (gennum cn.g det.n) } ; CNNumNP cn i = { diff --git a/next-lib/src/russian/AdjectiveRus.gf b/next-lib/src/russian/AdjectiveRus.gf index 5a977e371..23336bb98 100644 --- a/next-lib/src/russian/AdjectiveRus.gf +++ b/next-lib/src/russian/AdjectiveRus.gf @@ -37,13 +37,13 @@ flags coding=utf8 ; -- $SuperlA$ belongs to determiner syntax in $Noun$. ComplA2 vlublen tu = - {s = \\af => vlublen.s !Posit! af ++ vlublen.s2 ++ - tu.s ! (mkPronForm vlublen.c No NonPoss) ; + {s = \\af => vlublen.s !Posit! af ++ vlublen.c2.s ++ + tu.s ! (mkPronForm vlublen.c2.c No NonPoss) ; p = True } ; ReflA2 vlublen = - {s = \\af => vlublen.s !Posit! af ++ vlublen.s2 ++ sam.s ! vlublen.c; + {s = \\af => vlublen.s !Posit! af ++ vlublen.c2.s ++ sam.s ! vlublen.c2.c; p = True } ; diff --git a/next-lib/src/russian/AllRus.gf b/next-lib/src/russian/AllRus.gf index 33140569c..024ce67e1 100644 --- a/next-lib/src/russian/AllRus.gf +++ b/next-lib/src/russian/AllRus.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../slavic +--# -path=.:../abstract:../common:prelude concrete AllRus of AllRusAbs = LangRus, diff --git a/next-lib/src/russian/CatRus.gf b/next-lib/src/russian/CatRus.gf index b7deaf155..e71eabf69 100644 --- a/next-lib/src/russian/CatRus.gf +++ b/next-lib/src/russian/CatRus.gf @@ -1,6 +1,6 @@ --# -path=.:../abstract:../common:../../prelude -concrete CatRus of Cat = CommonX ** CatSlavic with (ResSlavic = ResRus) ** open ResRus, Prelude, (R = ParamX) in { +concrete CatRus of Cat = CommonX ** open ResRus, Prelude in { flags optimize=all_subs ; coding=utf8 ; @@ -22,7 +22,8 @@ concrete CatRus of Cat = CommonX ** CatSlavic with (ResSlavic = ResRus) ** open -- Question QCl = {s :Polarity => ClForm => QForm => Str}; - IP = {s : PronForm => Str; a : Agr; anim : Animacy} ; + IP = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; anim : Animacy ; pron: Bool} ; IComp = {s : Str} ; IDet = Adjective ** {n: Number; g: PronGen; c: Case} ; IQuant = {s : Number => AdjForm => Str; g: PronGen; c: Case} ; -- AR 16/6/2008 @@ -43,8 +44,11 @@ concrete CatRus of Cat = CommonX ** CatSlavic with (ResSlavic = ResRus) ** open -- Noun - NP = {s : PronForm => Str; a : Agr; anim : Animacy} ; - Pron = {s : PronForm => Str; a : Agr} ; + CN = {s : NForm => Str; g : Gender; anim : Animacy} ; + NP = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; anim : Animacy ; pron: Bool} ; + Pron = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; pron: Bool} ; -- Determiners (only determinative pronouns -- (or even indefinite numerals: "много" (many)) in Russian) are inflected @@ -69,20 +73,25 @@ concrete CatRus of Cat = CommonX ** CatSlavic with (ResSlavic = ResRus) ** open -- case of "или", the result is however plural if any of the disjuncts is. Conj = {s1,s2 : Str ; n : Number} ; + Subj = {s : Str} ; + Prep = Complement ; -- Open lexical classes, e.g. Lexicon V, VS, VV, VQ, VA = Verbum ; -- = {s : VerbForm => Str ; asp : Aspect } ; - V2, V2A = Verbum ** Complement ; - V2V, V2S, V2Q = Verbum ** Complement ; --- AR - V3 = Verbum ** Complement** {s4 : Str; c2: Case} ; + V2, V2A = Verbum ** {c2 : Complement} ; + V2V, V2S, V2Q = Verbum ** {c2 : Complement} ; --- AR + V3 = Verbum ** {c2,c3 : Complement} ; -- VV = {s : VVForm => Str ; isAux : Bool} ; Ord = {s : AdjForm => Str} ; A = {s : Degree => AdjForm => Str} ; - A2 = A ** Complement ; + A2 = A ** {c2 : Complement} ; -- Substantives moreover have an inherent gender. + N = {s : NForm => Str; g : Gender; anim : Animacy} ; + N2 = {s : NForm => Str; g : Gender; anim : Animacy} ** {c2 : Complement} ; + N3 = {s : NForm => Str; g : Gender; anim : Animacy} ** {c2,c3 : Complement} ; PN = {s : Case => Str ; g : Gender ; anim : Animacy} ; diff --git a/next-lib/src/russian/ConjunctionRus.gf b/next-lib/src/russian/ConjunctionRus.gf index 9810b5d22..783399ad0 100644 --- a/next-lib/src/russian/ConjunctionRus.gf +++ b/next-lib/src/russian/ConjunctionRus.gf @@ -11,13 +11,11 @@ concrete ConjunctionRus of Conjunction = ConjAdv = conjunctDistrSS ; - ConjNP c xs = conjunctDistrTable PronForm c xs ** { - a = {n = conjNumber c.n xs.a.n; - p = xs.a.p; - g = xs.a.g - }; - anim = xs.anim - } ; + ConjNP c xs = + conjunctDistrTable PronForm c xs ** {n = conjNumber c.n xs.n ; + p = xs.p ; pron = xs.pron ; anim = xs.anim ; + g = xs.g } ; + ConjAP c xs = conjunctDistrTable AdjForm c xs ** {p = xs.p} ; @@ -32,26 +30,20 @@ concrete ConjunctionRus of Conjunction = ConsAdv = consrSS comma ; - ConsNP x xs = consTable PronForm comma xs x ** { - a = {n = conjNumber xs.a.n x.a.n; - g = conjPGender x.a.g xs.a.g; - p = conjPerson xs.a.p x.a.p - }; - anim = conjAnim x.anim xs.anim - } ; + ConsNP x xs = + consTable PronForm comma xs x ** + {n = conjNumber xs.n x.n ; g = conjPGender x.g xs.g ; + anim = conjAnim x.anim xs.anim ; + p = conjPerson xs.p x.p; pron = conjPron xs.pron x.pron} ; ConsAP x xs = consTable AdjForm comma xs x ** {p = andB xs.p x.p} ; BaseAP x y = twoTable AdjForm x y ** {p = andB x.p y.p} ; - BaseNP x y = twoTable PronForm x y ** { - a = {n = conjNumber x.a.n y.a.n; - g = conjPGender x.a.g y.a.g; - p = conjPerson x.a.p y.a.p - }; - anim = conjAnim x.anim y.anim - } ; + BaseNP x y = 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 } ; ---- AR 17/12/2008 BaseRS x y = twoTable3 GenNum Case Animacy x y ** {c = y.c} ; @@ -64,7 +56,8 @@ concrete ConjunctionRus of Conjunction = [Adv] = {s1,s2 : Str} ; -- 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. - [NP] = {s1,s2 : PronForm => Str; a : Agr; anim : Animacy} ; + [NP] = { s1,s2 : PronForm => Str ; g: PronGen ; + anim : Animacy ; n : Number ; p : Person ; pron : Bool } ; -- The structure is the same as for sentences. The result is a prefix adjective -- if and only if all elements are prefix. [AP] = {s1,s2 : AdjForm => Str ; p : Bool} ; @@ -90,6 +83,14 @@ oper -- conjPerson : Person -> Person -> Person = \_,p -> -- p ; +-- For pron, we let the latter argument win - "Маша или моя мама" (Nominative case) +-- but - "моей или Машина мама" (Genetive case) both corresponds to +-- "Masha's or my mother"), which is actually not exactly correct, since +-- different cases should be used - "Машина или моя мама". + + conjPron : Bool -> Bool -> Bool = \_,p -> + p ; + -- For gender in a similar manner as for person: -- Needed for adjective predicates like: -- "Маша или Оля - красивая", "Антон или Олег - красивый", diff --git a/next-lib/src/russian/DiffRus.gf b/next-lib/src/russian/DiffRus.gf deleted file mode 100644 index a1d2dafff..000000000 --- a/next-lib/src/russian/DiffRus.gf +++ /dev/null @@ -1,17 +0,0 @@ -instance DiffRus of DiffSlavic = open CommonSlavic, Prelude in { - - param - PrepKind = PrepOther | PrepVNa; - Case = Nom | Gen | Dat | Acc | Inst | Prepos PrepKind ; - - NForm = NF Number Case ; - - PronGen = PGen Gender | PNoGen ; - - oper - Agr = {n : Number; p : Person; g : PronGen} ; - - agrP3 : Number -> PronGen -> Agr = \n,g -> - {n = n; p = P3; g = g} ; - -} \ No newline at end of file diff --git a/next-lib/src/russian/IdiomRus.gf b/next-lib/src/russian/IdiomRus.gf index a398e54ad..1c64ae51d 100644 --- a/next-lib/src/russian/IdiomRus.gf +++ b/next-lib/src/russian/IdiomRus.gf @@ -7,9 +7,9 @@ concrete IdiomRus of Idiom = CatRus ** open Prelude, ResRus, MorphoRus in { lin ExistNP = \bar -> {s =\\b,clf => case b of - {Pos => verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen bar.a.g) Sg P3) + {Pos => verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen bar.g) Sg P3) ++ bar.s ! PF Nom No NonPoss; - Neg => "не" ++ verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen bar.a.g) Sg P3) + Neg => "не" ++ verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen bar.g) Sg P3) ++ bar.s ! PF Nom No NonPoss } } ; @@ -17,8 +17,8 @@ concrete IdiomRus of Idiom = CatRus ** open Prelude, ResRus, MorphoRus in { ExistIP Kto = let { kto = Kto.s ! (PF Nom No NonPoss) } in {s = \\b,clf,_ => case b of - {Pos => kto ++ verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen Kto.a.g) Sg P3) ; - Neg => kto ++ "не" ++ verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen Kto.a.g) Sg P3) + {Pos => kto ++ verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen Kto.g) Sg P3) ; + Neg => kto ++ "не" ++ verbSuchestvovat.s ! (getActVerbForm clf (pgen2gen Kto.g) Sg P3) } } ; @@ -29,7 +29,7 @@ concrete IdiomRus of Idiom = CatRus ** open Prelude, ResRus, MorphoRus in { CleftNP np rs = {s= \\ b, clf => let ne= case b of {Pos =>[]; Neg =>"не"}; - gn = case np.a.n of {Pl => GPl; _=> GSg (pgen2gen np.a.g)} + gn = case np.n of {Pl => GPl; _=> GSg (pgen2gen np.g)} in "это" ++ ne ++ np.s ! (PF Nom No NonPoss) ++ rs.s ! gn !Nom!Animate }; diff --git a/next-lib/src/russian/LangRus.gf b/next-lib/src/russian/LangRus.gf index 00a515c58..c41981d63 100644 --- a/next-lib/src/russian/LangRus.gf +++ b/next-lib/src/russian/LangRus.gf @@ -1,4 +1,4 @@ ---# -path=.:../abstract:../common:../slavic:prelude +--# -path=.:../abstract:../common:src/prelude concrete LangRus of Lang = GrammarRus, diff --git a/next-lib/src/russian/MorphoRus.gf b/next-lib/src/russian/MorphoRus.gf index 0c844e428..c5bac7bd0 100644 --- a/next-lib/src/russian/MorphoRus.gf +++ b/next-lib/src/russian/MorphoRus.gf @@ -64,7 +64,7 @@ oper pronYaTu : { s : Case => Str } -> Str -> Person -> Pronoun = } } ; - a = {g = PNoGen; n = Sg; p = pers}; + g = PNoGen ; n = Sg ; p = pers ; pron = True } ; oper pronNAfterPrep : Pronoun -> Pronoun = \p -> @@ -73,7 +73,7 @@ oper pronNAfterPrep : Pronoun -> Pronoun = \p -> x@(("е"|"ё"|"и")+_) => "н"+x; x => x }; pf => p.s!pf }; - a = p.a; + g = p.g ; n = p.n ; p = p.p ; pron = p.pron } ; oper pronOn : Pronoun = pronNAfterPrep @@ -85,7 +85,7 @@ oper pronOn : Pronoun = pronNAfterPrep PF Inst _ _ => "им" ; PF (Prepos _) _ _ => "ём" } ; - a = agrP3 Sg (PGen Masc) + g = PGen Masc ; n = Sg ; p = P3 ; pron = True } ; oper pronOna : Pronoun = pronNAfterPrep @@ -95,7 +95,7 @@ oper pronOna : Pronoun = pronNAfterPrep PF (Gen|Acc) _ _ => "её" ; PF (Dat|Inst|Prepos _) _ _ => "ей" } ; - a = agrP3 Sg (PGen Fem) + g = PGen Fem ; n = Sg ; p = P3 ; pron = True } ; oper pronOno: Pronoun = @@ -103,7 +103,7 @@ oper pronOno: Pronoun = PF Nom _ NonPoss => "оно" ; pf => pronOn.s!pf } ; - a = agrP3 Sg (PGen Neut) + g = PGen Neut ; n = Sg ; p = P3 ; pron = True } ; oper pronMuVu : Str -> Str -> Person -> Pronoun = @@ -138,7 +138,7 @@ oper pronMuVu : Str -> Str -> Person -> Pronoun = PF Inst _ (Poss GPl) => na + "шими" ; PF (Prepos _) _ (Poss GPl) => na + "ших" }; - a = {g = PNoGen; n = Pl; p = pers} + g = PNoGen ; n = Pl ; p = pers ; pron = True } ; oper pronMu: Pronoun = pronMuVu "мы" "на" P1; @@ -153,7 +153,7 @@ oper pronOni: Pronoun = pronNAfterPrep PF (Gen|Acc|Prepos _) _ _ => "их" ; PF Inst _ _ => "ими" } ; - a = agrP3 Pl PNoGen + g = PNoGen ; n = Pl ; p = P3 ; pron = True } ; oper pronKto: Pronoun = @@ -165,7 +165,10 @@ oper pronKto: Pronoun = PF Inst _ _ => "кем" ; PF (Prepos _) _ _ => "ком" } ; - a = agrP3 Sg (PGen Masc) + g = PGen Masc; + n = Sg ; + p = P3 ; + pron = False } ; oper pronChto: Pronoun = @@ -177,12 +180,18 @@ oper pronChto: Pronoun = PF Inst _ _ => "чем" ; PF (Prepos _) _ _ => "чём" } ; - a = agrP3 Sg (PGen Masc) + g = PGen Masc; + n = Sg ; + p = P3 ; + pron = False } ; oper pron_add_to : Pronoun -> Pronoun = \p -> { s = \\pf => (p.s!pf) + "-то" ; - a = p.a + g = p.g ; + n = p.n ; + p = p.p ; + pron = p.pron } ; oper pronKtoTo : Pronoun = pron_add_to pronKto ; @@ -198,8 +207,11 @@ oper pronEti: Pronoun = PF Inst _ _ => "этими" ; PF (Prepos _) _ _ => "этих" } ; - a = agrP3 Pl (PGen Fem) ; - anim = Animate + n = Pl; + p = P3; + g= PGen Fem ; + anim = Animate ; + pron = False } ; oper pronTe: Pronoun = @@ -211,8 +223,11 @@ oper pronTe: Pronoun = PF Inst _ _ => "теми" ; PF (Prepos _) _ _ => "тех" } ; - a = agrP3 Pl (PGen Fem) ; - anim = Animate + n = Pl; + p = P3; + g=PGen Fem ; + anim = Animate ; + pron = False } ; @@ -227,7 +242,8 @@ oper pronTe: Pronoun = -- } ; -- g = PGen Masc; -- n = Sg ; --- p = P3 +-- p = P3 ; +-- pron = False -- } ; -- --oper pronNichto: Pronoun = @@ -241,7 +257,8 @@ oper pronTe: Pronoun = -- } ; -- g = PGen Masc; -- n = Sg ; --- p = P3 +-- p = P3 ; +-- pron = False -- } ; -- @@ -254,7 +271,10 @@ oper pronVseInanimate: Pronoun = PF Inst _ _ => "всем" ; PF (Prepos _) _ _ => "всём" } ; - a = agrP3 Sg (PGen Neut) + g = PGen Neut; + n = Sg ; + p = P3 ; + pron = False } ; diff --git a/next-lib/src/russian/NounRus.gf b/next-lib/src/russian/NounRus.gf index a9347ac32..f62e55cac 100644 --- a/next-lib/src/russian/NounRus.gf +++ b/next-lib/src/russian/NounRus.gf @@ -13,36 +13,46 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { _ => kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g kazhduj.n) ++ okhotnik.s ! NF kazhduj.n kazhduj.c }; - a = agrP3 kazhduj.n (case kazhduj.g of {PNoGen => PGen okhotnik.g; _ => kazhduj.g}); + n = kazhduj.n ; + p = P3 ; + pron = False; + g = case kazhduj.g of { PNoGen => (PGen okhotnik.g); _ => kazhduj.g }; anim = okhotnik.anim } ; UsePN masha = { - s = \\c => masha.s ! (extCase c); - a = agrP3 Sg (PGen masha.g); - anim = masha.anim; - nComp = Sg - } ; + s = \\c => masha.s ! (extCase c) ; + p = P3; g = PGen masha.g ; anim = masha.anim ; + n = Sg; nComp = Sg; pron = False} ; UsePron p = p ** {anim = Inanimate}; PredetNP pred np = { - s = \\pf => pred.s! (AF (extCase pf) np.anim (gennum (pgen2gen np.a.g) np.a.n))++ np.s ! pf ; - a = np.a; - anim = np.anim + s = \\pf => pred.s! (AF (extCase pf) np.anim (gennum (pgen2gen np.g) np.n))++ np.s ! pf ; + n = np.n; + p = np.p; + g = np.g; + anim = np.anim; + pron = np.pron } ; PPartNP np v2 = { s = \\pf => np.s ! pf ++ v2.s ! VFORM Act VINF ; -- no participles in the Verbum type as they behave as adjectives - a = np.a; - anim = np.anim + n = np.n; + p = np.p; + g = np.g; + anim = np.anim; + pron = np.pron } ; AdvNP np adv = { s = \\pf => np.s ! pf ++ adv.s ; - a = np.a; - anim = np.anim + n = np.n; + p = np.p; + g = np.g; + anim = np.anim; + pron = np.pron } ; -- 1.4 additions AR 17/6/2008 @@ -53,7 +63,10 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { anim = Inanimate ; in { s = \\c => kazhduj.s ! AF (extCase c) anim (gennum g kazhduj.n) ; - a = agrP3 kazhduj.n (case kazhduj.g of {PNoGen => (PGen g); _ => kazhduj.g}) ; + n = kazhduj.n ; + p = P3 ; + pron = False; + g = case kazhduj.g of { PNoGen => (PGen g); _ => kazhduj.g }; anim = anim } ; @@ -89,7 +102,10 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { MassNP okhotnik = { s = \\c => okhotnik.s ! NF Sg (extCase c) ; - a = agrP3 Sg (PGen okhotnik.g) ; + n = Sg ; + p = P3 ; + pron = False; + g = PGen okhotnik.g ; anim = okhotnik.anim } ; {- @@ -97,7 +113,10 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { s = \\c => -- art case always Nom (AR 17/6/2008) kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g Sg) ++ okhotnik.s ! Sg ! (extCase c) ; - a = agrP3 Sg (case kazhduj.g of {PNoGen => PGen okhotnik.g; _ => kazhduj.g}) ; + n = Sg ; + p = P3 ; + pron = False; + g = case kazhduj.g of { PNoGen => (PGen okhotnik.g); _ => kazhduj.g }; anim = okhotnik.anim } ; @@ -105,7 +124,10 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { s = \\c => -- art case always Nom (AR 17/6/2008) kazhduj.s ! AF (extCase c) okhotnik.anim (gennum okhotnik.g Pl) ++ okhotnik.s ! Pl ! (extCase c) ; - n = agrP3 Pl (case kazhduj.g of {PNoGen => PGen okhotnik.g; _ => kazhduj.g}) ; + n = Pl ; + p = P3 ; + pron = False; + g = case kazhduj.g of { PNoGen => (PGen okhotnik.g); _ => kazhduj.g }; anim = okhotnik.anim } ; -} @@ -142,8 +164,11 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { -- of the readings is meaningful. ComplN2 f x = { - s = \\nf => f.s ! nf ++ f.c2.s ++ - x.s ! (case nf of {NF n c => mkPronForm f.c2.c Yes (Poss (gennum f.g n))}) ; + s = \\nf => case x.pron of { + True => x.s ! (case nf of {NF n c => mkPronForm c No (Poss (gennum f.g n))}) ++ f.s ! nf ; + False => f.s ! nf ++ f.c2.s ++ + x.s ! (case nf of {NF n c => mkPronForm f.c2.c Yes (Poss (gennum f.g n))}) + }; g = f.g ; anim = f.anim } ; @@ -219,8 +244,11 @@ concrete NounRus of Noun = CatRus ** open ResRus, Prelude, MorphoRus in { } ; 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 ; + s = \\c => np.s ! c ++ rel.s ! (gennum (pgen2gen np.g) np.n) ! extCase c ! np.anim ; + n = np.n ; + p = np.p ; + pron = np.pron ; + g = np.g ; anim = np.anim ; nComp = np.nComp } ; diff --git a/next-lib/src/russian/ParadigmsRus.gf b/next-lib/src/russian/ParadigmsRus.gf index f1fe284e9..e3abbe191 100644 --- a/next-lib/src/russian/ParadigmsRus.gf +++ b/next-lib/src/russian/ParadigmsRus.gf @@ -408,7 +408,7 @@ foreign = Foreign; -- +++ MG_UR: added +++ } ** {lock_A = <>}; - mkA2 a p c= a ** {s2 = p ; c = c; lock_A2 = <>}; + mkA2 a p c= a ** {c2 = {s=p; c=c}; lock_A2 = <>}; -- mkADeg a s = mkAdjDeg a s ** {lock_ADeg = <>}; -- defined in morpho.RusU -- ap a p = mkAdjPhrase a p ** {lock_AP = <>}; -- defined in syntax module @@ -454,7 +454,7 @@ foreign = Foreign; -- +++ MG_UR: added +++ VSubj gn => aller.s ! VFORM vox (VSUB gn) }; t = Present ; a = aller.asp ; w = vox ; lock_V = <>} ; -} - mkV2 v p cas = v ** {s2 = p ; c = cas; lock_V2 = <>}; + mkV2 v p cas = v ** {c2 = {s=p; c=cas}; lock_V2 = <>}; dirV2 v = mkV2 v [] Acc; @@ -464,7 +464,7 @@ foreign = Foreign; -- +++ MG_UR: added +++ -- We treat so far only the rule in which the ditransitive -- verb takes both complements to form a verb phrase. - mkV3 v s1 s2 c1 c2 = v ** {s2 = s1; c = c1; s4 = s2; c2=c2; lock_V3 = <>}; + mkV3 v s1 s2 c1 c2 = v ** {c2 = {s=s1; c=c1}; c3={s=s2; c=c2}; lock_V3 = <>}; } ; diff --git a/next-lib/src/russian/QuestionRus.gf b/next-lib/src/russian/QuestionRus.gf index 86633b5f0..e3506aef6 100644 --- a/next-lib/src/russian/QuestionRus.gf +++ b/next-lib/src/russian/QuestionRus.gf @@ -29,7 +29,7 @@ concrete QuestionRus of Question = CatRus ** open ResRus, Prelude in { AdvIP ip adv = { s = \\c => ip.s ! c ++ adv.s ; - a = ip.a; anim=ip.anim + n = ip.n; p=ip.p; g=ip.g; anim=ip.anim; pron=ip.pron } ; IdetCN kakoj okhotnik = @@ -40,7 +40,10 @@ concrete QuestionRus of Question = CatRus ** open ResRus, Prelude in { _ => kakoj.s ! AF (extCase pf) okhotnik.anim (gennum okhotnik.g kakoj.n) ++ okhotnik.s ! NF kakoj.n kakoj.c }; - a = agrP3 kakoj.n kakoj.g ; + n = kakoj.n ; + p = P3 ; + pron = False; + g = kakoj.g ; anim = okhotnik.anim } ; @@ -48,7 +51,10 @@ concrete QuestionRus of Question = CatRus ** open ResRus, Prelude in { IdetIP kakoj = let anim = Inanimate in {s = \\pf => kakoj.s ! AF (extCase pf) anim (pgNum kakoj.g kakoj.n) ; - a = agrP3 kakoj.n kakoj.g ; + n = kakoj.n ; + p = P3 ; + pron = False; + g = kakoj.g ; anim = anim } ; diff --git a/next-lib/src/russian/RelativeRus.gf b/next-lib/src/russian/RelativeRus.gf index d8a60dc47..51088de57 100644 --- a/next-lib/src/russian/RelativeRus.gf +++ b/next-lib/src/russian/RelativeRus.gf @@ -10,7 +10,7 @@ concrete RelativeRus of Relative = CatRus ** open ResRus, MorphoRus in { takoj.s ! AF c anim gn ++ "что" ++ A.s !b!clf}; RelVP kotoruj gulyaet = - { s = \\b,clf,gn, c, anim => let { nu = numGNum gn } in + { s = \\b,clf,gn, c, anim => let { nu = numGenNum gn } in kotoruj.s ! gn ! c ! anim ++ gulyaet.s2 ++ gulyaet.s ! clf ! gn !P3 ++ gulyaet.s3 ! genGNum gn ! nu } ; @@ -26,7 +26,7 @@ concrete RelativeRus of Relative = CatRus ** open ResRus, MorphoRus in { } ; FunRP p mama kotoruj = - {s = \\gn,c, anim => let {nu = numGNum gn} in + {s = \\gn,c, anim => let {nu = numGenNum gn} in mama.s ! PF c No NonPoss ++ p.s ++ kotoruj.s ! gn ! p.c ! anim } ; diff --git a/next-lib/src/russian/ResRus.gf b/next-lib/src/russian/ResRus.gf index 1ddcc6590..8f298bca6 100644 --- a/next-lib/src/russian/ResRus.gf +++ b/next-lib/src/russian/ResRus.gf @@ -7,7 +7,7 @@ -- implement $Test$, it moreover contains regular lexical -- patterns needed for $Lex$. -instance ResRus of ResSlavic = ParamX, DiffRus, CommonSlavic ** open Prelude in { +resource ResRus = ParamX ** open Prelude in { flags coding=utf8 ; optimize=all ; @@ -18,6 +18,10 @@ flags coding=utf8 ; optimize=all ; -- Some parameters, such as $Number$, are inherited from $ParamX$. param + Gender = Masc | Fem | Neut ; + Case = Nom | Gen | Dat | Acc | Inst | Prepos PrepKind ; + PrepKind = PrepOther | PrepVNa; + Animacy = Animate | Inanimate ; Voice = Act | Pass ; Aspect = Imperfective | Perfective ; RusTense = Present | PastRus | Future ; @@ -46,6 +50,22 @@ param -- (a big house - big houses). -- The plural never makes a gender distinction. + GenNum = GSg Gender | GPl ; + + -- Coercions between the compound gen-num type and gender and number: +oper + gennum : Gender -> Number -> GenNum = \g,n -> + case n of { + Sg => GSg g ; + Pl => GPl + } ; + + numGenNum : GenNum -> Number = \gn -> + case gn of { + GSg _ => Sg ; + GPl => Pl + } ; + -- The Possessive parameter is introduced in order to describe -- the possessives of personal pronouns, which are used in the @@ -75,11 +95,14 @@ param param PronForm = PF Case AfterPrep Possessive; -oper Pronoun = {s : PronForm => Str; a : Agr} ; +oper Pronoun = { s : PronForm => Str ; n : Number ; p : Person ; + g: PronGen ; pron: Bool} ; -- Gender is not morphologically determined for first -- and second person pronouns. +param PronGen = PGen Gender | PNoGen ; + -- The following coercion is useful: oper @@ -97,25 +120,24 @@ oper CommNoun = {s : NForm => Str ; g : Gender ; anim : Animacy } ; - NounPhrase : Type = {s : PronForm => Str; a : Agr; anim : Animacy} ; + NounPhrase : Type = { s : PronForm => Str ; n : Number ; + p : Person ; g: PronGen ; anim : Animacy ; pron: Bool} ; mkNP : Number -> CommNoun -> NounPhrase = \n,chelovek -> {s = \\cas => chelovek.s ! NF n (extCase cas) ; - a = agrP3 n (PGen chelovek.g); + n = n ; g = PGen chelovek.g ; p = P3 ; pron =False ; anim = chelovek.anim } ; det2NounPhrase : Adjective -> NounPhrase = \eto -> - {s = \\pf => eto.s ! AF (extCase pf) Inanimate (GSg Neut); a = agrP3 Sg (PGen Neut); anim = Inanimate} ; + {s = \\pf => eto.s ! (AF (extCase pf) Inanimate (GSg Neut)); n = Sg ; g = PGen Neut ; pron = False ; p = P3 ; anim = Inanimate } ; - pron2NounPhraseNum : Pronoun -> Animacy -> Number -> NounPhrase = - \ona, anim, num -> { - s = ona.s; - a = {n = num; p = ona.a.p; g = ona.a.g}; - anim = anim - } ; + pron2NounPhraseNum : Pronoun -> Animacy -> Number -> NounPhrase = \ona, anim, num -> + {s = ona.s ; n = num ; g = ona.g ; + pron = ona.pron; p = ona.p ; anim = anim } ; + -- Agreement of $NP$ is a record. We'll add $Gender$ later. -- oper Agr = {n : Number ; p : Person} ; @@ -207,24 +229,21 @@ Prep =>"себе"}; -- Notice that the slash category has the same relation to sentences as -- transitive verbs have to verbs: it's like a *sentence taking a complement*. - SlashNounPhrase = Clause ** Complement ; + SlashNounPhrase = Clause ** {c2 : Complement} ; Clause = {s : Polarity => ClForm => Str} ; -- This is the traditional $S -> NP VP$ rule. predVerbPhrase : NounPhrase -> VerbPhrase -> SlashNounPhrase = - \Ya, tebyaNeVizhu -> { s = \\b,clf => - let - { ya = Ya.s ! (mkPronForm Nom No NonPoss); - khorosho = tebyaNeVizhu.s2; - vizhu = tebyaNeVizhu.s ! clf !(gennum (pgen2gen Ya.a.g) Ya.a.n)! Ya.a.p; - tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.a.g) ! Ya.a.n - } - in - ya ++ khorosho ++ vizhu ++ tebya; - s2= ""; - c = Nom -} ; + \Ya, tebyaNeVizhu -> { + s = \\b,clf => let { ya = Ya.s ! (mkPronForm Nom No NonPoss); + khorosho = tebyaNeVizhu.s2; + vizhu = tebyaNeVizhu.s ! clf !(gennum (pgen2gen Ya.g) Ya.n)! Ya.p; + tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n + } + in ya ++ khorosho ++ vizhu ++ tebya; + c2 = {s = ""; c = Nom} + } ; -- Questions are either direct ("Ты счастлив?") -- or indirect ("Потом он спросил счастлив ли ты"). @@ -264,7 +283,7 @@ param AdjForm = AF Case Animacy GenNum | AFShort GenNum | AdvF; oper - Complement = {s2 : Str ; c : Case} ; + Complement = {s : Str ; c : Case} ; oper Refl ={s: Case => Str}; oper sam: Refl= @@ -281,21 +300,16 @@ oper sam: Refl= pgNum : PronGen -> Number -> GenNum = \g,n -> case n of { Sg => GSg (pgen2gen g) ; -- assuming pronoun "I" is a male - Pl => GPl + Pl => GPl } ; -- _ => variants {GSg Masc ; GSg Fem} } ; -- "variants" version cause "no term variants" error during linearization - - -oper numGNum : GenNum -> Number = \gn -> - case gn of { GPl => Pl ; _ => Sg } ; - oper genGNum : GenNum -> Gender = \gn -> case gn of { GSg Fem => Fem; GSg Masc => Masc; _ => Neut } ; oper numAF: AdjForm -> Number = \af -> - case af of { AdvF => Sg; AFShort gn => numGNum gn; AF _ _ gn => (numGNum gn) } ; + case af of { AdvF => Sg; AFShort gn => numGenNum gn; AF _ _ gn => (numGenNum gn) } ; oper genAF: AdjForm -> Gender = \af -> case af of { AdvF => Neut; AFShort gn => genGNum gn; AF _ _ gn => (genGNum gn) } ; diff --git a/next-lib/src/russian/SentenceRus.gf b/next-lib/src/russian/SentenceRus.gf index 3b3dc8b70..0c15b3d5d 100644 --- a/next-lib/src/russian/SentenceRus.gf +++ b/next-lib/src/russian/SentenceRus.gf @@ -15,9 +15,9 @@ concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { _ => (mkPronForm Nom No NonPoss) }); ne = case b of {Pos=>""; Neg=>"не"}; - vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.a.g Ya.a.n)! Ya.a.p; + vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.g Ya.n)! Ya.p; khorosho = tebyaNeVizhu.s2 ; - tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.a.g) ! Ya.a.n + tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n } in if_then_else Str tebyaNeVizhu.negBefore @@ -48,9 +48,9 @@ concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { _ => (mkPronForm Nom No NonPoss) }); ne = case b of {Pos=>""; Neg=>"не"}; - vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.a.g Ya.a.n)! Ya.a.p; + vizhu = tebyaNeVizhu.s ! clf ! (pgNum Ya.g Ya.n)! Ya.p; khorosho = tebyaNeVizhu.s2 ; - tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.a.g) ! Ya.a.n + tebya = tebyaNeVizhu.s3 ! (pgen2gen Ya.g) ! Ya.n } in if_then_else Str tebyaNeVizhu.negBefore @@ -71,7 +71,7 @@ concrete SentenceRus of Sentence = CatRus ** open Prelude, ResRus in { --- AR 3/11/2007 SlashVS ivan vidit tuUlubaeshsya = { s=\\b,clf => ivan.s ! PF Nom No NonPoss ++ - vidit.s! (getActVerbForm clf (pgen2gen ivan.a.g) ivan.a.n ivan.a.p) ++ + vidit.s! (getActVerbForm clf (pgen2gen ivan.g) ivan.n ivan.p) ++ [", что"] ++ tuUlubaeshsya.s ; s2=tuUlubaeshsya.s2; c=tuUlubaeshsya.c diff --git a/next-lib/src/russian/VerbRus.gf b/next-lib/src/russian/VerbRus.gf index c69f64211..6c0623d82 100644 --- a/next-lib/src/russian/VerbRus.gf +++ b/next-lib/src/russian/VerbRus.gf @@ -30,7 +30,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { } --case p }; --case gn ClCondit => "" ; - ClImper => case (numGNum gn) of + ClImper => case (numGenNum gn) of {Sg => "будь" ++ masha.s ! (mkPronForm Inst No NonPoss); Pl => "будьте" ++ masha.s ! (mkPronForm Inst No NonPoss) }; @@ -133,7 +133,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { -- double negations with "inte" are not grammatical. UseV se = - {s=\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; + {s=\\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ; asp = se.asp ; w=Act; s2 = ""; @@ -143,14 +143,14 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { -- The rule for using transitive verbs is the complementization rule: SlashV2a se = - {s = \\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; + {s = \\clf,gn,p => se.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ; asp = se.asp ; w = Act; s2 = ""; s3 = \\g,n => ""; negBefore = True ; - sc = se.s2 ; - c = se.c + sc = se.c2.s ; + c = se.c2.c } ; ComplSlash se tu = @@ -165,68 +165,68 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { Slash2V3 dat tu = let - tebepivo = dat.s2 ++ tu.s ! PF dat.c No NonPoss ++ dat.s4 ; + tebepivo = dat.c2.s ++ tu.s ! PF dat.c2.c No NonPoss ++ dat.c3.s ; in - {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tebepivo ; + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ tebepivo ; asp = dat.asp ; w = Act; negBefore = True; s2 = ""; s3 = \\g,n=> "" ; - sc = dat.s4 ; - c = dat.c2 + sc = dat.c3.s ; + c = dat.c3.c } ; Slash3V3 dat pivo = let - tebepivo = dat.s4 ++ pivo.s ! PF dat.c2 Yes NonPoss + tebepivo = dat.c3.s ++ pivo.s ! PF dat.c3.c Yes NonPoss in - {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ tebepivo ; + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ tebepivo ; asp = dat.asp ; w = Act; negBefore = True; s2 = ""; s3 = \\g,n=> "" ; - sc = dat.s2 ; - c = dat.c + sc = dat.c2.s ; + c = dat.c2.c } ; ---- AR 17/12/2008 SlashV2Q dat esliOnPridet = - {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ esliOnPridet.s ! QDir ; + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ esliOnPridet.s ! QDir ; asp = dat.asp ; w = Act; negBefore = True; s2 = ""; s3 = \\g,n=> "" ; - sc = dat.s2 ; - c = dat.c + sc = dat.c2.s ; + c = dat.c2.c } ; ---- AR 17/12/2008 SlashV2S vidit tuUlubaeshsya = - {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) + {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ [", что"] ++ tuUlubaeshsya.s ; asp = vidit.asp; w = Act; s2=""; negBefore = True; s3 = \\g,n => "" ; - sc = vidit.s2 ; - c = vidit.c + sc = vidit.c2.s ; + c = vidit.c2.c } ; ---- 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 ; + (numGenNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; asp = putatsya.asp ; w = Act; negBefore = True; s2 = ""; s3 =\\g,n => "" ; - sc = putatsya.s2 ; - c = putatsya.c + sc = putatsya.c2.s ; + c = putatsya.c2.c } ; ---- AR 17/12/2008 @@ -242,7 +242,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { ---- 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 ; + (numGenNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; asp = putatsya.asp ; w = Act; negBefore = True; @@ -255,8 +255,8 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { ---- 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) ++ ---- ? + putatsya.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ + np.s ! (mkPronForm putatsya.c2.c No NonPoss) ++ ---- ? bezhat.s!ClInfinit !gn!p ; asp = putatsya.asp ; w = Act; @@ -270,7 +270,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { -- To generate "сказал, что Иван гуляет" / "не сказал, что Иван гуляет": ComplVS vidit tuUlubaeshsya = - {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) + {s = \\clf,gn,p => vidit.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ [", что"] ++ tuUlubaeshsya.s ; asp = vidit.asp; w = Act; @@ -286,7 +286,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { ComplVV putatsya bezhat = { s = \\clf,gn,p => putatsya.s ! (getActVerbForm clf (genGNum gn) - (numGNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; + (numGenNum gn) p) ++ bezhat.s!ClInfinit !gn!p ; asp = putatsya.asp ; w = Act; negBefore = True; @@ -294,7 +294,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { s3 =\\g,n => "" } ; ComplVQ dat esliOnPridet = - {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ esliOnPridet.s ! QDir ; + {s = \\clf,gn,p => dat.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ esliOnPridet.s ! QDir ; asp = dat.asp ; w = Act; negBefore = True; @@ -302,7 +302,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { s3 = \\g,n=> "" } ; ComplVA vuglyadet molodoj = - {s = \\clf,gn,p => vuglyadet.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ; + {s = \\clf,gn,p => vuglyadet.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ; asp = vuglyadet.asp ; w = Act; negBefore = True; @@ -312,7 +312,7 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { SlashV2A obechat molodoj = {s = \\clf,gn,p => - obechat.s ! (getActVerbForm clf (genGNum gn) (numGNum gn) p) ++ + obechat.s ! (getActVerbForm clf (genGNum gn) (numGenNum gn) p) ++ molodoj.s ! AF Inst Inanimate (GSg Neut) ; ---- AR 17/6; AF Inst tu.anim (pgNum tu.g tu.n) ; asp = obechat.asp ; @@ -320,8 +320,8 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { negBefore = True; s2 = ""; s3 = \\g,n =>"" ; - sc = obechat.s2 ; - c = obechat.c + sc = obechat.c2.s ; + c = obechat.c2.c } ; AdvVP poet khorosho = @@ -333,8 +333,8 @@ concrete VerbRus of Verb = CatRus ** open ResRus, Prelude in { asp = poet.asp; w = poet.w; t = poet.t ; negBefore = poet.negBefore } ; PassV2 se = - {s=\\clf,gn,p => se.s ! (getPassVerbForm clf (genGNum gn) (numGNum gn) p) ; - asp=se.asp; w=Pass; s2 = se.s2; + {s=\\clf,gn,p => se.s ! (getPassVerbForm clf (genGNum gn) (numGenNum gn) p) ; + asp=se.asp; w=Pass; s2 = se.c2.s; negBefore = True; s3 = table{_=> table{_ => ""}} }; diff --git a/next-lib/src/slavic/CatSlavic.gf b/next-lib/src/slavic/CatSlavic.gf deleted file mode 100644 index 1a0883702..000000000 --- a/next-lib/src/slavic/CatSlavic.gf +++ /dev/null @@ -1,12 +0,0 @@ -incomplete concrete CatSlavic of Cat = open Prelude, CommonSlavic, ResSlavic in { - -lincat - CN = {s : NForm => Str; g : Gender; anim : Animacy} ; - - Subj = {s : Str} ; - Prep = {s : Str; c: Case} ; - - N = {s : NForm => Str; g : Gender; anim : Animacy} ; - N2 = {s : NForm => Str; g : Gender; anim : Animacy} ** {c2 : Preposition} ; - N3 = {s : NForm => Str; g : Gender; anim : Animacy} ** {c2,c3 : Preposition} ; -} \ No newline at end of file diff --git a/next-lib/src/slavic/CommonSlavic.gf b/next-lib/src/slavic/CommonSlavic.gf deleted file mode 100644 index fc38ca990..000000000 --- a/next-lib/src/slavic/CommonSlavic.gf +++ /dev/null @@ -1,22 +0,0 @@ -resource CommonSlavic = ParamX ** open Prelude in { - -param - Gender = Masc | Fem | Neut ; - Animacy = Animate | Inanimate ; - - GenNum = GSg Gender | GPl ; - -oper - gennum : Gender -> Number -> GenNum = \g,n -> - case n of { - Sg => GSg g ; - Pl => GPl - } ; - - numGenNum : GenNum -> Number = \gn -> - case gn of { - GSg _ => Sg ; - GPl => Pl - } ; - -} diff --git a/next-lib/src/slavic/DiffSlavic.gf b/next-lib/src/slavic/DiffSlavic.gf deleted file mode 100644 index 77728ad1b..000000000 --- a/next-lib/src/slavic/DiffSlavic.gf +++ /dev/null @@ -1,5 +0,0 @@ -interface DiffSlavic = open Prelude in { - - param NForm ; - -} \ No newline at end of file diff --git a/next-lib/src/slavic/ResSlavic.gf b/next-lib/src/slavic/ResSlavic.gf deleted file mode 100644 index 1f86fbde5..000000000 --- a/next-lib/src/slavic/ResSlavic.gf +++ /dev/null @@ -1,6 +0,0 @@ -interface ResSlavic = DiffSlavic ** open CommonSlavic, Prelude in { - -oper - Preposition : Type = {s : Str; c : Case}; - -}