1
0
forked from GitHub/gf-rgl

minor Estonian additions from last summer (#51)

* add two new nominal modifiers of type NP -> CN -> CN

* change married_A2 to invariant adjective

* rename CommonNoun to Noun

* change type of relPron

* merge CompAP and ICompAP using the same oper ; fix reflPron (ise, enda, ...) and add a helper function fixPlNom

* minor cleanup

* change in who_RP, reflecting the change of relative pronouns in ResEst

* Add new functions to ExtendEst ; update comments in ResEst
This commit is contained in:
Inari Listenmaa
2018-05-24 14:17:11 +01:00
committed by GitHub
parent 9bd63b9d8d
commit 8ae61cc1a8
10 changed files with 100 additions and 75 deletions

View File

@@ -89,8 +89,8 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
A2 = A ** {c2 : Compl} ;
N = Noun ;
N2 = CommonNoun ** {c2 : Compl ; isPre : Bool ; lock_N2 : {}} ;
N3 = CommonNoun ** {c2,c3 : Compl ; isPre,isPre2 : Bool ; lock_N3 : {}} ;
N2 = Noun ** {c2 : Compl ; isPre : Bool ; lock_N2 : {}} ;
N3 = Noun ** {c2,c3 : Compl ; isPre,isPre2 : Bool ; lock_N3 : {}} ;
PN = {s : Case => Str} ;
oper Verb1 = Verb ** { sc : NPForm} ; --what is this for? --subject case, i.e. "ma näen kassi"/"mul on kass"

View File

@@ -28,6 +28,7 @@ concrete ExtendEst of Extend =
Coordination,
Prelude,
MorphoEst,
LexiconEst,
ParadigmsEst in {
lin
@@ -44,7 +45,7 @@ concrete ExtendEst of Extend =
-- : Num -> CN -> RP ; -- whose car
GenRP num cn = {
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
s = \\n,c => let k = npform2case num.n c in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
a = RNoAg
} ;
@@ -115,26 +116,34 @@ concrete ExtendEst of Extend =
mkVPI : VP -> VPI = \vp -> lin VPI {} ;
-----
lin
ICompAP ap = {} ; ---- IComp should have agr!
IAdvAdv adv = {} ;
-}
lin
-- : AP -> IComp ; -- "how old"
ICompAP ap = icompAP "kui" ap ;
-- : Adv -> IAdv ; -- "how often"
IAdvAdv adv = { s = "kui" ++ adv.s } ;
-- : VP -> AP ; -- (the man) looking at Mary / filme vaatav (mees)
PresPartAP vp = {
s = \\_,_ => vp2adv vp True VIPresPart ;
infl = Invariable
} ;
{- TODO: need to change VP to get this to work properly:
{- TODO: need to change VP to get the following 3 functions to work properly:
1) Add "mine" form into VP (or switch to a BIND solution and just add a stem)
2) Change s2 in VP so that we can manipulate the complement to be in genitive!
-- : VP -> SC ; -- looking at Mary (is fun) / filmide vaatamine (on tore)
EmbedPresPart vp =
let vpGen = vp ; --** { s2 = \\_,_,_ => vp.s2 ! True ! Pos ! }
{s = vp2adv vp True VI } ;
-- : VP -> CN -- publishing of the document (can get a determiner)
GerundCN vp = {} ;
-- : VP -> NP -- publishing the document (by nature definite)
GerundNP vp = {} ;
-}
-- : VPSlash -> AP ; -- täna leitud
@@ -147,13 +156,7 @@ concrete ExtendEst of Extend =
s = \\_,_ => np.s ! NPCase Gen ++ "poolt"
++ vp2adv vp True (VIPass Past) ;
infl = Invariable } ;
{-
-- : VP -> CN -- publishing of the document (can get a determiner)
GerundCN vp = {} ;
-- : VP -> NP -- publishing the document (by nature definite)
GerundNP vp = {} ;
-}
-- : VP -> Adv
GerundAdv vp =
{ s = vp2adv vp True (VIInf InfDes) } ;
@@ -192,22 +195,38 @@ lin
ComplBareVS v s = insertExtra s.s (predV v) ;
SlashBareV2S v s = insertExtrac s.s (predVc v) ;
-}
-- : N -> N -> N ; -- control system / controls system / control-system
CompoundN noun cn = lin N {
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf ---- AR genitive best?
s = \\nf => noun.s ! NCase Sg Gen ++ BIND ++ cn.s ! nf
} ;
{-
-- : N -> A -> AP ; -- language independent / language-independent
CompoundAP noun adj = {} ;
FrontExtPredVP np vp = {} ;
InvFrontExtPredVP np vp = {} ;
-- : VS -> Utt -> VP ; -- say: "today"
ComplDirectVS vs utt = {} ;
-- : VQ -> Utt -> VP ; -- ask: "when"
ComplDirectVQ vq utt = {} ;
-- : NP -> VS -> Utt -> Cl ; -- "I am here", she said
FrontComplDirectVS np vs utt = {} ;
-- : NP -> VQ -> Utt -> Cl ; -- "where", she asked
FrontComplDirectVQ np vq utt = {} ;
-}
-- : AP -> VP -> Cl ; -- it is good to walk / on hea kõndida
PredAPVP ap vp =
let heaOllaVP : VP = insertObj (\\_,_ => ap.s) vp ; -- puts AP into the s2 field
heaOllaComp : Comp = CompVP ASimul PPos heaOlla ; -- chooses InfDa, fixes word order
heaOlla : VP = UseComp heaOllaComp -- looks silly, but I want to reuse the abstract syntax funs :-P
in existClause noSubj (agrP3 Sg) heaOlla ;
oper
testCl = PredAPVP (PositA good_A) (UseV walk_V) ;
lin
-}
-- : AP -> CN ; -- a green one ; en grön (Swe)
AdjAsCN ap = { s = ap.s ! True } ; -- True = it's a modifier, not a predicate
@@ -224,7 +243,10 @@ lin
lin
ReflRNP vps rnp = insertObjPre (\\a => vps.c2 ++ rnp.s ! a) vps ;
-- : RNP
ReflPron = {s = reflPron} ;
ReflPoss num cn = {s = \\a => possPron ! a ++ num.s ! Nom ++ cn.s ! num.n ! Nom} ;
PredetRNP predet rnp = {s = \\a => predet.s ++ rnp.s ! a} ;

View File

@@ -9,14 +9,16 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
isNeg = False
} ;
GenCN = caseCN Gen ; -- auton merkki
GenCN = caseCN Gen ; -- soome mees
ComitCN = caseCN Comit ; -- puudega mets
ElatCN = caseCN Elat ; -- puust laud
AbessCN = caseCN Abess ; -- autota pere
TerminCN = caseCN Termin ; -- maani kleit
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
GenRP num cn = {
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
s = \\n,c => let k = npform2case num.n c in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
a = RNoAg
--- a = RAg (agrP3 num.n)
} ;
@@ -190,8 +192,9 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
a = p.a
} ;
-- : Pron -> Quant ;
ProDropPoss p = {
s = \\_,_ => "oma" ; --???
s = \\_,_ => "oma" ;
sp = \\_,_ => p.s ! NPCase Gen ;
isNum = False ;
isDef = True ;

View File

@@ -7,9 +7,11 @@ abstract ExtraEstAbs = Extra [
flags coding=utf8 ;
fun
GenCN : NP -> CN -> CN ; -- auton merkki
GenCN : NP -> CN -> CN ; -- soome mees
ComitCN : NP -> CN -> CN ; -- põlenud puudega mets
ElatCN : NP -> CN -> CN ; -- puust laud
AbessCN : NP -> CN -> CN ; -- autota pere
TerminCN : NP -> CN -> CN ; -- maani kleit
AdvExistNP : Adv -> NP -> Cl ; -- kuvassa olemme me
AdvPredNP : Adv -> V -> NP -> Cl ; -- kuvassa hymyilee Veikko

View File

@@ -119,7 +119,7 @@ lin
love_N = mkN "armastus" ;
love_V2 = mkV2 (mkV "armastama") partitive ;
man_N = mkN "mees" "mehe" "meest" "mehesse" "meeste" "mehi" ;
married_A2 = mkA2 (mkA "abielus") (casePrep comitative) ;
married_A2 = mkA2 (invA "abielus") (casePrep comitative) ;
meat_N = mkN "liha" ;
milk_N = mkN "piim" "piima" "piima" ;
moon_N = mkN "kuu" ;

View File

@@ -487,10 +487,10 @@ These used to be here:
-- for Structural
-----------------------
caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
caseTable : Number -> Noun -> Case => Str = \n,cn ->
\\c => cn.s ! NCase n c ;
mkDet : Number -> CommonNoun -> {
mkDet : Number -> Noun -> {
s,sp : Case => Str ; -- minun kolme
n : Number ; -- Pl (agreement feature for verb)
isNum : Bool ; -- True (a numeral is present)
@@ -563,23 +563,17 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
x => shortMa.s ! x } } ;
-- The relative pronoun, "joka", is inflected in case and number,
-- like common nouns, but it does not take possessive suffixes.
-- The inflextion shows a surprising similarity with "suo".
oper
relPron : Number => Case => Str =
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida") in
\\n,c => case <n,c> of {
<Pl,Nom> => "mis" ;
<> => mis.s ! NCase n c } ;
relPron : NForm => Str =
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida")
in fixPlNom "mis" mis.s ;
kesPron : Number => Case => Str =
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda") in
\\n,c => case <n,c> of {
<Pl,Nom> => "kes" ;
<> => kes.s ! NCase n c } ;
kesPron : NForm => Str =
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda")
in fixPlNom "kes" kes.s ;
ProperName = {s : Case => Str} ;

View File

@@ -41,7 +41,7 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
} ;
IdRP = {
s = \\n,c => relPron ! n ! npform2case n c ;
s = \\n,c => relPron ! NCase n (npform2case n c) ;
a = RNoAg
} ;

View File

@@ -321,7 +321,7 @@ oper
let
agrfin = case vp.sc of {
NPCase Nom => <agr,True> ;
_ => <agrP3 Sg,False> -- minun täytyy, minulla on
_ => <agrP3 Sg,False> -- minule meeldib, minul on
} ;
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
in {subj = sub b ;
@@ -566,17 +566,14 @@ oper
vforms2V (regVForms kinkima kinkida kingib kingitakse) ;
noun2adj : CommonNoun -> Adj = noun2adjComp True ;
-- noun2adj : Noun -> Adj = noun2adjComp True ;
noun2adj : Noun -> Adj = noun2adjComp True ;
-- TODO: remove the unused arguments and clean up the code
-- TODO: AAdv is current just Sg Ablat, which seems OK in most cases, although
-- ilus -> ilusti | ilusalt?
-- hea -> hästi
-- parem -> paremini
-- parim -> kõige paremini | parimalt?
noun2adjComp : Bool -> CommonNoun -> Adj = \isPos,tuore ->
-- noun2adjComp : Bool -> Noun -> Adj = \isPos,tuore ->
noun2adjComp : Bool -> Noun -> Adj = \isPos,tuore ->
let
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
tuoreemmin = Predef.tk 2 (tuore.s ! NCase Sg Gen) + "in"
@@ -587,34 +584,52 @@ oper
} ;
} ;
CommonNoun = {s : NForm => Str} ;
Noun = {s : NForm => Str} ;
-- To form an adjective, it is usually enough to give a noun declension: the
-- adverbial form is regular.
Adj : Type = {s : AForm => Str} ;
-- Helper functions to form Comps.
compAP = icompAP [] ;
icompAP : Str -> {s : Bool => NForm => Str} -> {s : Agr => Str} = \kui,ap ->
{ s = \\agr =>
let n = complNumAgr agr ;
in kui ++ ap.s ! False ! NCase n Nom } ;
compCN : Noun -> {s : Agr => Str} = \cn ->
{ s = \\agr =>
let n = complNumAgr agr ;
in cn.s ! NCase n Nom } ;
-- Reflexive pronoun.
--- Possessive could be shared with the more general $NounFin.DetCN$.
--oper
--Estonian version started
reflPron : Agr -> NP = \agr ->
let
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "IGNORE" "IGNORE")
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "endi" "endid") ;
n = case agr of {
AgPol => Sg ;
Ag n _ => n } ;
in {
s = table {
NPAcc => "ennast" ;
NPCase c => ise.s ! NCase Sg c
NPCase c => fixPlNom "endid" ise.s ! NCase n c
} ;
a = agr ;
isPron = False -- no special acc form
} ;
-- Using nForms6 as a shortcut works pretty nicely, but plural nominative is often wrong.
-- This is used at least 3 times :-D
fixPlNom : Str -> (NForm => Str) -> (NForm => Str) = \mis,n ->
table { NCase Pl Nom => mis ;
x => n ! x } ;
Noun = CommonNoun ** {lock_N : {}} ;
NForms : Type = Predef.Ints 5 => Str ;
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
@@ -628,7 +643,7 @@ oper
5 => jogesid
} ;
n2nforms : CommonNoun -> NForms = \ukko -> table {
n2nforms : Noun -> NForms = \ukko -> table {
0 => ukko.s ! NCase Sg Nom ;
1 => ukko.s ! NCase Sg Gen ;
2 => ukko.s ! NCase Sg Part ;
@@ -639,7 +654,7 @@ oper
-- Converts 6 given strings (Nom, Gen, Part, Illat, Gen, Part) into Noun
-- http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=226
nForms2N : NForms -> CommonNoun = \f ->
nForms2N : NForms -> Noun = \f ->
let
jogi = f ! 0 ;
joe = f ! 1 ;

View File

@@ -97,19 +97,8 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
----b UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
CompAP ap = {
s = \\agr =>
let
n = complNumAgr agr ;
in ap.s ! False ! (NCase n Nom)
} ;
CompCN cn = {
s = \\agr =>
let
n = complNumAgr agr ;
in cn.s ! (NCase n Nom)
} ;
CompAP = compAP ;
CompCN = compCN ;
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
CompAdv a = {s = \\_ => a.s} ;

View File

@@ -152,7 +152,7 @@ lin
{s = \\agr => infVPAnt ant.a (NPCase Nom) pol.p agr vp InfDa } ;
-- TODO: revisit pronouns? Looks a bit overly complicated. /IL
who_RP = { s = \\n,c => MorphoEst.kesPron ! n ! npform2case n c ;
who_RP = { s = \\n,c => MorphoEst.kesPron ! NCase n (npform2case n c) ;
a = RNoAg } ;
that_RP = which_RP ;