mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-06-26 11:36:27 -06:00
modified mkPN and added preliminary structure of compounds (#452)
* modified mkPN and added preliminary structure of compounds * added PassAgentVPSlash * fixed PassAgentVPSlash and mkN
This commit is contained in:
committed by
GitHub
parent
600af2b8bf
commit
4b4fbbb401
+68
-51
@@ -1,3 +1,4 @@
|
||||
--# -path=.:../abstract:../common
|
||||
resource ResRus = ParamRus ** open Prelude, InflectionRus, Maybe in {
|
||||
flags coding=utf8 ; optimize=all ;
|
||||
|
||||
@@ -31,7 +32,9 @@ oper
|
||||
pnom, pgen, pdat, pacc, pins, pprep : Str ;
|
||||
g : Gender ;
|
||||
mayben : MaybeNumber ;
|
||||
anim : Animacy
|
||||
anim : Animacy ;
|
||||
rel : AdjForms ;
|
||||
rt : NRelType ;
|
||||
} ;
|
||||
Noun2Forms = NounForms ** {c2 : ComplementCase} ;
|
||||
Noun3Forms = NounForms ** {c2,c3 : ComplementCase} ;
|
||||
@@ -43,7 +46,9 @@ oper
|
||||
s : Number => Case => Str ;
|
||||
g : Gender ;
|
||||
mayben : MaybeNumber ; -- used to control dependent words
|
||||
anim : Animacy
|
||||
anim : Animacy ;
|
||||
rel : AdjForms ;
|
||||
rt : NRelType ;
|
||||
} ;
|
||||
|
||||
NounPhrase = {
|
||||
@@ -80,61 +85,63 @@ oper
|
||||
} ;
|
||||
g = forms.g ;
|
||||
mayben=forms.mayben ;
|
||||
anim = forms.anim
|
||||
anim = forms.anim ;
|
||||
rel = forms.rel ;
|
||||
rt = forms.rt ;
|
||||
} ;
|
||||
|
||||
guessNounForms : Str -> NounForms
|
||||
= \word ->
|
||||
guessNounForms : Str -> AdjForms -> NRelType -> NounForms
|
||||
= \word, rel, rt ->
|
||||
let nfb : NounFormsBase =
|
||||
case word of {
|
||||
_ + "уть" => makeNoun word Masc Inanimate (ZN 8 No B NoC) ;
|
||||
_ + "ий" => makeNoun word Masc Inanimate (ZN 7 No A NoC) ;
|
||||
_ + "ия" => makeNoun word Fem Inanimate (ZN 7 No A NoC) ;
|
||||
_ + "ие" => makeNoun word Neut Inanimate (ZN 7 No A NoC) ;
|
||||
_ + "ье" => makeNoun word Neut Inanimate (ZN 6 Ast A NoC) ;
|
||||
_ + "тель" => makeNoun word Masc Inanimate (ZN 2 No A NoC) ;
|
||||
_ + "ь" => makeNoun word Fem Inanimate (ZN 8 No A NoC) ;
|
||||
_ + "и" => makeNoun word Neut Inanimate ZN0 ;
|
||||
_ + #consonant + ("к"|"х"|"г") + "а" => makeNoun word Fem Inanimate (ZN 3 Ast A NoC) ;
|
||||
_ + ("к" | "х" | "г") => makeNoun word Masc Inanimate (ZN 3 No A NoC) ;
|
||||
_ + ("к" | "х" | "г") + "а" => makeNoun word Fem Inanimate (ZN 3 No A NoC) ;
|
||||
_ + "ца" => makeNoun word Fem Animate (ZN 5 No A NoC) ;
|
||||
_ + "й" => makeNoun word Masc Inanimate (ZN 6 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") => makeNoun word Masc Inanimate (ZN 4 No A NoC) ;
|
||||
_ + "ша" => makeNoun word Fem Animate (ZN 4 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") + "а" => makeNoun word Fem Inanimate (ZN 4 No A NoC) ;
|
||||
_ + "ц" => makeNoun word Masc Inanimate (ZN 5 Ast A NoC) ;
|
||||
_ + "о" => makeNoun word Neut Inanimate (ZN 1 No A NoC) ;
|
||||
_ + "а" => makeNoun word Fem Inanimate (ZN 1 No A NoC) ;
|
||||
_ => makeNoun word Masc Inanimate (ZN 1 No A NoC)
|
||||
_ + "уть" => makeNoun word Masc Inanimate rel rt (ZN 8 No B NoC) ;
|
||||
_ + "ий" => makeNoun word Masc Inanimate rel rt (ZN 7 No A NoC) ;
|
||||
_ + "ия" => makeNoun word Fem Inanimate rel rt (ZN 7 No A NoC) ;
|
||||
_ + "ие" => makeNoun word Neut Inanimate rel rt (ZN 7 No A NoC) ;
|
||||
_ + "ье" => makeNoun word Neut Inanimate rel rt (ZN 6 Ast A NoC) ;
|
||||
_ + "тель" => makeNoun word Masc Inanimate rel rt (ZN 2 No A NoC) ;
|
||||
_ + "ь" => makeNoun word Fem Inanimate rel rt (ZN 8 No A NoC) ;
|
||||
_ + "и" => makeNoun word Neut Inanimate rel rt ZN0 ;
|
||||
_ + #consonant + ("к"|"х"|"г") + "а" => makeNoun word Fem Inanimate rel rt (ZN 3 Ast A NoC) ;
|
||||
_ + ("к" | "х" | "г") => makeNoun word Masc Inanimate rel rt (ZN 3 No A NoC) ;
|
||||
_ + ("к" | "х" | "г") + "а" => makeNoun word Fem Inanimate rel rt (ZN 3 No A NoC) ;
|
||||
_ + "ца" => makeNoun word Fem Animate rel rt (ZN 5 No A NoC) ;
|
||||
_ + "й" => makeNoun word Masc Inanimate rel rt (ZN 6 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") => makeNoun word Masc Inanimate rel rt (ZN 4 No A NoC) ;
|
||||
_ + "ша" => makeNoun word Fem Animate rel rt (ZN 4 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") + "а" => makeNoun word Fem Inanimate rel rt (ZN 4 No A NoC) ;
|
||||
_ + "ц" => makeNoun word Masc Inanimate rel rt (ZN 5 Ast A NoC) ;
|
||||
_ + "о" => makeNoun word Neut Inanimate rel rt (ZN 1 No A NoC) ;
|
||||
_ + "а" => makeNoun word Fem Inanimate rel rt (ZN 1 No A NoC) ;
|
||||
_ => makeNoun word Masc Inanimate rel rt (ZN 1 No A NoC)
|
||||
} in
|
||||
noMinorCases nfb ;
|
||||
|
||||
guessLessNounForms : Str -> Gender -> Animacy -> NounForms
|
||||
= \word, g, anim ->
|
||||
guessLessNounForms : Str -> Gender -> Animacy -> AdjForms -> NRelType -> NounForms
|
||||
= \word, g, anim, rel, rt ->
|
||||
let nfb : NounFormsBase =
|
||||
case word of {
|
||||
_ + "уть" => makeNoun word g anim (ZN 8 No B NoC) ;
|
||||
_ + "ий" => makeNoun word g anim (ZN 7 No A NoC) ;
|
||||
_ + "ия" => makeNoun word g anim (ZN 7 No A NoC) ;
|
||||
_ + "ие" => makeNoun word g anim (ZN 7 No A NoC) ;
|
||||
_ + "ье" => makeNoun word g anim (ZN 6 Ast A NoC) ;
|
||||
_ + "тель" => makeNoun word g anim (ZN 2 No A NoC) ;
|
||||
_ + "ь" => makeNoun word g anim
|
||||
_ + "уть" => makeNoun word g anim rel rt (ZN 8 No B NoC) ;
|
||||
_ + "ий" => makeNoun word g anim rel rt (ZN 7 No A NoC) ;
|
||||
_ + "ия" => makeNoun word g anim rel rt (ZN 7 No A NoC) ;
|
||||
_ + "ие" => makeNoun word g anim rel rt (ZN 7 No A NoC) ;
|
||||
_ + "ье" => makeNoun word g anim rel rt (ZN 6 Ast A NoC) ;
|
||||
_ + "тель" => makeNoun word g anim rel rt (ZN 2 No A NoC) ;
|
||||
_ + "ь" => makeNoun word g anim rel rt
|
||||
(case g of {Fem => (ZN 8 No A NoC); _ => (ZN 2 No A NoC)});
|
||||
_ + "и" => makeNoun word g anim ZN0 ;
|
||||
_ + #consonant + ("к"|"х"|"г") + "а" => makeNoun word g anim (ZN 3 Ast A NoC) ;
|
||||
_ + ("к" | "х" | "г") => makeNoun word g anim (ZN 3 No A NoC) ;
|
||||
_ + ("к" | "х" | "г") + "а" => makeNoun word g anim (ZN 3 No A NoC) ;
|
||||
_ + "ца" => makeNoun word g anim (ZN 5 No A NoC) ;
|
||||
_ + "й" => makeNoun word g anim (ZN 6 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") => makeNoun word g anim (ZN 4 No A NoC) ;
|
||||
_ + "ша" => makeNoun word g anim (ZN 4 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") + "а" => makeNoun word g anim (ZN 4 No A NoC) ;
|
||||
_ + "ц" => makeNoun word g anim (ZN 5 Ast A NoC) ;
|
||||
_ + "о" => makeNoun word g anim (ZN 1 No A NoC) ;
|
||||
_ + "а" => makeNoun word g anim (ZN 1 No A NoC) ;
|
||||
_ => makeNoun word g anim (ZN 1 No A NoC)
|
||||
_ + "и" => makeNoun word g anim rel rt ZN0 ;
|
||||
_ + #consonant + ("к"|"х"|"г") + "а" => makeNoun word g anim rel rt (ZN 3 Ast A NoC) ;
|
||||
_ + ("к" | "х" | "г") => makeNoun word g anim rel rt (ZN 3 No A NoC) ;
|
||||
_ + ("к" | "х" | "г") + "а" => makeNoun word g anim rel rt (ZN 3 No A NoC) ;
|
||||
_ + "ца" => makeNoun word g anim rel rt (ZN 5 No A NoC) ;
|
||||
_ + "й" => makeNoun word g anim rel rt (ZN 6 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") => makeNoun word g anim rel rt (ZN 4 No A NoC) ;
|
||||
_ + "ша" => makeNoun word g anim rel rt (ZN 4 No A NoC) ;
|
||||
_ + ("ж" | "ш" | "ч" | "щ") + "а" => makeNoun word g anim rel rt (ZN 4 No A NoC) ;
|
||||
_ + "ц" => makeNoun word g anim rel rt (ZN 5 Ast A NoC) ;
|
||||
_ + "о" => makeNoun word g anim rel rt (ZN 1 No A NoC) ;
|
||||
_ + "а" => makeNoun word g anim rel rt (ZN 1 No A NoC) ;
|
||||
_ => makeNoun word g anim rel rt (ZN 1 No A NoC)
|
||||
} in
|
||||
noMinorCases nfb ;
|
||||
|
||||
@@ -146,7 +153,8 @@ oper
|
||||
sloc = base.sprep ;
|
||||
sptv = base.sgen ;
|
||||
svoc = base.snom ;
|
||||
mayben = BothSgPl
|
||||
mayben = BothSgPl ;
|
||||
rt = base.rt ;
|
||||
} ;
|
||||
|
||||
mkNAltPl : NounForms -> NounForms -> NounForms
|
||||
@@ -219,9 +227,10 @@ oper
|
||||
pdat = n1.pdat ++ l ++ n2.pdat ;
|
||||
pacc = n1.pacc ++ l ++ n2.pacc ;
|
||||
pins = n1.pins ++ l ++ n2.pins ;
|
||||
pprep = n1.pprep ++ l ++ n2.pprep
|
||||
pprep = n1.pprep ++ l ++ n2.pprep ;
|
||||
} ;
|
||||
|
||||
|
||||
---------------------------
|
||||
-- Adjectives -- Прилагательные
|
||||
|
||||
@@ -496,6 +505,8 @@ oper
|
||||
sloc = af.fsgen ;
|
||||
sptv = af.fsgen ;
|
||||
svoc = af.fsnom ;
|
||||
rel = af ;
|
||||
rt = GenType ;
|
||||
g=g ;
|
||||
mayben=BothSgPl ;
|
||||
anim=anim
|
||||
@@ -516,6 +527,8 @@ oper
|
||||
sloc = af.msprep ;
|
||||
sptv = af.msgen ;
|
||||
svoc = af.msnom ;
|
||||
rel = af ;
|
||||
rt = GenType ;
|
||||
g=g ;
|
||||
mayben=BothSgPl ;
|
||||
anim=anim
|
||||
@@ -536,6 +549,8 @@ oper
|
||||
sloc = af.msprep ;
|
||||
sptv = af.msgen ;
|
||||
svoc = af.nsnom ;
|
||||
rel = af ;
|
||||
rt = GenType ;
|
||||
g=g ;
|
||||
mayben=BothSgPl ;
|
||||
anim=anim
|
||||
@@ -1319,7 +1334,9 @@ oper
|
||||
pvoc=n.s ! Pl ! VocRus ;
|
||||
g=n.g ;
|
||||
mayben=n.mayben ;
|
||||
anim=n.anim
|
||||
anim=n.anim ;
|
||||
rel=n.rel ;
|
||||
rt =n.rt ;
|
||||
} ;
|
||||
|
||||
caseTableToRecord : (Case => Str) -> Agr -> Animacy -> IPronounForms
|
||||
@@ -1465,7 +1482,7 @@ oper
|
||||
param DForm = unit | teen | ten | hund ;
|
||||
param Place = attr | indep ;
|
||||
oper
|
||||
mille : Noun = nounFormsNoun ((guessNounForms "тысяча") ** {sins=variants {"тысячей" ; "тысячью"}});
|
||||
mille : Noun = nounFormsNoun ((guessNounForms "тысяча" (doGuessAdjectiveForms "тысячный") AdjType) ** {sins=variants {"тысячей" ; "тысячью"}});
|
||||
|
||||
ith_forms : Str -> AdjForms
|
||||
= \s -> {
|
||||
|
||||
Reference in New Issue
Block a user