Extend connected at last

This commit is contained in:
Roman Suzi
2020-08-04 07:34:11 +03:00
parent 8b5e28b948
commit 8e824083a2
8 changed files with 51 additions and 169 deletions

View File

@@ -1,3 +1,3 @@
--# -path=.:../abstract:../common:../api
--# -path=.:../abstract:../common:../api:../prelude
concrete AllRus of AllRusAbs = LangRus, ExtraRus, ExtendRus ** {flags coding=utf8;}
concrete AllRus of AllRusAbs = LangRus, ExtraRus, ExtendRus ** {flags optimize=all ; coding=utf8;}

View File

@@ -1,3 +1,3 @@
--# -path=.:../abstract:../common:prelude
abstract AllRusAbs = Lang, ExtraRusAbs ** {};
abstract AllRusAbs = Lang, ExtraRusAbs, Extend ** {};

View File

@@ -98,6 +98,7 @@ lincat
linref
N = \s -> s.snom ;
PN = \s -> s.snom ;
Pron = \s -> s.nom ;
N2 = \s -> s.snom ++ s.c2.s ; -- TODO
N3 = \s -> s.snom ++ s.c2.s ++ s.c3.s ; -- TODO
A = \s -> case s.preferShort of {PrefShort => s.sm ; _ => s.msnom} ;

View File

@@ -27,17 +27,18 @@ lin
InflectionN, InflectionN2, InflectionN3 = \noun -> {
t = "s" ;
s1 = heading1 (heading noun_Category) ;
s2 = inflNoun (\nf -> (snoun2nounSep noun).s ! nf)
s2 = inflNoun noun
} ;
InflectionA, InflectionA2 = \adj -> {
t = "a" ;
s1 = heading1 (heading adjective_Category) ;
s2 = inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Posit ! sAN f ; h = adj.h}).s ! nf) ++
heading2 (heading comparative_Parameter) ++
inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Compar ! sAN f ; h = adj.h}).s ! nf) ++
heading2 (heading superlative_Parameter) ++
inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Superl ! sAN f ; h = adj.h}).s ! nf)
s2 = heading2 (heading feminine_Parameter) ++
inflNoun (makeNFFromAF adj Fem Inanimate) ++
heading2 (heading masculine_Parameter) ++
inflNoun (makeNFFromAF adj Masc Inanimate) ++
heading2 (heading neuter_Parameter) ++
inflNoun (makeNFFromAF adj Neut Inanimate)
} ;
InflectionAdv adv = {
@@ -134,159 +135,20 @@ oper
{-
-} --# notpresent
inflVerb : CatRus.V -> Str = \verb0 ->
let
verb = sverb2verbSep verb0 ;
vfin : ResRus.VForm -> Str = \f ->
verb.s ! f ;
verb0.inf ; -- TODO: make documentation
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
(S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP (snoun2nounSep n2)))).s ;
in
heading3 (nounNounHeading present_Parameter indicative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Presn Sg P1)) ++ td (vfin (Presn Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassPresn True)) --# notpresent
) ++
tr (th "2.p" ++ td (vfin (Presn Sg P2)) ++ td (vfin (Presn Pl P2))) ++
tr (th "3.p" ++ td (vfin (Presn Sg P3)) ++ td (vfin (Presn Pl P3))) ++
tr (th (heading negative_Parameter) ++
intagAttr "td" "colspan=2 align=center" (vfin (Imper Sg)) ++ td (vfin (PassPresn False)))
) ++
heading3 (nounNounHeading past_Parameter indicative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Impf Sg P1)) ++ td (vfin (Impf Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassImpf True))) ++
tr (th "2.p" ++ td (vfin (Impf Sg P2)) ++ td (vfin (Impf Pl P2))) ++
tr (th "3.p" ++ td (vfin (Impf Sg P3)) ++ td (vfin (Impf Pl P3))) ++
tr (th (heading negative_Parameter) ++
td (vfin (PastPartAct (AN (NCase Sg Nom)))) ++
td (vfin (PastPartAct (AN (NCase Pl Nom)))) ++
td (vfin (PassImpf False)))
) ++
heading3 (nounNounHeading present_Parameter conditional_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Condit Sg P1)) ++ td (vfin (Condit Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassCondit True)) --# notpresent
) ++
tr (th "2.p" ++ td (vfin (Condit Sg P2)) ++ td (vfin (Condit Pl P2))) ++
tr (th "3.p" ++ td (vfin (Condit Sg P3)) ++ td (vfin (Condit Pl P3))) ++
tr (th (heading negative_Parameter) ++
intagAttr "td" "colspan=2 align=center" (vfin (Condit Sg P3)) ++ td (vfin (PassCondit False)))
) ++
heading3 (nounNounHeading present_Parameter potential_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td (vfin (Potent Sg P1)) ++ td (vfin (Potent Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassPotent True)) --# notpresent
) ++
tr (th "2.p" ++ td (vfin (Potent Sg P2)) ++ td (vfin (Potent Pl P2))) ++
tr (th "3.p" ++ td (vfin (Potent Sg P3)) ++ td (vfin (Potent Pl P3))) ++
tr (th (heading negative_Parameter) ++
intagAttr "td" "colspan=2 align=center" (vfin PotentNeg) ++ td (vfin (PassPotent False)))
) ++
heading3 (nounNounHeading present_Parameter imperative_Parameter) ++
frameTable (
tr (th "" ++
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "1.p" ++ td "" ++ td (vfin ImperP1Pl)
++ intagAttr "td" "rowspan=3" (vfin (PassImper True))) ++
tr (th "2.p" ++ td (vfin (Imper Sg)) ++ td (vfin (Imper Pl))) ++
tr (th "3.p" ++ td (vfin (ImperP3 Sg)) ++ td (vfin (ImperP3 Pl))) ++
tr (th (heading negative_Parameter) ++
td (vfin (Imper Sg)) ++
td (vfin ImpNegPl) ++
td (vfin (PassImper False)))
) ++
heading2 (nounPluralHeading nominal_form_ParameterType).s ++
heading3 (heading infinitive_Parameter) ++
frameTable (
tr (intagAttr "th" "rowspan=2" "1" ++
th (heading short_Parameter) ++ ---
td (vfin (Inf Inf1))) ++
tr (th (heading long_Parameter) ++ ---
td (vfin (Inf Inf1Long) ++ BIND ++ "(ni)")) ++
tr (intagAttr "th" "rowspan=2" ("2." ++ heading active_Parameter) ++
th (heading inessive_Parameter) ++
td (vfin (Inf Inf2Iness))) ++
tr (th (heading instructive_Parameter) ++
td (vfin (Inf Inf2Instr))) ++
tr (th ("2." ++ heading passive_Parameter) ++
th (heading inessive_Parameter) ++
td (vfin (Inf Inf2InessPass))) ++
tr (intagAttr "th" "rowspan=7" "3." ++
th (heading inessive_Parameter) ++ td (vfin (Inf Inf3Iness))) ++
tr (th (heading elative_Parameter) ++ td (vfin (Inf Inf3Elat))) ++
tr (th (heading illative_Parameter) ++ td (vfin (Inf Inf3Illat))) ++
tr (th (heading adessive_Parameter) ++ td (vfin (Inf Inf3Adess))) ++
tr (th (heading abessive_Parameter) ++ td (vfin (Inf Inf3Abess))) ++
tr (th (heading instructive_Parameter) ++ td (vfin (Inf Inf3Instr))) ++
tr (th (heading instructive_Parameter ++ "pass.") ++ td (vfin (Inf Inf3InstrPass))) ++
tr (intagAttr "th" "rowspan=2" "4." ++
th (heading nominative_Parameter) ++ td (vfin (Inf Inf4Nom))) ++
tr (th (heading partitive_Parameter) ++ td (vfin (Inf Inf4Part))) ++
tr (intagAttr "th" "colspan=2" "5." ++ td (vfin (Inf Inf5) ++ BIND ++ "(ni)"))
) ++
heading3 (heading participle_Parameter) ++
frameTable (
tr (intagAttr "th" "rowspan=2" (heading present_Parameter) ++
th (heading active_Parameter) ++
td (vfin (PresPartAct (AN (NCase Sg Nom))))) ++
tr (th (heading passive_Parameter) ++
td (vfin (PresPartPass (AN (NCase Sg Nom))))) ++
tr (intagAttr "th" "rowspan=2" (heading perfect_Parameter) ++
th (heading active_Parameter) ++
td (vfin (PastPartAct (AN (NCase Sg Nom))))) ++
tr (th (heading passive_Parameter) ++
td (vfin (PastPartPass (AN (NCase Sg Nom))))) ++
tr (intagAttr "th" "colspan=2" (heading agent_Parameter) ++
td (vfin (AgentPart (AN (NCase Sg Nom)))))
) ;
inflNoun : (NForm -> Str) -> Str = \nouns ->
inflNoun : NounForms -> Str = \nf ->
frameTable (
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter) ) ++
tr (th (heading nominative_Parameter) ++ td (nouns (NCase Sg Nom)) ++ td (nouns (NCase Pl Nom))) ++
tr (th (heading genitive_Parameter) ++ td (nouns (NCase Sg Gen)) ++ td (nouns (NCase Pl Gen))) ++
tr (th (heading partitive_Parameter) ++ td (nouns (NCase Sg Part)) ++ td (nouns (NCase Pl Part))) ++
tr (th (heading translative_Parameter) ++ td (nouns (NCase Sg Transl)) ++ td (nouns (NCase Pl Transl))) ++
tr (th (heading essive_Parameter) ++ td (nouns (NCase Sg Ess)) ++ td (nouns (NCase Pl Ess))) ++
tr (th (heading inessive_Parameter) ++ td (nouns (NCase Sg Iness)) ++ td (nouns (NCase Pl Iness))) ++
tr (th (heading elative_Parameter) ++ td (nouns (NCase Sg Elat)) ++ td (nouns (NCase Pl Elat))) ++
tr (th (heading illative_Parameter) ++ td (nouns (NCase Sg Illat)) ++ td (nouns (NCase Pl Illat))) ++
tr (th (heading adessive_Parameter) ++ td (nouns (NCase Sg Adess)) ++ td (nouns (NCase Pl Adess))) ++
tr (th (heading ablative_Parameter) ++ td (nouns (NCase Sg Ablat)) ++ td (nouns (NCase Pl Ablat))) ++
tr (th (heading allative_Parameter) ++ td (nouns (NCase Sg Allat)) ++ td (nouns (NCase Pl Allat))) ++
tr (th (heading abessive_Parameter) ++ td (nouns (NCase Sg Abess)) ++ td (nouns (NCase Pl Abess))) ++
tr (th (heading comitative_Parameter) ++ td "" ++ td (nouns (NComit))) ++
tr (th (heading instructive_Parameter) ++ td "" ++ td (nouns (NInstruct)))
tr (th "" ++ th (heading singular_Parameter) ++ th (heading plural_Parameter)) ++
tr (th (heading nominative_Parameter) ++ td (nf.snom) ++ td (nf.pnom)) ++
tr (th (heading genitive_Parameter) ++ td (nf.sgen) ++ td (nf.pgen)) ++
tr (th (heading dative_Parameter) ++ td (nf.sdat) ++ td (nf.pdat)) ++
tr (th (heading accusative_Parameter) ++ td (nf.sacc) ++ td (nf.pacc)) ++
tr (th ("творительный") ++ td (nf.sacc) ++ td (nf.pacc)) ++
tr (th ("предложный") ++ td (nf.sacc) ++ td (nf.pacc)) ++
tr (th (heading partitive_Parameter) ++ td (nf.sptv) ++ td ("-")) ++
tr (th ("местный") ++ td (nf.sloc) ++ td ("-")) ++
tr (th ("звательный") ++ td (nf.svoc) ++ td ("-"))
) ;
lin

View File

@@ -5,20 +5,21 @@ concrete ExtendRus of Extend =
iFem_Pron,
-- theyFem_Pron, weFem_Pron,
youFem_Pron,
-- youPlFem_Pron, youPolFem_Pron, youPolPlFem_Pron, youPolPl_Pron,
-- VPS, ListVPS, VPI, ListVPI, VPS2, ListVPS2, VPI2, ListVPI2, RNP, RNPList,
-- UseComp, RelNP, UseComp_estar, SubjRelNP, PredAPVP, ImpersCl, UseComp, CompAP, EmbedVP, ExistNP, UseQCl,
-- QuestCl, ExistNP, UseQCl, ExistIP, AdvVP, AdvVP, AdvVP, UseComp, CompAP, ExistS, ExistNPQS, ExistIPQS,
-- ComplDirectVS, ComplDirectVQ, AdvIsNPAP, AdAdV, AdjAsCN, AdjAsNP,
-- ComplDirectVS, ComplDirectVQ, AdvIsNPAP, AdAdV, AdjAsNP,
ApposNP,
-- AdvIsNP,
-- BaseVPS, ConsVPS, BaseVPI, ConsVPI, BaseVPS2, ConsVPS2, BaseVPI2, ConsVPI2,
-- MkVPS, ConjVPS, PredVPS, MkVPI, ConjVPI, ComplVPIVV,
-- MkVPS2, ConjVPS2, ComplVPS2, MkVPI2, ConjVPI2, ComplVPI2,
-- Base_nr_RNP, Base_rn_RNP, Base_rr_RNP, ByVP, CompBareCN,
-- CompIQuant, CompQS, CompS, CompVP, ComplBareVS, ComplGenVV, ComplSlashPartLast, ComplVPSVV, CompoundAP,
-- CompoundN, ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
-- ExistsNP, ExistCN, ExistMassCN, ExistPluralCN, ProDrop,
CompoundN,
--ConjRNP, ConjVPS, ConsVPS, Cons_nr_RNP, Cons_rr_RNP, DetNPMasc, DetNPFem, EmbedPresPart, EmptyRelSlash,
ExistsNP,
-- ExistCN, ExistMassCN, ExistPluralCN, ProDrop,
-- FocusAP, FocusAdV, FocusAdv, FocusObj, GenIP, GenModIP, GenModNP, GenNP, GenRP,
-- GerundAdv, GerundCN, GerundNP, IAdvAdv, ICompAP,
InOrderToVP,
@@ -31,7 +32,7 @@ concrete ExtendRus of Extend =
-- UncontractedNeg, UttAccIP, UttAccNP, UttAdV, UttDatIP, UttDatNP, UttVPShort, WithoutVP, BaseVPS2, ConsVPS2, ConjVPS2, ComplVPS2, MkVPS2
]
with (Grammar=GrammarRus)
** open Prelude, ResRus, ParadigmsRus in {
** open Prelude, ResRus, ParadigmsRus, (M = MorphoRus) in {
lincat
RNP = {s : Agr => Str} ;
@@ -58,6 +59,18 @@ lin
s = vp.adv ! Ag (GSg Neut) P3 ++ (verbInf vp.verb) ++ vp.dep ++ vp.compl ! Ag (GSg Neut) P3
}) ;
-- : NP -> Cl ; -- there exists a number / there exist numbers
ExistsNP np = {
subj=[] ;
adv=[] ;
compl=np.s ! Nom ;
verb=M.to_exist ;
dep=[] ;
a=np.a
} ;
iFem_Pron = personalPron (Ag (GSg Fem) P1) ;
youFem_Pron = personalPron (Ag (GSg Fem) P2) ;
CompoundN n1 n2 = mkCompoundN n1 "-" n2 ;
} ;

View File

@@ -214,7 +214,7 @@ oper
mkN : A -> Gender -> Animacy -> MaybeNumber -> N
= \a, g, anim, mbn -> lin N (applyMaybeNumber ((makeNFFromAF a g anim) ** {mayben=mbn})) ;
mkN : N -> Str -> N -> N
= \n1,link,n2 -> lin N (compoundN n1 link n2) ;
= \n1,link,n2 -> lin N (mkCompoundN n1 link n2) ;
-- For backwards compatibility:
mkN : (nomSg, genSg, datSg, accSg, instSg, preposSg, prepos2Sg, nomPl, genPl, datPl, accPl, instPl, preposPl : Str) -> Gender -> Animacy -> N
@@ -250,7 +250,7 @@ oper
mkPN : N -> PN
= \n -> lin PN n ;
mkPN : N -> Str -> N -> PN
= \n1,link,n2 -> lin PN (compoundN n1 link n2) ;
= \n1,link,n2 -> lin PN (mkCompoundN n1 link n2) ;
mkPN : Str -> PN
= \nom -> lin PN (guessNounForms nom) ;
mkPN : Str -> Gender -> Animacy -> PN

View File

@@ -207,7 +207,7 @@ oper
from2 = {s="из"; c=Gen; hasPrep=True} ;
compoundN : NounForms -> Str -> NounForms -> NounForms
mkCompoundN : NounForms -> Str -> NounForms -> NounForms
= \n1,link,n2 ->
let l : Str=case link of {x+"-" => BIND ++ "-" ++ BIND ; _ => link} in
n1 ** {

View File

@@ -47,3 +47,9 @@ AllRusAbs: TQuestMark (PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres AAnter) PNeg (
AllRus: сколько не является яблок у Ивана ?
AllRusAbs: TQuestMark (PhrUtt NoPConj (UttQS (UseQCl (TTAnt TPres AAnter) PPos (QuestIAdv how8much_IAdv (ImpersCl (AdvVP (AdvVP UseCopula (PrepNP part_Prep (DetCN (DetQuant IndefArt NumPl) (UseN apple_N)))) (PrepNP possess_Prep (UsePN john_PN))))))) NoVoc) TEmpty
AllRus: сколько является яблок у Ивана ?
## Exists idiom requires genetive in negation
AllRusAbs: UseCl (TTAnt TPres ASimul) PNeg (ExistsNP (MassNP (UseN number_N)))
AllRus: не существует число
Should be: не существует числа