1
0
forked from GitHub/gf-rgl

(Est) Automatic whitespace removal

in its own commit,rather than have whitespace changes in content commits
This commit is contained in:
Inari Listenmaa
2022-04-13 10:42:34 +08:00
committed by Meowyam
parent 5eb333ce6a
commit e06c3433b9
24 changed files with 539 additions and 538 deletions

View File

@@ -16,10 +16,10 @@ concrete AdjectiveEst of Adjective = CatEst ** open ResEst, Prelude in {
} ;
infl = Regular ; --a.infl
} ;
CAdvAP ad ap np = {
s = \\m,af => ad.s ++ ap.s ! m ! af ++ ad.p ++ np.s ! NPCase Nom ;
infl = ap.infl
infl = ap.infl
} ;
UseComparA a = {
s = \\_,nf => a.s ! Compar ! AN nf ;
@@ -34,14 +34,14 @@ concrete AdjectiveEst of Adjective = CatEst ** open ResEst, Prelude in {
ComplA2 adj np = {
s = \\isMod,af =>
s = \\isMod,af =>
preOrPost isMod (appCompl True Pos adj.c2 np) (adj.s ! Posit ! AN af) ;
infl = adj.infl
} ;
ReflA2 adj = {
s = \\isMod,af =>
preOrPost isMod
s = \\isMod,af =>
preOrPost isMod
(appCompl True Pos adj.c2 (reflPron (agrP3 Sg))) (adj.s ! Posit ! AN af) ;
infl = adj.infl
} ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common:../prelude:../api
concrete AllEst of AllEstAbs =
concrete AllEst of AllEstAbs =
LangEst, -- - [SlashV2VNP,SlashVV, TFut], ---- to speed up linking; to remove spurious parses
ExtendEst -- - [ProDrop, ProDropPoss, S_OSV, S_VSO, S_ASV] -- to exclude spurious parses
**

View File

@@ -1,4 +1,4 @@
abstract AllEstAbs =
abstract AllEstAbs =
Lang,
ExtraEstAbs
** {} ;

View File

@@ -21,7 +21,7 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
QCl = {s : ResEst.Tense => Anteriority => Polarity => Str} ;
IP = {s : NPForm => Str ; n : Number} ;
IComp = {s : Agr => Str} ;
IComp = {s : Agr => Str} ;
IDet = {s : Case => Str ; n : Number ; isNum : Bool} ;
IQuant = {s : Number => Case => Str} ;
@@ -33,17 +33,17 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
-- Verb
VP = ResEst.VP ;
VPSlash = ResEst.VP ** {c2 : Compl} ;
Comp = {s : Agr => Str} ;
VPSlash = ResEst.VP ** {c2 : Compl} ;
Comp = {s : Agr => Str} ;
-- Adjective
-- The $Bool$ in s tells whether usage is modifying (as opposed to
-- predicative), e.g. "x on suurem kui y" vs. "y:st suurem arv".
-- The $Infl$ in infl tells whether the adjective inflects as a
-- The $Infl$ in infl tells whether the adjective inflects as a
-- modifier: e.g. "väsinud mehele" vs. "mees muutus väsinuks".
AP = {s : Bool => NForm => Str ; infl : Infl} ;
AP = {s : Bool => NForm => Str ; infl : Infl} ;
-- Noun
@@ -55,8 +55,9 @@ concrete CatEst of Cat = CommonX ** open HjkEst, ResEst, Prelude in {
sp : Case => Str ; -- se (substantival form)
n : Number ; -- Pl (agreement feature for verb)
isNum : Bool ; -- True (a numeral is present)
isDef : Bool -- True (verb agrees in Pl, Nom is not Part) --I: actually, can we get rid of this?
isDef : Bool -- True (verb agrees in Pl, Nom is not Part) --I: actually, can we get rid of this?
} ;
---- QuantSg, QuantPl = {s : Case => Str ; isDef : Bool} ;
Ord = {s : NForm => Str} ;
Predet = {s : Number => NPForm => Str} ;

View File

@@ -1,6 +1,6 @@
--# -path=alltenses:.:../abstract:../api:../common
concrete ConstructionEst of Construction = CatEst **
concrete ConstructionEst of Construction = CatEst **
open SyntaxEst, SymbolicEst, ParadigmsEst, (L = LexiconEst), (E = ExtraEst), (R = ResEst), Prelude in {
flags coding=utf8 ;
@@ -12,7 +12,7 @@ lin
ill_VP = mkVP (mkA "haige") ;
ready_VP = mkVP (ParadigmsEst.mkA "valmis") ;
has_age_VP card =
has_age_VP card =
let n_years_AdA : AdA = lin AdA (mkUtt (lin NP (mkNP <lin Card card : Card> L.year_N)))
in mkVP (mkAP n_years_AdA L.old_A) ;
@@ -25,7 +25,7 @@ lin
-- some more things
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
is_right_VP = mkVP have_V2 (lin NP (mkNP (ParadigmsEst.mkN "õigus"))) ;
is_wrong_VP = mkVP (ParadigmsEst.mkV "eksima") ;
@@ -37,7 +37,7 @@ lin
where_go_QCl np = mkQCl (lin IAdv (ss "kuhu")) (mkCl np (mkVP L.go_V)) ;
where_come_from_QCl np = mkQCl (lin IAdv (ss "kust")) (mkCl np (mkVP L.come_V)) ;
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "siia") ;
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "siia") ;
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "sealt") ;
@@ -61,16 +61,16 @@ lin
monthAdv m = SyntaxEst.mkAdv in_Prep (mkNP m) ;
yearAdv y = SyntaxEst.mkAdv (prePrep nominative "aastal") y ;
---- dayMonthAdv d m = ParadigmsEst.mkAdv (d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part) ;
---- dayMonthAdv d m = ParadigmsEst.mkAdv (d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part) ;
---- monthYearAdv m y = SyntaxEst.mkAdv in_Prep (mkNP (mkNP m) (SyntaxEst.mkAdv (casePrep nominative) y)) ;
---- dayMonthYearAdv d m y =
---- lin Adv {s = d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part ++ y.s ! R.NPCase R.Nom} ;
---- dayMonthYearAdv d m y =
---- lin Adv {s = d.s ! R.NPCase R.Nom ++ BIND ++ "." ++ m.s ! R.NCase R.Sg R.Part ++ y.s ! R.NPCase R.Nom} ;
intYear = symb ;
intMonthday = symb ;
oper
pointWeekday : Weekday -> Str = \w -> (SyntaxEst.mkAdv (casePrep essive) (mkNP w.noun)).s ;
pointWeekday : Weekday -> Str = \w -> (SyntaxEst.mkAdv (casePrep essive) (mkNP w.noun)).s ;
lincat Language = N ;
@@ -86,11 +86,11 @@ lin
oper mkLanguage : Str -> N = \s -> mkN (s ++ "keel") ;
oper mkWeekday : Str -> Weekday = \d ->
oper mkWeekday : Str -> Weekday = \d ->
lin Weekday {
noun = mkN d ;
noun = mkN d ;
habitual = ParadigmsEst.mkAdv (d + "iti") ; --kolmapäeviti
} ;
} ;
lin monday_Weekday = mkWeekday "esmaspäev" ;
@@ -101,9 +101,9 @@ lin friday_Weekday = mkWeekday "reede" ;
lin saturday_Weekday = mkWeekday "laupäev" ;
lin sunday_Weekday = mkWeekday "pühapäev" ;
lin january_Month = mkN "jaanuar" ;
lin january_Month = mkN "jaanuar" ;
lin february_Month = mkN "veebruar" ;
lin march_Month = mkN "märts" ;
lin march_Month = mkN "märts" ;
lin april_Month = mkN "aprill" ;
lin may_Month = mkN "mai" ;
lin june_Month = mkN "juuni" ;

View File

@@ -2,5 +2,5 @@
-- documentation of Estonian in Estonian: the default introduced in LangEst
concrete DocumentationEst of Documentation = CatEst **
concrete DocumentationEst of Documentation = CatEst **
DocumentationEstFunctor with (Terminology = TerminologyEst) ;

View File

@@ -2,5 +2,5 @@
-- documentation of Estonian in English
concrete DocumentationEstEng of Documentation = CatEst **
concrete DocumentationEstEng of Documentation = CatEst **
DocumentationEstFunctor with (Terminology = TerminologyEng) ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
incomplete concrete DocumentationEstFunctor of Documentation = CatEst ** open
incomplete concrete DocumentationEstFunctor of Documentation = CatEst ** open
Terminology, -- the interface
ResEst,
ParadigmsEst,
@@ -30,17 +30,17 @@ lin
s2 = inflNoun (\nf -> noun.s ! nf)
} ;
InflectionA, InflectionA2 = \adj ->
InflectionA, InflectionA2 = \adj ->
let posit : (AForm => Str) = adj.s ! Posit ;
compar : (AForm => Str) = adj.s ! Compar ;
superl : (AForm => Str) = adj.s ! Superl ;
in
in
{ t = "a" ;
s1 = heading1 (heading adjective_Category) ;
s2 = inflNoun (\nf -> posit ! AN nf) ++
heading2 (heading comparative_Parameter) ++
inflNoun (\nf -> compar ! AN nf) ++
heading2 (heading superlative_Parameter) ++
s2 = inflNoun (\nf -> posit ! AN nf) ++
heading2 (heading comparative_Parameter) ++
inflNoun (\nf -> compar ! AN nf) ++
heading2 (heading superlative_Parameter) ++
inflNoun (\nf -> superl ! AN nf)
} ;
@@ -58,91 +58,91 @@ lin
InflectionV v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v)) ;
s2 = inflVerb v
} ;
InflectionV2 v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP)) ;
s2 = inflVerb v
} ;
InflectionV3 v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.something_NP S.something_NP)) ;
s2 = inflVerb v
} ;
InflectionV2V v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (S.mkVP (L.sleep_V)))) ;
s2 = inflVerb v
} ;
InflectionV2S v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin S (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionV2Q v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP (lin QS (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionV2A v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v S.we_NP L.beautiful_A)) ;
s2 = inflVerb v
} ;
InflectionVV v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (S.mkVP (L.sleep_V)))) ;
s2 = inflVerb v
} ;
InflectionVS v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (lin S (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionVQ v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v (lin QS (ss "...")))) ;
s2 = inflVerb v
} ;
InflectionVA v = {
t = "v" ;
s1 = heading1 (heading verb_Category) ++
s1 = heading1 (heading verb_Category) ++
paragraph (verbExample (S.mkCl S.she_NP v L.beautiful_A)) ;
s2 = inflVerb v
} ;
oper
oper
verbExample : CatEst.Cl -> Str = \cl -> (S.mkUtt cl).s ;
{-
-} --# notpresent
inflVerb : CatEst.V -> Str = \verb ->
let
let
--verb = sverb2verbSep verb0 ;
vfin : ResEst.VForm -> Str = \f ->
verb.s ! f ;
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
(S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP n2))).s ;
in
@@ -152,7 +152,7 @@ oper
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
) ++
@@ -167,13 +167,13 @@ oper
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 (PastPart Act)) ++
td (vfin (PastPart Act)) ++
td (vfin (PastPart Pass)) ++
td (vfin (PassImpf False)))
) ++
@@ -183,12 +183,12 @@ oper
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" "TODO pass condit (nt loetaks)" --# 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 "3.p" ++ td (vfin (Condit Sg P3)) ++ td (vfin (Condit Pl P3)))
) ++
heading3 (nounNounHeading present_Parameter quotative_Parameter) ++
frameTable (
@@ -196,8 +196,8 @@ oper
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
tr (th "isik." ++ td (vfin (Quotative Act))
) ++
tr (th "isik." ++ td (vfin (Quotative Act))
++ intagAttr "td" "rowspan=3" (vfin (Quotative Act)) --# notpresent
) ++
tr (th "umbis." ++ td (vfin (Quotative Pass)) ++ td (vfin (Quotative Pass))
@@ -208,11 +208,11 @@ oper
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 ImperPass)) ++
tr (th "2.p" ++ td (vfin (Imper Sg)) ++ td (vfin (Imper Pl))) ++
tr (th "3.p" ++ td (vfin (ImperP3)) ++ td (vfin ImperP3))
tr (th "3.p" ++ td (vfin (ImperP3)) ++ td (vfin ImperP3))
) ++
heading2 (nounPluralHeading nominal_form_ParameterType).s ++
heading3 (heading infinitive_Parameter) ++
@@ -221,32 +221,32 @@ oper
th (heading nominative_Parameter) ++ td (vfin (Inf InfDa))) ++
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfDes))) ++
tr (intagAttr "th" "rowspan=5" "ma" ++
tr (intagAttr "th" "rowspan=5" "ma" ++
th (heading illative_Parameter) ++ td (vfin (Inf InfMa))) ++
tr (th (heading inessive_Parameter) ++ td (vfin (Inf InfMas))) ++
tr (th (heading elative_Parameter) ++ td (vfin (Inf InfMast))) ++
tr (th (heading abessive_Parameter) ++ td (vfin (Inf InfMata))) ++
tr (th (heading abessive_Parameter) ++ td (vfin (Inf InfMata))) ++
tr (th (heading translative_Parameter) ++ td (vfin (Inf InfMaks)))
) ++
) ++
heading3 (heading participle_Parameter) ++
frameTable (
tr (intagAttr "th" "rowspan=2" (heading present_Parameter) ++
th (heading active_Parameter) ++
tr (intagAttr "th" "rowspan=2" (heading present_Parameter) ++
th (heading active_Parameter) ++
td (vfin (PresPart Act))) ++
tr (th (heading passive_Parameter) ++
tr (th (heading passive_Parameter) ++
td (vfin (PresPart Pass))) ++
tr (intagAttr "th" "rowspan=2" (heading perfect_Parameter) ++
th (heading active_Parameter) ++
tr (intagAttr "th" "rowspan=2" (heading perfect_Parameter) ++
th (heading active_Parameter) ++
td (vfin (PastPart Act ))) ++
tr (th (heading passive_Parameter) ++
tr (th (heading passive_Parameter) ++
td (vfin (PastPart Pass )))
) ; --}
inflNoun : (NForm -> Str) -> Str = \nouns ->
frameTable (
inflNoun : (NForm -> Str) -> Str = \nouns ->
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))) ++
@@ -274,6 +274,6 @@ lin
MkTag i = ss (i.t) ;
{- --# notpresent
-}
-}
}

View File

@@ -1,4 +1,4 @@
concrete ExtraEst of ExtraEstAbs = CatEst **
concrete ExtraEst of ExtraEstAbs = CatEst **
open ResEst, MorphoEst, Coordination, Prelude, NounEst, StructuralEst, (R = ParamX) in {
flags coding=utf8;
lin
@@ -6,7 +6,7 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
s,sp = \\_,_ => np.s ! NPCase Gen ;
isNum = False ;
isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing
isNeg = False
isNeg = False
} ;
GenCN = caseCN Gen ; -- soome mees
@@ -18,11 +18,11 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
GenRP num cn = {
s = \\n,c => let k = npform2case num.n c in relPron ! NCase n Gen ++ cn.s ! NCase num.n k ;
a = RNoAg
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)
} ;
oper
oper
caseCN : Case -> NP -> CN -> CN = \c,np,cn ->
lin CN { s = \\nf => np.s ! NPCase c ++ cn.s ! nf } ;
@@ -37,17 +37,17 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
MkVPI vp = {s = \\i => infVP (NPCase Nom) Pos (agrP3 Sg) vp i} ;
ConjVPI = conjunctDistrTable InfForm ;
ComplVPIVV vv vpi =
ComplVPIVV vv vpi =
insertObj (\\_,_,_ => vpi.s ! vv.vi) (predV vv) ;
lincat
VPS = {
s : Agr => Str ;
s : Agr => Str ;
sc : NPForm ; --- can be different for diff parts
} ;
[VPS] = {
s1,s2 : Agr => Str ;
s1,s2 : Agr => Str ;
sc : NPForm ; --- take the first: minä osaan kutoa ja täytyy virkata
} ;
@@ -79,45 +79,45 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
PassAgentVPSlash vp np = vp ;
{-
s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = npform2subjcase vp.c2.c} ;
s = {s = vp.s.s ; h = vp.s.h ; p = vp.s.p ; sc = npform2subjcase vp.c2.c} ;
s2 = \\b,p,a => np.s ! NPCase Nom ++ vp.s2 ! b ! p ! a ;
adv = vp.adv ;
ext = vp.ext ;
vptyp = vp.vptyp ;
} ; -}
AdvExistNP adv np =
mkClause (\_ -> adv.s) np.a (insertObj
AdvExistNP adv np =
mkClause (\_ -> adv.s) np.a (insertObj
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlema ** {sc = NPCase Nom}))) ;
RelExistNP prep rp np = {
s = \\t,ant,bo,ag =>
let
s = \\t,ant,bo,ag =>
let
n = complNumAgr ag ;
cl = mkClause
cl = mkClause
(\_ -> appCompl True Pos prep (rp2np n rp))
np.a
(insertObj
(\\_,b,_ => np.s ! NPCase Nom)
np.a
(insertObj
(\\_,b,_ => np.s ! NPCase Nom)
(predV (verbOlema ** {sc = NPCase Nom}))) ;
in
in
cl.s ! t ! ant ! bo ! SDecl ;
c = NPCase Nom
} ;
AdvPredNP adv v np =
mkClause (\_ -> adv.s) np.a (insertObj
mkClause (\_ -> adv.s) np.a (insertObj
(\\_,b,_ => np.s ! NPCase Nom) (predV v)) ;
ICompExistNP adv np =
let cl = mkClause (\_ -> adv.s ! np.a) np.a (insertObj
ICompExistNP adv np =
let cl = mkClause (\_ -> adv.s ! np.a) np.a (insertObj
(\\_,b,_ => np.s ! NPCase Nom) (predV (verbOlema ** {sc = NPCase Nom}))) ;
in {
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
} ;
IAdvPredNP iadv v np =
let cl = mkClause (\_ -> iadv.s) np.a (insertObj
let cl = mkClause (\_ -> iadv.s) np.a (insertObj
(\\_,b,_ => np.s ! v.sc) (predV v)) ;
in {
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
@@ -132,14 +132,14 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
n = Sg
} ;
PartCN cn =
let
PartCN cn =
let
acn = DetCN (DetQuant IndefArt NumSg) cn
in {
s = table {
NPCase Nom | NPAcc => acn.s ! NPCase ResEst.Part ;
c => acn.s ! c
} ;
} ;
a = acn.a ;
isPron = False ; isNeg = False
} ;
@@ -147,34 +147,34 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
--The reflexive possessive "oma"
--for "ta näeb oma koera" instead of *"tema koera"
OmaPoss = {s,sp = \\_,_ => "oma" ; isDef,isNeg,isNum = False} ;
ma_Pron = shortPronoun "ma" "mu" "mind" "minu" Sg P1 ;
sa_Pron = shortPronoun "sa" "su" "sind" "sinu" Sg P2;
ta_Pron = shortPronoun "ta" "ta" "teda" "tema" Sg P3 ;
me_Pron =
me_Pron =
{s = table {
NPCase Nom => "me" ;
n => (we_Pron.s) ! n
n => (we_Pron.s) ! n
} ;
a = Ag Pl P1 } ;
a = Ag Pl P1 } ;
te_Pron =
te_Pron =
{s = table {
NPCase Nom => "te" ;
n => (youPl_Pron.s) ! n
n => (youPl_Pron.s) ! n
} ;
a = Ag Pl P2 } ;
a = Ag Pl P2 } ;
nad_Pron =
{s = table {
NPCase Nom => "nad" ;
n => (they_Pron.s) ! n
n => (they_Pron.s) ! n
} ;
a = Ag Pl P3 } ;
a = Ag Pl P3 } ;
---- copied from VerbEst.CompAP, should be shared
ICompAP ap = {
s = \\agr =>
s = \\agr =>
let
n = complNumAgr agr ;
c = case n of {
@@ -187,68 +187,68 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
IAdvAdv adv = {s = "kui" ++ adv.s} ;
ProDrop p = {
s = table {NPCase (Nom | Gen) => [] ; c => p.s ! c} ;
s = table {NPCase (Nom | Gen) => [] ; c => p.s ! c} ;
---- drop Gen only works in adjectival position
a = p.a
} ;
-- : Pron -> Quant ;
-- : Pron -> Quant ;
ProDropPoss p = {
s = \\_,_ => "oma" ;
sp = \\_,_ => p.s ! NPCase Gen ;
isNum = False ;
isDef = True ;
isDef = True ;
isNeg = False
} ;
lincat
lincat
ClPlus, ClPlusObj, ClPlusAdv = ClausePlus ;
Part = {s : Str} ;
lin
S_SVO part t p clp =
let
lin
S_SVO part t p clp =
let
cl = clp.s ! t.t ! t.a ! p.p ;
pa = part.s ----
in
{s = t.s ++ p.s ++ cl.subj ++ pa ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
{s = t.s ++ p.s ++ cl.subj ++ pa ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
S_OSV part t p clp =
let
S_OSV part t p clp =
let
cl = clp.s ! t.t ! t.a ! p.p ;
pa = part.s ----
in
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.adv ++ cl.ext} ;
S_VSO part t p clp =
let
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.adv ++ cl.ext} ;
S_VSO part t p clp =
let
cl = clp.s ! t.t ! t.a ! p.p ;
pa = part.s
in
{s = t.s ++ p.s ++ cl.fin ++ pa ++ cl.subj ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
S_ASV part t p clp =
let
{s = t.s ++ p.s ++ cl.fin ++ pa ++ cl.subj ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
S_ASV part t p clp =
let
cl = clp.s ! t.t ! t.a ! p.p ;
pa = part.s
in
{s = t.s ++ p.s ++ cl.adv ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.ext} ;
{s = t.s ++ p.s ++ cl.adv ++ pa ++ cl.subj ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.ext} ;
S_OVS part t p clp =
let
S_OVS part t p clp =
let
cl = clp.s ! t.t ! t.a ! p.p ;
pa = part.s ----
in
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.fin ++ cl.inf ++ cl.subj ++ cl.adv ++ cl.ext} ;
{s = t.s ++ p.s ++ cl.compl ++ pa ++ cl.fin ++ cl.inf ++ cl.subj ++ cl.adv ++ cl.ext} ;
PredClPlus np vp = mkClausePlus (subjForm np vp.sc) np.a vp ;
PredClPlusFocSubj np vp = insertKinClausePlus 0 (mkClausePlus (subjForm np vp.sc) np.a vp) ;
PredClPlusFocVerb np vp = insertKinClausePlus 1 (mkClausePlus (subjForm np vp.sc) np.a vp) ;
PredClPlusObj np vps obj =
PredClPlusObj np vps obj =
insertObjClausePlus 0 False (\\b => appCompl True b vps.c2 obj) (mkClausePlus (subjForm np vps.sc) np.a vps) ;
PredClPlusFocObj np vps obj =
PredClPlusFocObj np vps obj =
insertObjClausePlus 0 True (\\b => appCompl True b vps.c2 obj) (mkClausePlus (subjForm np vps.sc) np.a vps) ;
PredClPlusAdv np vp adv =
PredClPlusAdv np vp adv =
insertObjClausePlus 1 False (\\_ => adv.s) (mkClausePlus (subjForm np vp.sc) np.a vp) ;
PredClPlusFocAdv np vp adv =
PredClPlusFocAdv np vp adv =
insertObjClausePlus 1 True (\\_ => adv.s) (mkClausePlus (subjForm np vp.sc) np.a vp) ;
ClPlusWithObj c = c ;
@@ -256,4 +256,4 @@ concrete ExtraEst of ExtraEstAbs = CatEst **
gi_Part = ss "gi" | ss "ki" ;
}
}

View File

@@ -33,7 +33,7 @@ abstract ExtraEstAbs = Extra [
me_Pron : Pron ;
te_Pron : Pron ;
nad_Pron : Pron ;
OmaPoss : Quant ; -- Reflexive possessive "oma"
ProDropPoss : Pron -> Quant ; -- vaimoni --TODO Is this relevant in Estonian? Is the agreement of pronoun ever needed, or is it the same as oma?

View File

@@ -1,6 +1,6 @@
concrete GrammarEst of Grammar =
NounEst,
VerbEst,
concrete GrammarEst of Grammar =
NounEst,
VerbEst,
AdjectiveEst,
AdverbEst,
NumeralEst,

View File

@@ -1,11 +1,11 @@
concrete IdiomEst of Idiom = CatEst **
concrete IdiomEst of Idiom = CatEst **
open MorphoEst, ParadigmsEst, Prelude in {
flags optimize=all_subs ; coding=utf8;
lin
ExistNP np =
let
ExistNP np =
let
cas : Polarity -> NPForm = \p -> case p of {
Pos => NPCase Nom ; -- on olemas lammas
Neg => NPCase Part -- ei ole olemas lammast
@@ -14,7 +14,7 @@ concrete IdiomEst of Idiom = CatEst **
in
existClause noSubj (agrP3 Sg) vp ;
ExistIP ip =
ExistIP ip =
let
cas : NPForm = NPCase Nom ; ---- also partitive in Extra
vp = insertObj (\\_,b,_ => "olemas") (predV olla) ;
@@ -45,11 +45,11 @@ concrete IdiomEst of Idiom = CatEst **
adv = vp.adv ;
p = vp.p ;
ext = vp.ext ;
sc = vp.sc ;
sc = vp.sc ;
} ;
ProgrVP vp =
let
ProgrVP vp =
let
inf = (vp.s ! VIInf InfMas ! Simul ! Pos ! agrP3 Sg).fin ;
on = predV olla
in {
@@ -58,16 +58,16 @@ concrete IdiomEst of Idiom = CatEst **
adv = vp.adv ;
p = vp.p ;
ext = vp.ext ;
sc = vp.sc ;
sc = vp.sc ;
} ;
-- This gives "otetaan oluet" instead of "ottakaamme oluet".
-- The imperative is not available in a $VP$.
ImpPl1 vp =
ImpPl1 vp =
let vps = vp.s ! VIPass Pres ! Simul ! Pos ! Ag Pl P1
in
{s = vps.fin ++ vps.inf ++
{s = vps.fin ++ vps.inf ++
vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.p ++ vp.ext
} ;

View File

@@ -1,6 +1,6 @@
concrete LexiconEst of Lexicon = CatEst ** open MorphoEst, ParadigmsEst, Prelude in {
flags
flags
optimize=values ; coding=utf8;
@@ -216,7 +216,7 @@ lin
yellow_A = mkA (mkN "kollane" "kollase" "kollast" "kollasesse" "kollaste" "kollaseid") ;
young_A = mkA (mkN "noor" "noore" "noort") ;
do_V2 = mkV2 (mkV "tegema" "teha") ;
do_V2 = mkV2 (mkV "tegema" "teha") ;
now_Adv = mkAdv "nüüd" ;
already_Adv = mkAdv "juba" ;

View File

@@ -1,9 +1,9 @@
resource MakeStructuralEst = open CatEst, ParadigmsEst, MorphoEst, Prelude in {
oper
mkConj : Str -> Str -> ParadigmsEst.Number -> Conj = \x,y,n ->
oper
mkConj : Str -> Str -> ParadigmsEst.Number -> Conj = \x,y,n ->
{s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
mkSubj : Str -> Subj = \x ->
mkSubj : Str -> Subj = \x ->
{s = x ; lock_Subj = <>} ;
mkIQuant : Str -> IQuant = \s ->
{s = \\n,c => s ; lock_IQuant = <>} ; ----

View File

@@ -11,7 +11,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
flags optimize=all ; coding=utf8;
oper
----------------------
-- morph. paradigms --
----------------------
@@ -19,7 +19,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
--Noun paradigms in HjkEst
--Comparative adjectives
--(could just use hjk_type_IVb_audit "suurem" "a")
--(could just use hjk_type_IVb_audit "suurem" "a")
-- Comparative adjectives inflect in the same way
-- TODO: confirm this
dSuurempi : Str -> NForms = \suurem ->
@@ -47,17 +47,17 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
saama
(saa + "da")
(saa + "b")
(saa + "dakse")
(saa + "dakse")
(saa + "ge") -- Imper Pl
sai
(saa + "nud")
(saa + "nud")
(saa + "dud") ;
-- TS 49
-- no d/t in da, takse ; imperfect 3sg ends in s
cKaima : (_ : Str) -> VForms = \kaima ->
let
kai = Predef.tk 2 kaima ;
kai = Predef.tk 2 kaima ;
in vForms8
kaima
(kai + "a")
@@ -65,10 +65,10 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(kai + "akse")
(kai + "ge")
(kai + "s")
(kai + "nud")
(kai + "nud")
(kai + "dud") ;
-- TS 49
-- TS 49
-- vowel changes in da, takse, no d/t ; imperfect 3sg ends in i
cJooma : (_ : Str) -> VForms = \jooma ->
let
@@ -78,7 +78,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
u = case o of {
"o" => "u" ;
"ö" => "ü" ;
_ => o
_ => o
} ;
q = case o of {
("o"|"ö") => "õ" ;
@@ -91,9 +91,9 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
juua
(joo + "b")
(juua + "kse")
(joo + "ge")
(joo + "ge")
j6i
(joo + "nud")
(joo + "nud")
(joo + "dud") ;
-- TS 50-52 (elama, muutuma, kirjutama), 53 (tegelema) alt forms
@@ -105,10 +105,10 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
elama
(ela + "da")
(ela + "b")
(ela + "takse")
(ela + "takse")
(ela + "ge") -- Imperative P1 Pl
(ela + "s") -- Imperfect P3 Sg
(ela + "nud")
(ela + "s") -- Imperfect P3 Sg
(ela + "nud")
(ela + "tud") ;
-- TS 53 (tegelema)
@@ -121,12 +121,12 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
tegelema
(tegel + "da")
(tegele + "b")
(tegel + "dakse")
(tegel + "dakse")
(tegel + "ge") -- Imperative P1 Pl
(tegele + "s") -- Imperfect P3 Sg
(tegel + "nud")
(tegel + "dud") ;
(tegele + "s") -- Imperfect P3 Sg
(tegel + "nud")
(tegel + "dud") ;
-- TS 54 (tulema)
-- consonant assimilation (l,r,n) in da, takse
-- d in tud, g in ge
@@ -146,7 +146,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(tul + "i")
(tul + "nud")
(tul + "dud") ;
-- TS 55-56 (õppima, sündima)
-- t in takse, tud ; consonant gradation on stem
cLeppima : (_ : Str) -> VForms = \leppima ->
@@ -154,7 +154,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
leppi = Predef.tk 2 leppima ;
i = last leppi ;
lepp = init leppi ;
lepi = (weaker lepp) + i
lepi = (weaker lepp) + i
in vForms8
leppima
(leppi + "da")
@@ -164,7 +164,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(leppi + "s") -- Imperfect P3 Sg
(leppi + "nud")
(lepi + "tud") ;
-- TS 57 (lugema)
-- Like 55-56 but irregular gradation patterns, that shouldn't be in HjkEst.weaker
--including also marssima,valssima
@@ -184,7 +184,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
_ + ("uge"|"ude") => l + "oe" ;
_ + #c + "ssi" => (init lug) + e;
_ => (weaker lug) + e
_ => (weaker lug) + e
} ;
in vForms8
lugema
@@ -195,8 +195,8 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(luge + "s") -- Imperfect P3 Sg
(luge + "nud")
(loe + "tud") ;
-- TS 58 muutma, saatma,
-- like laskma (TS 62, 64), but no reduplication of stem consonant (muutma~muuta, not *muutta)
-- like andma (TS 63) but different takse (muudetakse vs. antakse)
@@ -213,8 +213,8 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(muut + "is")
(muut + "nud")
(muud + "etud") ; -- always e?
-- TS 59-60 (petma~petetakse, jätma~jäetakse)
-- TS 59-60 (petma~petetakse, jätma~jäetakse)
-- takse given as second argument
cPetma : (_,_ : Str) -> VForms = \petma,jaetakse ->
let
@@ -251,8 +251,8 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(jatt + "is")
(jat + "nud")
(ko + "etud") ;
-}
-}
-- TS 61 (laulma)
--vowel (a/e) given with the second argument
--veenma,naerma
@@ -268,7 +268,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(kuul + "is")
(kuul + "nud")
(kuul + "dud") ;
-- TS 62 (tõusma), 64 (mõksma)
-- vowel (a/e) given with the second argument
-- doesn't give alt. forms joosta, joostes
@@ -283,9 +283,9 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(las + "takse")
(las + "ke")
(lask + "is")
(lask + "nud")
(lask + "nud")
(las + "tud") ;
-- TS 62 alt forms
cJooksma : (_ : Str) -> VForms = \jooksma ->
let
@@ -298,10 +298,10 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(joos + "takse")
(joos + "ke")
(jooks + "is")
(jooks + "nud")
(jooks + "nud")
(joos + "tud") ;
-- TS 63 (andma, murdma, hoidma)
-- TS 63 (andma, murdma, hoidma)
-- vowel given in second arg (andma~annab; tundma~tunneb)
cAndma : (_,_ : Str) -> VForms = \andma,annab ->
let
@@ -310,18 +310,18 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
ann = weaker and ; --murr, hoi
te = case (last ann) of { --to prevent teadma~teaab
"a" => init ann ;
_ => ann
_ => ann
} ;
in vForms8
andma
(and + "a")
annab
annab
(an + "takse")
(and + "ke")
(and + "is")
(and + "nud")
(an + "tud") ;
-- TS 65 (pesema)
-- a consonant stem verb in disguise
cPesema : (_ : Str) -> VForms = \pesema ->
@@ -356,9 +356,9 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
(nag + "i")
(nai + "nud")
(nah + "tud") ;
-- TS 67-68 (hüppama, tõmbama)
-- TS 67-68 (hüppama, tõmbama)
-- strong stem in ma, b, s
-- weak stem in da, takse, ge, nud, tud
-- t in da, takse; k in ge
@@ -387,7 +387,7 @@ resource MorphoEst = ResEst ** open Prelude, Predef, HjkEst in {
omb = Predef.tk 2 omble ;
omm = case omb of {
"mõt" => "mõe" ; --some "double weak" patterns; however weaker (weaker omb) makes the coverage worse
_ => weaker omb
_ => weaker omb
} ;
ommel = omm + e + l ;
in vForms8
@@ -445,22 +445,22 @@ These used to be here:
aForms2A : AForms -> Adjective = \afs -> {
s = table {
Posit => table {
AN n => (nForms2N afs.posit).s ! n ;
AN n => (nForms2N afs.posit).s ! n ;
AAdv => afs.adv_posit
} ;
Compar => table {
AN n => (nForms2N afs.compar).s ! n ;
AN n => (nForms2N afs.compar).s ! n ;
AAdv => afs.adv_compar
} ;
Superl => table {
AN n => (nForms2N afs.superl).s ! n ;
AN n => (nForms2N afs.superl).s ! n ;
AAdv => afs.adv_superl
}
} ;
lock_A = <>
} ;
nforms2aforms : NForms -> AForms = \nforms ->
nforms2aforms : NForms -> AForms = \nforms ->
let
suure = init (nforms ! 1) ;
suur = Predef.tk 4 (nforms ! 8) ;
@@ -477,7 +477,7 @@ These used to be here:
These used to be here:
VForms : Type = Predef.Ints 7 => Str ;
vForms8 : (x1,_,_,_,_,_,_,x8 : Str) -> VForms ;
vForms8 : (x1,_,_,_,_,_,_,x8 : Str) -> VForms ;
regVForms : (x1,_,_,x4 : Str) -> VForms ;
vforms2V : VForms -> Verb ;
-}
@@ -487,7 +487,7 @@ These used to be here:
-- for Structural
-----------------------
caseTable : Number -> Noun -> Case => Str = \n,cn ->
caseTable : Number -> Noun -> Case => Str = \n,cn ->
\\c => cn.s ! NCase n c ;
mkDet : Number -> Noun -> {
@@ -510,11 +510,11 @@ caseTable : Number -> Noun -> Case => Str = \n,cn ->
-- TODO: remove NPAcc?
-- I: keep NPAcc; see appCompl in ResEst, it takes care of finding a right case for various types of complements; incl. when pronouns get different treatment than nouns (PassVP).
mkPronoun : (_,_,_ : Str) -> Number -> Person ->
{s : NPForm => Str ; a : Agr} =
{s : NPForm => Str ; a : Agr} =
\mina, minu, mind, n, p ->
let {
minu_short = ie_to_i minu
} in
} in
{s = table {
NPCase Nom => mina ;
NPCase Gen => minu ;
@@ -533,7 +533,7 @@ caseTable : Number -> Noun -> Case => Str = \n,cn ->
NPAcc => mind
} ;
a = Ag n p
} ;
} ;
-- meiesse/teiesse -> meisse/teisse
ie_to_i : Str -> Str ;
@@ -543,14 +543,14 @@ caseTable : Number -> Noun -> Case => Str = \n,cn ->
_ => x
} ;
shortPronoun : (_,_,_,_ : Str) -> Number -> Person ->
{s : NPForm => Str ; a : Agr} =
shortPronoun : (_,_,_,_ : Str) -> Number -> Person ->
{s : NPForm => Str ; a : Agr} =
\ma, mu, mind, minu, n, p ->
let shortMa = mkPronoun ma mu mind n p ;
mulle : Str = case mu of {
"mu" => "mulle" ;
"mu" => "mulle" ;
"su" => "sulle" ;
_ => shortMa.s ! NPCase Allat
_ => shortMa.s ! NPCase Allat
} ;
in shortMa ** { s = table {
@@ -561,18 +561,18 @@ caseTable : Number -> Noun -> Case => Str = \n,cn ->
NPCase Comit => minu + "ga" ;
NPCase Termin => minu + "ni" ;
x => shortMa.s ! x } } ;
oper
relPron : NForm => Str =
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida")
in fixPlNom "mis" mis.s ;
relPron : NForm => Str =
let mis = nForms2N (nForms6 "mis" "mille" "mida" "millesse" "mille" "mida")
in fixPlNom "mis" mis.s ;
kesPron : NForm => Str =
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda")
let kes = nForms2N (nForms6 "kes" "kelle" "keda" "kellesse" "kelle" "keda")
in fixPlNom "kes" kes.s ;
ProperName = {s : Case => Str} ;
@@ -613,7 +613,7 @@ oper
Allat => "nendele" ;
Abess => "nendeta" ;
Comit => "nendega" ;
Termin => "nendeni"
Termin => "nendeni"
} ;
} ;

View File

@@ -7,15 +7,15 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
-- The $Number$ is subtle: "nuo autot", "nuo kolme autoa" are both plural
-- for verb agreement, but the noun form is singular in the latter.
DetCN det cn =
DetCN det cn =
let
n : Number = case det.isNum of {
True => Sg ;
_ => det.n
} ;
ncase : NPForm -> Case * NForm = \c ->
let k = npform2case n c
in
let k = npform2case n c
in
case <n, c, det.isNum, det.isDef> of {
<_, NPAcc, True,_> => <Nom,NCase Sg Part> ; -- kolm kassi (as object)
<_, NPCase Nom, True,_> => <Nom,NCase Sg Part> ; -- kolm kassi (as subject)
@@ -25,12 +25,12 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
<_, NPCase Abess, _, _> => <Gen,NCase n Abess> ; -- kolme kassita
<_, NPCase Ess, _, _> => <Gen,NCase n Ess> ; -- kolme kassina
<_, NPCase Termin,_, _> => <Gen,NCase n Termin> ; -- kolme kassini
<_, _, True,_> => <k, NCase Sg k> ; -- kolmeks kassiks (all other cases)
_ => <k, NCase n k> -- kass, kassi, ... (det is not a number)
}
in {
s = \\c => let
s = \\c => let
k = ncase c ;
in
det.s ! k.p1 ++ cn.s ! k.p2 ;
@@ -42,7 +42,7 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
isPron = False
} ;
DetNP det =
DetNP det =
let
n : Number = case det.isNum of {
True => Sg ;
@@ -50,7 +50,7 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
} ;
in {
s = \\c => let k = npform2case n c in
det.sp ! k ;
det.sp ! k ;
a = agrP3 (case det.isDef of {
False => Sg ; -- autoja menee; kolme autoa menee
_ => det.n
@@ -59,7 +59,7 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
} ;
UsePN pn = {
s = \\c => pn.s ! npform2case Sg c ;
s = \\c => pn.s ! npform2case Sg c ;
a = agrP3 Sg ;
isPron = False
} ;
@@ -72,10 +72,10 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
} ;
PPartNP np v2 =
let
let
num : Number = complNumAgr np.a ;
part : Str = v2.s ! (PastPart Pass) ;
adj : NForms = hjk_type_IVb_maakas part ;
adj : NForms = hjk_type_IVb_maakas part ;
partGen : Str = adj ! 1 ;
partEss : Str = partGen + "na"
in {
@@ -91,8 +91,8 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
} ;
DetQuantOrd quant num ord = {
s = \\c => quant.s ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
s = \\c => quant.s ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
sp = \\c => quant.sp ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
n = num.n ;
isNum = num.isNum ;
isDef = quant.isDef
@@ -135,19 +135,19 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
NumCard n = n ** {isNum = case n.n of {Sg => False ; _ => True}} ; -- üks raamat/kaks raamatut
NumDigits numeral = {
s = \\n,c => numeral.s ! NCard (NCase n c) ;
n = numeral.n
s = \\n,c => numeral.s ! NCard (NCase n c) ;
n = numeral.n
} ;
OrdDigits numeral = {s = \\nc => numeral.s ! NOrd nc} ;
NumNumeral numeral = {
s = \\n,c => numeral.s ! NCard (NCase n c) ;
s = \\n,c => numeral.s ! NCard (NCase n c) ;
n = numeral.n
} ;
OrdNumeral numeral = {s = \\nc => numeral.s ! NOrd nc} ;
AdNum adn num = {
s = \\n,c => adn.s ++ num.s ! n ! c ;
s = \\n,c => adn.s ++ num.s ! n ! c ;
n = num.n
} ;
@@ -156,17 +156,17 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
OrdSuperl a = {s = \\nc => "kõige" ++ a.s ! Compar ! AN nc} ;
DefArt = {
s = \\_,_ => [] ;
sp = table {Sg => pronSe.s ; Pl => pronNe.s} ;
s = \\_,_ => [] ;
sp = table {Sg => pronSe.s ; Pl => pronNe.s} ;
isNum = False ;
isDef = True -- autot ovat
} ;
IndefArt = {
s = \\_,_ => [] ; --use isDef in DetCN
sp = \\n,c =>
(nForms2N (nForms6 "üks" "ühe" "üht" "ühesse" "ühtede"
"ühtesid")).s ! NCase n c ;
sp = \\n,c =>
(nForms2N (nForms6 "üks" "ühe" "üht" "ühesse" "ühtede"
"ühtesid")).s ! NCase n c ;
isNum,isDef = False -- autoja on
} ;
@@ -176,7 +176,7 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
ncase : Case -> NForm = \c -> NCase n c ;
in {
s = \\c => let k = npform2case n c in
cn.s ! ncase k ;
cn.s ! ncase k ;
a = agrP3 Sg ;
isPron = False
} ;
@@ -209,21 +209,21 @@ concrete NounEst of Noun = CatEst ** open ResEst, HjkEst, MorphoEst, Prelude in
AdjCN ap cn = {
s = \\nf =>
s = \\nf =>
case ap.infl of {
(Invariable|Participle) => ap.s ! True ! (NCase Sg Nom) ++ cn.s ! nf ; --valmis kassile; väsinud kassile
Regular => case nf of {
NCase num (Ess|Abess|Comit|Termin) => ap.s ! True ! (NCase num Gen) ++ cn.s ! nf ; --suure kassiga, not *suurega kassiga
Invariable|Participle => ap.s ! True ! NCase Sg Nom ++ cn.s ! nf ; --valmis kassile; väsinud kassile
Regular => case nf of {
NCase num (Ess|Abess|Comit|Termin) => ap.s ! True ! NCase num Gen ++ cn.s ! nf ; --suure kassiga, not *suurega kassiga
_ => ap.s ! True ! nf ++ cn.s ! nf
}
}
}
}
} ;
RelCN cn rs = {s = \\nf => cn.s ! nf ++ rs.s ! agrP3 (numN nf)} ;
RelNP np rs = {
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
a = np.a ;
s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ;
a = np.a ;
isPron = np.isPron ---- correct ?
} ;

View File

@@ -2,12 +2,12 @@
--
-- Based on the Finnish Lexical Paradigms by Aarne Ranta 2003--2008
--
-- This is an API to the user of the resource grammar
-- This is an API to the user of the resource grammar
-- for adding lexical items. It gives functions for forming
-- expressions of open categories: nouns, adjectives, verbs.
--
--
-- Closed categories (determiners, pronouns, conjunctions) are
-- accessed through the resource syntax API and $Structural.gf$.
-- accessed through the resource syntax API and $Structural.gf$.
--
-- The main difference with $MorphoEst.gf$ is that the types
-- referred to are compiled resource grammar types. We have moreover
@@ -23,9 +23,9 @@
-- @author Kaarel Kaljurand
-- @version 2013-10-21
resource ParadigmsEst = open
(Predef=Predef),
Prelude,
resource ParadigmsEst = open
(Predef=Predef),
Prelude,
MorphoEst,
HjkEst,
CatEst
@@ -33,9 +33,9 @@ resource ParadigmsEst = open
flags optimize=noexpand ; coding=utf8;
--2 Parameters
--2 Parameters
--
-- To abstract over gender, number, and (some) case names,
-- To abstract over gender, number, and (some) case names,
-- we define the following identifiers. The application programmer
-- should always use these constants instead of the constructors
-- defined in $ResEst$.
@@ -83,15 +83,15 @@ oper
--2 Conjunctions, adverbs
mkAdv : Str -> Adv ;
mkAdV : Str -> AdV ;
mkAdN : Str -> AdN ;
mkAdA : Str -> AdA ;
mkAdv : Str -> Adv ;
mkAdV : Str -> AdV ;
mkAdN : Str -> AdN ;
mkAdA : Str -> AdA ;
mkConj : overload {
mkConj : Str -> Conj ; -- just one word, default number Sg: e.g. "ja"
mkConj : Str -> Number -> Conj ; --just one word + number: e.g. "ja" Pl
mkConj : Str -> Str -> Conj ; --two words, default number: e.g. "nii" "kui"
mkConj : Str -> Str -> Conj ; --two words, default number: e.g. "nii" "kui"
mkConj : Str -> Str -> Number -> Conj ; --two words + number: e.g. "nii" "kui" Pl
} ;
@@ -139,7 +139,7 @@ oper
-- Non-comparison one-place adjectives are just like nouns.
-- The regular adjectives are based on $regN$ in the positive.
-- Comparison adjectives have three forms.
-- Comparison adjectives have three forms.
-- The comparative and the superlative
-- are always inflected in the same way, so the nominative of them is actually
-- enough (TODO: confirm).
@@ -156,7 +156,7 @@ oper
mkA2 : A -> Prep -> A2 -- e.g. "vihane" (postGenPrep "peale")
= \a,p -> a ** {c2 = p ; lock_A2 = <>};
invA : Str -> A ; -- invariable adjectives, such as genitive attributes ; no agreement to head, no comparison forms.
invA : Str -> A ; -- invariable adjectives, such as genitive attributes ; no agreement to head, no comparison forms.
--2 Verbs
--
@@ -237,8 +237,8 @@ oper
mkV2V : V -> Prep -> V2V ; -- e.g. "käskima" adessive
mkV2V : Str -> V2V ; -- e.g. "käskima" adessive
} ;
mkV2Vf : V -> Prep -> InfForm -> V2V ; -- e.g. "keelama" partitive infMast
mkV2Vf : V -> Prep -> InfForm -> V2V ; -- e.g. "keelama" partitive infMast
mkVA : overload {
mkVA : V -> Prep -> VA ; -- e.g. "muutuma" translative
mkVA : Str -> VA ; -- string, default case translative
@@ -248,21 +248,21 @@ oper
mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. "värvima" genitive translative
mkV2A : Str -> V2A ; -- string, default cases genitive and translative
} ;
mkVQ : overload {
mkVQ : V -> VQ ;
mkVQ : Str -> VQ ;
mkVQ : V -> VQ ;
mkVQ : Str -> VQ ;
} ;
mkV2Q : V -> Prep -> V2Q ; -- e.g. "küsima" ablative
mkV2Q : V -> Prep -> V2Q ; -- e.g. "küsima" ablative
mkAS : A -> AS ; --%
mkA2S : A -> Prep -> A2S ; --%
mkAV : A -> AV ; --%
mkA2V : A -> Prep -> A2V ; --%
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
-- Notice: categories $AS, A2S, AV, A2V$ are just $A$,
-- and the second argument is given
-- as an adverb. Likewise
-- as an adverb. Likewise
-- $V0$ is just $V$.
V0 : Type ; --%
@@ -290,13 +290,13 @@ oper
translative = Transl ;
terminative = Termin ;
essive = Ess ;
abessive = Abess ;
abessive = Abess ;
comitative = Comit ;
infDa = InfDa ; infMa = InfMa ; infMast = InfMast ;
infDes = InfDes ; infMas = InfMas ; infMaks = InfMaks ; infMata = InfMata ;
prePrep : Case -> Str -> Prep =
prePrep : Case -> Str -> Prep =
\c,p -> {c = NPCase c ; s = p ; isPre = True ; lock_Prep = <>} ;
postPrep : Case -> Str -> Prep =
\c,p -> {c = NPCase c ; s = p ; isPre = False ; lock_Prep = <>} ;
@@ -313,7 +313,7 @@ oper
mkAdA : Str -> AdA = \str -> {s = str ; lock_AdA = <>} ;
mkConj = overload {
mkConj : Str -> Conj = \ja -> lin Conj ((sd2 "" ja) ** {n = Sg}) ;
mkConj : Str -> Number -> Conj = \ja,num -> lin Conj ((sd2 "" ja) ** {n = num}) ;
@@ -335,12 +335,12 @@ oper
} ;
-- Adjective forms (incl. comp and sup) are derived from noun forms
mk1A : Str -> A = \suur ->
let aforms = aForms2A (nforms2aforms (hjk_type suur))
mk1A : Str -> A = \suur ->
let aforms = aForms2A (nforms2aforms (hjk_type suur))
in aforms ** {infl = Regular } ;
mkNA : N -> A = \suur ->
let aforms = aForms2A (nforms2aforms (n2nforms suur)) ;
mkNA : N -> A = \suur ->
let aforms = aForms2A (nforms2aforms (n2nforms suur)) ;
in aforms ** {infl = Regular } ;
@@ -348,28 +348,28 @@ oper
-- mk2N, mk3N, mk4N make sure that the user specified forms end up in the paradigm,
-- even though the rest is wrong
mk2N : (link,lingi : Str) -> N = \link,lingi ->
let nfs : NForms = (nForms2 link lingi) ;
mk2N : (link,lingi : Str) -> N = \link,lingi ->
let nfs : NForms = (nForms2 link lingi) ;
nfs_fixed : NForms = table {
0 => link ;
1 => lingi ;
2 => nfs ! 2 ;
3 => nfs ! 3 ;
4 => nfs ! 4 ;
5 => nfs ! 5
5 => nfs ! 5
} ;
in nForms2N nfs_fixed ** {lock_N = <> } ;
mk3N : (tukk,tuku,tukku : Str) -> N = \tukk,tuku,tukku ->
let nfs : NForms = (nForms3 tukk tuku tukku) ;
mk3N : (tukk,tuku,tukku : Str) -> N = \tukk,tuku,tukku ->
let nfs : NForms = (nForms3 tukk tuku tukku) ;
nfs_fixed : NForms = table {
0 => tukk ;
1 => tuku ;
2 => tukku ;
3 => nfs ! 3 ;
4 => nfs ! 4 ;
5 => nfs ! 5
5 => nfs ! 5
} ;
in nForms2N nfs_fixed ** {lock_N = <> } ;
@@ -381,7 +381,7 @@ oper
1 => paadi ;
2 => paati ;
3 => nfs ! 3 ;
4 => nfs ! 4 ;
4 => nfs ! 4 ;
5 => paate
} ;
in nForms2N nfs_fixed ** {lock_N = <> } ;
@@ -510,7 +510,7 @@ oper
-- voolik/vooliku/voolikut
<_ + #c, _ + #v, _ + #v + "t"> => hjk_type_IVb_audit tukk u ;
_ => nForms2 tukk tuku
_ => nForms2 tukk tuku
} ;
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paate ->
@@ -518,33 +518,33 @@ oper
-- distinguish between joonis and segadus
<_ +("ne"|"s"), _+"se", _+"st", _+"seid"> => hjk_type_Va_otsene paat ;
<_ +("ne"|"s"), _+"se", _+"st", _+"si"> => hjk_type_Vb_oluline paat ;
<_ +"ne", _+"se", _+"set", _+"seid"> => nForms3 paat paadi paati ; -- -ne adjectives ('algne') are not like 'tõuge'
--distinguish between kõne and aine
<_ +"e", _+"e", _+"et", _+"sid"> => hjk_type_III_ratsu paat ;
<_ +"e", _+"e", _+"et", _+"sid"> => hjk_type_III_ratsu paat ;
<_ +"e", _+"e", _+"et", _+"eid"> => hjk_type_VII_touge2 paat paadi ;
_ => nForms3 paat paadi paati
_ => nForms3 paat paadi paati
} ;
{-
--Version that uses pl gen instead of pl part
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paatide ->
nForms4 : (_,_,_,_ : Str) -> NForms = \paat,paadi,paati,paatide ->
case <paat,paadi,paati,paatide> of {
-- pl gen can't distinguish between joonis and segadus
-- <_ +("ne"|"s"), _+"se", _+"st", _+"seid"> => hjk_type_Va_otsene paat ;
-- <_ +("ne"|"s"), _+"se", _+"st", _+"si"> => hjk_type_Vb_oluline paat ;
--pl gen can distinguish between kõne and aine
--plus side that any noun that is formed with 4-arg,
--the user given forms are inserted to the paradigm,
--the user given forms are inserted to the paradigm,
--and more forms are created from pl gen, none from pl part
<_ +"e", _+"e", _+"et", _+"de"> => hjk_type_III_ratsu paat ;
<_ +"e", _+"e", _+"et", _+"de"> => hjk_type_III_ratsu paat ;
<_ +"e", _+"e", _+"et", _+"te"> => hjk_type_VII_touge2 paat paadi ;
_ => nForms3 paat paadi paati
} ;
_ => nForms3 paat paadi paati
} ;
-}
mkN2 = overload {
@@ -553,12 +553,12 @@ oper
} ;
mmkN2 : N -> Prep -> N2 = \n,c -> n ** {c2 = c ; isPre = mkIsPre c ; lock_N2 = <>} ;
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ;
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ;
isPre = mkIsPre c ; -- matka Londonist Pariisi
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
lock_N3 = <>
} ;
mkIsPre : Prep -> Bool = \p -> case p.c of {
NPCase Gen => notB p.isPre ; -- Jussin veli (prep is <Gen,"",True>, isPre becomes False)
_ => True -- syyte Jussia vastaan, puhe Jussin puolesta
@@ -588,7 +588,7 @@ oper
mkA_1 : Str -> A = \x -> noun2adjDeg (mk1N x) ** {infl = Regular ; lock_A = <>} ;
-- auxiliaries
mkAdjective : (_,_,_ : Adj) -> A = \hea,parem,parim ->
mkAdjective : (_,_,_ : Adj) -> A = \hea,parem,parim ->
{s = table {
Posit => hea.s ;
Compar => parem.s ;
@@ -601,8 +601,8 @@ oper
-- Adjectives whose comparison forms are explicitly given.
-- The inflection of these forms with the audit-rule always works.
regAdjective : Noun -> Str -> Str -> A = \posit,compar,superl ->
mkAdjective
(noun2adj posit)
mkAdjective
(noun2adj posit)
(noun2adjComp False (nForms2N (hjk_type_IVb_audit compar "a")))
(noun2adjComp False (nForms2N (hjk_type_IVb_audit superl "a"))) ;
@@ -637,31 +637,31 @@ oper
mkV : (aru : Str) -> (saama : V) -> V = mkPV ; -- particle verbs
} ;
mk1V : Str -> V = \s ->
let vfs = vforms2V (vForms1 s) in
mk1V : Str -> V = \s ->
let vfs = vforms2V (vForms1 s) in
vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mk2V : (_,_ : Str) -> V = \x,y ->
let
vfs = vforms2V (vForms2 x y)
mk2V : (_,_ : Str) -> V = \x,y ->
let
vfs = vforms2V (vForms2 x y)
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mk3V : (_,_,_ : Str) -> V = \x,y,z ->
let
vfs = vforms2V (vForms3 x y z)
mk3V : (_,_,_ : Str) -> V = \x,y,z ->
let
vfs = vforms2V (vForms3 x y z)
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mk4V : (x1,_,_,x4 : Str) -> V = \a,b,c,d ->
let
mk4V : (x1,_,_,x4 : Str) -> V = \a,b,c,d ->
let
vfs = vforms2V (vForms4 a b c d)
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mk8V : (x1,_,_,_,_,_,_,x8 : Str) -> V = \a,b,c,d,e,f,g,h ->
mk8V : (x1,_,_,_,_,_,_,x8 : Str) -> V = \a,b,c,d,e,f,g,h ->
let
vfs = vforms2V (vForms8 a b c d e f g h)
in vfs ** {sc = NPCase Nom ; lock_V = <>} ;
mkPV : (aru : Str) -> (saama : V) -> V = \aru,saama ->
{s = saama.s ; p = aru ; sc = saama.sc ; lock_V = <> } ;
-- This used to be the last case: _ => Predef.error (["expected infinitive, found"] ++ ottaa)
-- regexp example: ("" | ?) + ("a" | "e" | "i") + _ + "aa" =>
-- This used to be the last case: _ => Predef.error (["expected infinitive, found"] ++ ottaa)
-- regexp example: ("" | ?) + ("a" | "e" | "i") + _ + "aa" =>
vForms1 : Str -> VForms = \lugema ->
let
luge = Predef.tk 2 lugema ;
@@ -672,7 +672,7 @@ oper
-- Small class of CVVma
? + ("ä"|"õ"|"i") + "ima" =>
cKaima lugema ; --käima,viima,võima
? + ("aa"|"ee"|"ää") + "ma" =>
? + ("aa"|"ee"|"ää") + "ma" =>
cSaama lugema ; -- saama,jääma,keema
? + ("oo"|"öö"|"üü") + "ma" =>
cJooma lugema ; --jooma,looma,lööma,müüma,pooma,sööma,tooma
@@ -680,30 +680,30 @@ oper
-- TS 53
_ + #c + #v + "elema" =>
cTegelema lugema ; --not aelema
-- TS 54
-- Small class, just list all members
("tule"|"sure"|"pane") + "ma" =>
cTulema lugema ;
-- TS 55-57
-- Consonant gradation
-- Regular (55-56)'leppima' and irregular (57) 'lugema'
-- For reliable results regarding consonant gradation, use mk3V
_ + "ndima" =>
cLeppima lugema ;
_ + #lmnr + ("k"|"p"|"t"|"b") + ("ima"|"uma") =>
_ + #lmnr + ("k"|"p"|"t"|"b") + ("ima"|"uma") =>
cLeppima lugema ;
_ + ("sk"|"ps"|"ks"|"ts"|"pl") + ("ima") => --|"uma") =>
_ + ("sk"|"ps"|"ks"|"ts"|"pl") + ("ima") => --|"uma") =>
cLeppima lugema ;
_ + ("hk"|"hm"|"hn"|"hr"|"ht") + ("ima") => --most *hCuma are TS 51 (muutuma)
_ + ("hk"|"hm"|"hn"|"hr"|"ht") + ("ima") => --most *hCuma are TS 51 (muutuma)
cLeppima lugema ;
_ + #c + "ssima" => --weaker *ss = *ss; should be weaker Css = Cs
cLugema lugema ;
_ + ("pp"|"kk"|"tt"|"ss"|"ff"|"nn"|"mm"|"ll"|"rr") + ("ima"|"uma") =>
_ + ("pp"|"kk"|"tt"|"ss"|"ff"|"nn"|"mm"|"ll"|"rr") + ("ima"|"uma") =>
cLeppima lugema ;
-- TS 59 (petma, tapma)
-- TS 59 (petma, tapma)
-- Use mk4V for TS 60 (jätma, võtma)
? + #v + ("tma"|"pma") =>
cPetma lugema (luge + "etakse") ;
@@ -714,31 +714,31 @@ oper
-- TS 61 (laulma,kuulma,naerma,möönma)
-- Default vowel e for lma, a for (r|n)ma.
-- Other vowel with mk3V.
_ + "lma" =>
cKuulma lugema (loe + "eb") ;
_ + "lma" =>
cKuulma lugema (loe + "eb") ;
_ + ("r"|"n") + "ma" =>
cKuulma lugema (loe + "ab") ;
-- TS 63 (andma,hoidma)
-- Other vowel than a (tundma~tunneb) with mk3V
_ + "dma" =>
cAndma lugema (loe + "ab") ;
-- TS 62, 64 (tõusma,mõskma), default vowel e
-- 62 alt form (jooksma,joosta) with mk2V
-- Other vowel than e with mk3V
_ + #c + "ma" =>
_ + #c + "ma" =>
cLaskma lugema (loe + "eb") ;
-- TS 65 (pesema)
#c + #v + "sema" =>
cPesema lugema ;
-- TS 66 (nägema)
-- Small class, just list all members
("nägema"|"tegema") =>
cNagema lugema ;
-- TS 67-68 with mk2V
-- no 100% way to distinguish from 50-52 that end in ama
@@ -754,7 +754,7 @@ oper
-- Default case
_ =>
cElama lugema
} ;
} ;
vForms2 : (_,_ : Str) -> VForms = \petma,petta ->
-- Arguments: ma infinitive, da infinitive
@@ -781,22 +781,22 @@ oper
-- * Non-detectable gradation (sattuma~satub ; pettuma~pettub)
-- * Non-default vowel in b for TS 58-64 (laulma~laulab)
case <taguma,taguda,taob> of {
--to be sure about vowel in b
<_ + "dma", _ + "da", _> => cAndma taguma taob ;
<_, _ + #vv + #lmnr + "da", _> => cKuulma taguma taob ;
<_, _ + #c + "ta", _> => cLaskma taguma taob ;
<_, _ + #c + "ta", _> => cLaskma taguma taob ;
--irregular gradation
<_, _, (""|#c) + #c + #v + #v + "b"> => cLugema taguma ; --57
--to be sure about consonant gradation
<_ + #c + "lema", _, _> => vForms2 taguma taguda ; --catch "-Clema" first
<_ + #v + "ma", _+"da", _> => cSattumaPettuma taguma taob ;
<_ + #v + "ma", _+"da", _> => cSattumaPettuma taguma taob ;
<_,_,_> => vForms2 taguma taguda
<_,_,_> => vForms2 taguma taguda
} ;
vForms4 : (x1,_,_,x4 : Str) -> VForms = \jatma,jatta,jatab,jaetakse ->
-- 4 forms needed to get full paradigm for regular verbs
-- (source: http://www.eki.ee/books/ekk09/index.php?p=3&p1=5&id=227)
@@ -804,7 +804,7 @@ oper
-- Filter out known irregularities and give rest to regVForms.
-- Not trying to match TS 49 ; can't separate käima (49) from täima (50), or detect compounds like taaslooma.
case <jatma,jatta,jatab,jaetakse> of {
<_, _+("kka"|"ppa"|"tta"),
<_, _+("kka"|"ppa"|"tta"),
_, _+"takse"> => cPetma jatma jaetakse ;
<_ + "dma", _,
_, _+"takse"> => cAndma jatma jatab ;
@@ -813,15 +813,15 @@ oper
<_, _ + "ha", _, _> => cNagema jatma ;
<_ + #v + "sema", _ + "sta", _, _> => cPesema jatma ;
<_,_,_,_> => regVForms jatma jatta jatab jaetakse
} ;
} ;
caseV c v = {s = v.s ; p = v.p; sc = NPCase c ; lock_V = <>} ;
vOlema = verbOlema ** {sc = NPCase Nom ; lock_V = <>} ;
vMinema = verbMinema ** {sc = NPCase Nom ; lock_V = <>} ;
mk2V2 : V -> Prep -> V2 = \v,c -> v ** {c2 = c ; lock_V2 = <>} ;
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;
caseV2 : V -> Case -> V2 = \v,c -> mk2V2 v (casePrep c) ;
dirV2 v = mk2V2 v accPrep ;
@@ -837,13 +837,13 @@ oper
dirV2 : V -> V2 ;
mkV3 = overload {
mkV3 : V -> Prep -> Prep -> V3 = \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
mkV2 : V -> V3 = \v -> v ** {c2 = accPrep ;
c3 = (casePrep allative) ;
lock_V3 = <>} ;
mkV2 : Str -> V3 = \str -> (mkV str) ** {c2 = accPrep ;
c3 = (casePrep allative) ;
lock_V3 = <>} ;
mkV3 : V -> Prep -> Prep -> V3 = \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
mkV2 : V -> V3 = \v -> v ** {c2 = accPrep ;
c3 = (casePrep allative) ;
lock_V3 = <>} ;
mkV2 : Str -> V3 = \str -> (mkV str) ** {c2 = accPrep ;
c3 = (casePrep allative) ;
lock_V3 = <>} ;
} ;
dirV3 v p = mkV3 v accPrep (casePrep p) ;
dirdirV3 v = dirV3 v allative ;
@@ -855,7 +855,7 @@ oper
mkVV = overload {
mkVV : V -> VV = \v -> mkVVf v infDa ;
mkVV : Str -> VV = \str -> mkVVf (mkV str) infDa ;
} ;
} ;
mkVVf v f = v ** {vi = f ; lock_VV = <>} ;
mkVQ = overload {
mkVQ : V -> VQ = \v -> v ** {lock_VQ = <>} ;
@@ -876,7 +876,7 @@ oper
mkV2V : V -> Prep -> V2V = \v,p -> mkV2Vf v p infMa ;
mkV2V : V -> V2V = \v -> mkV2Vf v (casePrep genitive) infMa ;
mkV2V : Str -> V2V = \str -> mkV2Vf (mkV str) (casePrep genitive) infMa ;
} ;
} ;
mkV2Vf v p f = mk2V2 v p ** {vi = f ; lock_V2V = <>} ;
mkVA = overload {
@@ -885,13 +885,13 @@ oper
mkVA : Str -> VA = \str -> (mkV str) ** {c2 = casePrep translative ; lock_VA = <>} ;
} ;
mkV2A = overload {
mkV2A = overload {
mkV2A : V -> Prep -> Prep -> V2A = \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V2A = <>} ;
mkV2A : V -> V2A = \v -> v ** {c2 = casePrep genitive ;
c3 = casePrep translative ;
mkV2A : V -> V2A = \v -> v ** {c2 = casePrep genitive ;
c3 = casePrep translative ;
lock_V2A = <>} ;
mkV2A : Str -> V2A = \str -> (mkV str) ** {c2 = casePrep genitive ;
c3 = casePrep translative ;
mkV2A : Str -> V2A = \str -> (mkV str) ** {c2 = casePrep genitive ;
c3 = casePrep translative ;
lock_V2A = <>} ;
} ;

View File

@@ -8,16 +8,16 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
s = \\t,a,p => cl.s ! t ! a ! p ! SQuest
} ;
QuestVP ip vp =
let
QuestVP ip vp =
let
cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) vp.sc) (agrP3 ip.n) vp
in {
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
} ;
QuestSlash ip slash = {
s = \\t,a,p =>
let
s = \\t,a,p =>
let
cls = slash.s ! t ! a ! p ;
who = appCompl True p slash.c2 (ip ** {a = agrP3 ip.n ; isPron = False})
in
@@ -29,15 +29,15 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
} ;
QuestIComp icomp np = {
s = \\t,a,p =>
let
s = \\t,a,p =>
let
vp = predV (verbOlema ** {sc = NPCase Nom}) ;
cl = mkClause (subjForm np vp.sc) np.a vp ;
in
icomp.s ! np.a ++ cl.s ! t ! a ! p ! SDecl
} ;
PrepIP p ip = {s =
PrepIP p ip = {s =
appCompl True Pos p (ip ** {a = agrP3 ip.n ; isPron = False})} ;
AdvIP ip adv = {
@@ -46,15 +46,15 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
} ;
-- The computation of $ncase$ is a special case of that in $NounEst.DetCN$,
-- since we don't have possessive suffixes or definiteness.
-- since we don't have possessive suffixes or definiteness.
--- It could still be nice to have a common oper...
IdetCN idet cn = let n = idet.n in {
s = \\c =>
let
s = \\c =>
let
k : Case = npform2case n c ;
icase : Case = Nom ; --case k of { --mis kassiga
-- (Ess|Abess|Comit|Termin) => Gen ;
-- (Ess|Abess|Comit|Termin) => Gen ;
-- _ => k
-- } ;
ncase : NForm = case <icase,idet.isNum> of {
@@ -63,33 +63,33 @@ concrete QuestionEst of Question = CatEst ** open ResEst, Prelude in {
_ => NCase n k -- mitkä kytkimet
}
in
idet.s ! icase ++ cn.s ! ncase ;
idet.s ! icase ++ cn.s ! ncase ;
n = n
} ;
IdetIP idet = let n = idet.n in {
s = \\c =>
let
s = \\c =>
let
k = npform2case n c ;
in
idet.s ! k ;
idet.s ! k ;
n = n
} ;
IdetQuant idet num =
let
IdetQuant idet num =
let
n = num.n ;
isn = num.isNum
isn = num.isNum
in {
s = \\k =>
let
s = \\k =>
let
ncase = case <k,isn> of {
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
<_, True> => NCase Sg k ; -- miksi kolmeksi kytkimeksi
_ => NCase n k -- mitkä kytkimet
}
in
idet.s ! n ! k ++ num.s ! Sg ! k ;
idet.s ! n ! k ++ num.s ! Sg ! k ;
n = n ;
isNum = isn
} ;

View File

@@ -11,14 +11,14 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
} ;
RelVP rp vp = {
s = \\t,ant,b,ag =>
let
s = \\t,ant,b,ag =>
let
agr = case rp.a of {
RNoAg => ag ;
RAg a => a
} ;
cl = mkClause
(subjForm {s = rp.s ! (complNumAgr agr) ;
cl = mkClause
(subjForm {s = rp.s ! (complNumAgr agr) ;
a = agr ; isPron = False} vp.sc) agr vp
in
cl.s ! t ! ant ! b ! SDecl ;
@@ -26,8 +26,8 @@ concrete RelativeEst of Relative = CatEst ** open Prelude, ResEst, MorphoEst in
} ;
RelSlash rp slash = {
s = \\t,a,p,ag =>
let
s = \\t,a,p,ag =>
let
cls = slash.s ! t ! a ! p ;
who = appCompl True p slash.c2 (rp2np (complNumAgr ag) rp)
in

View File

@@ -15,11 +15,11 @@ resource ResEst = ParamX ** open Prelude in {
-- This is the $Case$ as needed for both nouns and $NP$s.
param
Case = Nom | Gen | Part
| Illat | Iness | Elat | Allat | Adess | Ablat
Case = Nom | Gen | Part
| Illat | Iness | Elat | Allat | Adess | Ablat
| Transl | Ess | Termin | Abess | Comit;
NForm = NCase Number Case ;
NForm = NCase Number Case ;
-- Agreement of $NP$ has number*person and the polite second ("te olette valmis").
@@ -56,13 +56,13 @@ oper
--2 Noun phrases
--
-- Two forms of *virtual accusative* are needed for nouns in singular,
-- the nominative and the genitive one ("loen raamatu"/"loe raamat").
-- For nouns in plural, only a nominative accusative exists in positive clauses.
-- Two forms of *virtual accusative* are needed for nouns in singular,
-- the nominative and the genitive one ("loen raamatu"/"loe raamat").
-- For nouns in plural, only a nominative accusative exists in positive clauses.
-- Pronouns use the partitive as their accusative form ("mind", "sind"), in both
-- positive and negative, indicative and imperative clauses.
param
param
NPForm = NPCase Case | NPAcc ;
oper
@@ -80,14 +80,14 @@ oper
-- A special form is needed for the negated plural imperative.
param
VForm =
VForm =
Inf InfForm
| Presn Number Person
| Impf Number Person
| Condit Number Person
| ConditPass --loetagu
| Imper Number
| ImperP3
| ImperP3
| ImperP1Pl
| ImperPass
| PassPresn Bool
@@ -98,11 +98,11 @@ param
;
Voice = Act | Pass ;
InfForm =
InfDa -- lugeda
| InfDes -- lugedes
| InfMa -- lugema
| InfDes -- lugedes
| InfMa -- lugema
| InfMas -- lugemas
| InfMast -- lugemast
| InfMata -- lugemata
@@ -112,7 +112,7 @@ param
SType = SDecl | SQuest | SInv ;
--2 For $Relative$
RAgr = RNoAg | RAg Agr ;
--2 For $Numeral$
@@ -122,14 +122,14 @@ param
--2 Transformations between parameter types
oper
agrP3 : Number -> Agr = \n ->
agrP3 : Number -> Agr = \n ->
Ag n P3 ;
conjAgr : Agr -> Agr -> Agr = \a,b -> case <a,b> of {
<Ag n p, Ag m q> => Ag (conjNumber n m) (conjPerson p q) ;
<Ag n p, AgPol> => Ag Pl (conjPerson p P2) ;
<AgPol, Ag n p> => Ag Pl (conjPerson p P2) ;
_ => b
_ => b
} ;
---
@@ -178,33 +178,33 @@ param
param
VIForm =
VIFin Tense
VIFin Tense
| VIInf InfForm
| VIPass Tense
| VIPresPart
| VIImper
;
| VIPresPart
| VIImper
;
oper
VP : Type = {
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
s2 : Bool => Polarity => Agr => Str ; -- raamat/raamatu/raamatut
adv : Str ;
p : Str ; --uninflecting component in multi-word verbs
ext : Str ;
sc : NPForm ;
} ;
predV : (Verb ** {sc : NPForm}) -> VP = \verb -> {
s = \\vi,ant,b,agr0 =>
s = \\vi,ant,b,agr0 =>
let
agr = verbAgr agr0 ;
verbs = verb.s ;
part : Str = case vi of {
VIPass _ => verbs ! (PastPart Pass) ;
VIPass _ => verbs ! (PastPart Pass) ;
_ => verbs ! (PastPart Act)
} ;
} ;
einegole : Str * Str * Str = case <vi,agr.n> of {
<VIFin Pres> => <"ei", verbs ! Imper Sg, "ole"> ;
<VIFin Fut> => <"ei", verbs ! Imper Sg, "ole"> ;
@@ -217,23 +217,23 @@ oper
<VIPass Cond> => <"ei", verbs ! ConditPass, "oleks"> ; --# notpresent
<VIPass Past> => <"ei", verbs ! PassImpf False, "olnud"> ; --# notpresent
<VIPresPart> => <"ei", verbs ! PresPart Act, "olev"> ; --# notpresent
<VIInf i> => <"ei", verbs ! Inf i, verbOlema.s ! Inf i>
<VIInf i> => <"ei", verbs ! Inf i, verbOlema.s ! Inf i>
} ;
ei : Str = einegole.p1 ;
neg : Str = einegole.p2 ;
ole : Str = einegole.p3 ;
olema : VForm => Str = verbOlema.s ;
vf : Str -> Str -> {fin, inf : Str} = \x,y -> {fin = x ; inf = y} ;
mkvf : VForm -> {fin, inf : Str} = \p -> case <ant,b> of {
<Simul,Pos> => vf (verbs ! p) [] ;
<Anter,Pos> => vf (olema ! p) part ;
<Anter,Pos> => vf (olema ! p) part ;
<Simul,Neg> => vf (ei ++ neg) [] ;
<Anter,Neg> => vf (ei ++ ole) part
<Anter,Neg> => vf (ei ++ ole) part
} ;
passPol = case b of {Pos => True ; Neg => False} ;
@@ -256,19 +256,19 @@ oper
adv = [] ;
ext = [] ; --relative clause
p = verb.p ; --particle verbs
sc = verb.sc
sc = verb.sc
} ;
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
vp ** { s2 = \\fin,b,a => vp.s2 ! fin ! b ! a ++ obj ! fin ! b ! a } ;
insertObjPre : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
insertObjPre : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp ->
vp ** { s2 = \\fin,b,a => obj ! fin ! b ! a ++ vp.s2 ! fin ! b ! a } ;
insertAdv : Str -> VP -> VP = \adv,vp ->
insertAdv : Str -> VP -> VP = \adv,vp ->
vp ** { adv = vp.adv ++ adv } ;
insertExtrapos : Str -> VP -> VP = \obj,vp ->
insertExtrapos : Str -> VP -> VP = \obj,vp ->
vp ** { ext = vp.ext ++ obj } ;
-- For $Sentence$.
@@ -286,12 +286,12 @@ oper
-- declarative sentence with the yes/no-queryword "kas".
-- SQuest: "kas" + SDecl
-- It would be also correct to use the Finnish structure, just without the ko-particle.
-- Inari: added a third SType, SInv.
-- Inari: added a third SType, SInv.
-- Not sure if SInv is needed, but keeping it for possible future use.
-- There's need for an inverted word order with auxiliary verbs; infVP handles that. ComplVV calls infVP, which inverts the word order for the complement VP, and puts it into the resulting VP's `compl' field.
-- SInv made by mkClause would be for cases where you just need to construct an inverted word order, and then call it from some other place; application grammar (TODO: api oper for SType) or ExtraEst.
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
{ s = \\t,a,b =>
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
{ s = \\t,a,b =>
let
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
-- saan sinust aru 0
@@ -300,51 +300,51 @@ oper
-- [sind näha] 0 tahtnud
-- täna olen ma sinust aru saanud
invCl = c.adv ++ c.fin ++ c.subj ++ c.compl ++ c.p ++ c.inf ++ c.ext
in
in
table {
SDecl => declCl ;
SQuest => "kas" ++ declCl ;
SInv => invCl
SInv => invCl
}
} ;
existClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
{ s = \\t,a,b =>
existClause : (Polarity -> Str) -> Agr -> VP -> Clause = \sub,agr,vp ->
{ s = \\t,a,b =>
let
c = (mkClausePlus sub agr vp).s ! t ! a ! b ;
-- (mis) on olnud olemas (lammas)
declCl = c.subj ++ c.fin ++ c.inf ++ c.compl ;
in
in
table {
SQuest => "kas" ++ declCl ;
_ => declCl
_ => declCl
}
} ;
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
\sub,agr,vp -> {
s = \\t,a,b =>
let
s = \\t,a,b =>
let
agrfin = case vp.sc of {
NPCase Nom => <agr,True> ;
_ => <agrP3 Sg,False> -- minule meeldib, minul on
} ;
verb = vp.s ! VIFin t ! a ! b ! agrfin.p1 ;
in {subj = sub b ;
fin = verb.fin ;
inf = verb.inf ;
in {subj = sub b ;
fin = verb.fin ;
inf = verb.inf ;
compl = vp.s2 ! agrfin.p2 ! b ! agr ;
p = vp.p ;
adv = vp.adv ;
ext = vp.ext ;
adv = vp.adv ;
ext = vp.ext ;
}
} ;
insertKinClausePlus : Predef.Ints 1 -> ClausePlus -> ClausePlus = \p,cl -> {
insertKinClausePlus : Predef.Ints 1 -> ClausePlus -> ClausePlus = \p,cl -> {
s = \\t,a,b =>
let
c = cl.s ! t ! a ! b
let
c = cl.s ! t ! a ! b
in
case p of {
0 => {subj = c.subj ++ gi ; fin = c.fin ; inf = c.inf ; -- Jussikin nukkuu
@@ -354,37 +354,37 @@ oper
}
} ;
insertObjClausePlus : Predef.Ints 1 -> Bool -> (Polarity => Str) -> ClausePlus -> ClausePlus =
\p,ifKin,obj,cl -> {
insertObjClausePlus : Predef.Ints 1 -> Bool -> (Polarity => Str) -> ClausePlus -> ClausePlus =
\p,ifKin,obj,cl -> {
s = \\t,a,b =>
let
let
c = cl.s ! t ! a ! b ;
co = obj ! b ++ if_then_Str ifKin (kin b) [] ;
in case p of {
0 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
0 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
compl = co ; p = c.p ; adv = c.compl ++ c.adv ; ext = c.ext ; h = c.h} ; -- Jussi juo maitoakin
1 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
1 => {subj = c.subj ; fin = c.fin ; inf = c.inf ;
compl = c.compl ; p = c.p ; adv = co ; ext = c.adv ++ c.ext ; h = c.h} -- Jussi nukkuu nytkin
}
} ;
kin : Polarity -> Str =
kin : Polarity -> Str =
\p -> case p of {Pos => "gi" ; Neg => "gi"} ;
--allomorph "ki", depends only on phonetic rules "üks+ki", "ühe+gi"
--allomorph "ki", depends only on phonetic rules "üks+ki", "ühe+gi"
--waiting for post construction in GF :P
gi : Str = "gi" ;
-- This is used for subjects of passives: therefore isFin in False.
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
subjForm : NP -> NPForm -> Polarity -> Str = \np,sc,b ->
appCompl False b {s = [] ; c = sc ; isPre = True} np ;
infVP : NPForm -> Polarity -> Agr -> VP -> InfForm -> Str = infVPAnt Simul ;
infVPAnt : Anteriority -> NPForm -> Polarity -> Agr -> VP -> InfForm -> Str =
\ant,sc,pol,agr,vp,vi ->
let
let
fin = case sc of { -- subject case
NPCase Nom => True ; -- mina tahan joosta
_ => False -- minul peab auto olema
@@ -399,12 +399,12 @@ oper
--TODO adv placement?
--TODO inf ++ fin or fin ++ inf? does it ever become a case here?
-- The definitions below were moved here from $MorphoEst$ so that
-- The definitions below were moved here from $MorphoEst$ so that
-- auxiliary of predication can be defined.
verbOlema : Verb =
verbOlema : Verb =
let olema = mkVerb
"olema" "olla" "olen" "ollakse"
"olema" "olla" "olen" "ollakse"
"olge" "oli" "olnud" "oldud"
in {s = table {
Presn _ P3 => "on" ;
@@ -413,9 +413,9 @@ oper
p = []
} ;
verbMinema : Verb =
let minema = mkVerb
"minema" "minna" "läheb" "minnakse"
verbMinema : Verb =
let minema = mkVerb
"minema" "minna" "läheb" "minnakse"
"minge" "läks" "läinud" "mindud"
in {s = table {
Impf Sg P1 => "läksin" ;
@@ -428,20 +428,20 @@ oper
} ;
p = []
} ;
--3 Verbs
--Auxiliary for internal use
mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> Verb =
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
vforms2V (vForms8
mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> Verb =
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
vforms2V (vForms8
tulema tulla tuleb tullakse tulge tuli tulnud tuldud
) ;
--below moved here from MorphoEst
VForms : Type = Predef.Ints 7 => Str ;
vForms8 : (x1,_,_,_,_,_,_,x8 : Str) -> VForms =
\tulema,tulla,tuleb,tullakse,tulge,tuli,tulnud,tuldud ->
table {
@@ -455,34 +455,34 @@ oper
7 => tuldud
} ;
vforms2V : VForms -> Verb = \vh ->
vforms2V : VForms -> Verb = \vh ->
let
tulema = vh ! 0 ;
tulla = vh ! 1 ;
tuleb = vh ! 2 ;
tullakse = vh ! 3 ; --juuakse; loetakse
tulge = vh ! 4 ; --necessary for tulla, surra (otherwise *tulege, *surege)
tulema = vh ! 0 ;
tulla = vh ! 1 ;
tuleb = vh ! 2 ;
tullakse = vh ! 3 ; --juuakse; loetakse
tulge = vh ! 4 ; --necessary for tulla, surra (otherwise *tulege, *surege)
tuli = vh ! 5 ; --necessary for jooma-juua-jõi
tulnud = vh ! 6 ;
tuldud = vh ! 7 ; --necessary for t/d in tuldi; loeti
tull_ = init tulla ; --juu(a); saad(a); tull(a);
tulles = tull_ + "es" ; --juues; saades; tulles;
tule_ = init tuleb ;
lask_ = Predef.tk 2 tulema ;
laulev = case (last lask_) of { --sooma~soov ; laulma~laulev
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü") => lask_ + "v" ;
_ => lask_ + "ev" } ; --consonant stem in -ma, add e
--imperfect stem
kaisi_ = case (Predef.dp 3 tuli) of {
"sis" => lask_ + "i" ; --tõusin, tõusis
_ + "i" => tuli ; --jõin, jõi
_ => lask_ + "si" --käisin, käis; muutsin, muutis
};
};
tuld_ = Predef.tk 2 tuldud ; --d/t choice for tuldi etc.
tulgu = (init tulge) + "u" ;
in
@@ -510,13 +510,13 @@ oper
ConditPass => tuld_ + "aks" ; --# notpresent
Imper Sg => tule_ ; -- tule / ära tule
Imper Pl => tulge ; -- tulge / ärge tulge
ImperP3 => tulgu ; -- tulgu (ta/nad)
ImperP3 => tulgu ; -- tulgu (ta/nad)
ImperP1Pl => tulge + "m" ; -- tulgem
ImperPass => tuld_ + "agu" ; --tuldagu
PassPresn True => tullakse ;
PassPresn False => tuld_ + "a" ; --da or ta
PassImpf True => tuld_ + "i" ; --di or ti
PassImpf False => tuldud ;
PassImpf False => tuldud ;
Quotative Act => lask_ + "vat" ;
Quotative Pass => tuld_ + "avat" ; --d or t
PresPart Act => laulev ;
@@ -527,10 +527,10 @@ oper
Inf InfMas => tulema + "s" ;
Inf InfMast => tulema + "st" ;
Inf InfMata => tulema + "ta" ;
Inf InfMaks => tulema + "ks"
Inf InfMaks => tulema + "ks"
} ;
sc = NPCase Nom ;
p = []
p = []
} ;
-- For regular verbs, paradigm from 4 base forms
@@ -547,12 +547,12 @@ oper
"t" => "k" ;
_ => "g"
} ;
toit_ = case (last vestle_) of {
toit_ = case (last vestle_) of {
("t"|"d") => vesteld_ ; --toit(ma) -> toitke;
_ => vestel_ --vestle(ma) -> vestelge
} ;
laski_ = case (last vestle_) of {
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü")
laski_ = case (last vestle_) of {
("a"|"e"|"i"|"o"|"u"|"õ"|"ä"|"ö"|"ü")
=> vestle_ ; --vestle(ma) -> vestles
_ => vestle_ + "i" --lask(ma) -> laskis
} ;
@@ -566,7 +566,7 @@ oper
(laski_ + "s") --ma: kindla kõneviisi lihtmineviku pöörded;
(toit_ + "nud") --da: isikulise tegumoe mineviku kesksõna
(jaet_ + "ud"); --takse: ülejäänud umbisikulise tgm vormid
regVerb : (_,_,_,_ : Str) -> Verb = \kinkima,kinkida,kingib,kingitakse ->
vforms2V (regVForms kinkima kinkida kingib kingitakse) ;
@@ -580,8 +580,8 @@ oper
-- parem -> paremini
-- parim -> kõige paremini | parimalt?
noun2adjComp : Bool -> Noun -> Adj = \isPos,tuore ->
let
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
let
tuoreesti = Predef.tk 1 (tuore.s ! NCase Sg Gen) + "sti" ;
tuoreemmin = Predef.tk 2 (tuore.s ! NCase Sg Gen) + "in"
in {s = table {
AN f => tuore.s ! f ;
@@ -602,21 +602,21 @@ oper
compAP = icompAP [] ;
icompAP : Str -> {s : Bool => NForm => Str} -> {s : Agr => Str} = \kui,ap ->
{ s = \\agr =>
let n = complNumAgr agr ;
{ 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 ;
compCN : Noun -> {s : Agr => Str} = \cn ->
{ s = \\agr =>
let n = complNumAgr agr ;
in cn.s ! NCase n Nom } ;
-- Reflexive pronoun.
-- Reflexive pronoun.
--- Possessive could be shared with the more general $NounFin.DetCN$.
reflPron : Agr -> NP = \agr ->
let
reflPron : Agr -> NP = \agr ->
let
ise = nForms2N (nForms6 "ise" "enda" "ennast" "endasse" "endi" "endid") ;
n = case agr of {
AgPol => Sg ;
@@ -638,7 +638,7 @@ oper
NForms : Type = Predef.Ints 5 => Str ;
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
nForms6 : (x1,_,_,_,_,x6 : Str) -> NForms =
\jogi,joe,joge,joesse, -- sg nom, gen, part, ill
jogede,jogesid -> table { -- pl gen, part,
0 => jogi ;
@@ -646,7 +646,7 @@ oper
2 => joge ;
3 => joesse ;
4 => jogede ;
5 => jogesid
5 => jogesid
} ;
n2nforms : Noun -> NForms = \ukko -> table {
@@ -655,12 +655,12 @@ oper
2 => ukko.s ! NCase Sg Part ;
3 => ukko.s ! NCase Sg Illat ;
4 => ukko.s ! NCase Pl Gen ;
5 => ukko.s ! NCase Pl Part
5 => ukko.s ! NCase Pl Part
} ;
-- 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 -> Noun = \f ->
nForms2N : NForms -> Noun = \f ->
let
jogi = f ! 0 ;
joe = f ! 1 ;
@@ -668,7 +668,7 @@ oper
joesse = f ! 3 ;
jogede = f ! 4 ;
jogesid = f ! 5 ;
in
in
{s = table {
NCase Sg Nom => jogi ;
NCase Sg Gen => joe ;
@@ -698,7 +698,7 @@ oper
NCase Pl Allat => jogede + "le" ;
NCase Pl Abess => jogede + "ta" ;
NCase Pl Comit => jogede + "ga" ;
NCase Pl Termin => jogede + "ni"
NCase Pl Termin => jogede + "ni"
} --;
-- lock_N = <>
@@ -721,9 +721,9 @@ oper
isDef : Bool
} ;
heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d ->
d ** {sp = d.s} ;
PQuant : Type =
{s : Number => Case => Str ; isDef : Bool} ;
heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d ->
d ** {sp = d.s} ;
PQuant : Type =
{s : Number => Case => Str ; isDef : Bool} ;
}

View File

@@ -9,17 +9,17 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ;
ImpVP vp = {
s = \\pol,agr =>
let
s = \\pol,agr =>
let
verb = vp.s ! VIImper ! Simul ! pol ! agr ;
compl = vp.s2 ! False ! pol ! agr ++ vp.ext --- False = like inf (osta auto)
in --(ära) loe raamat(ut) läbi
verb.fin ++ verb.inf ++ compl ++ vp.p ;
verb.fin ++ verb.inf ++ compl ++ vp.p ;
} ;
-- The object case is formed at the use site of $c2$, in $Relative$ and $Question$.
SlashVP np vp = {
SlashVP np vp = {
s = \\t,a,p => (mkClause (subjForm np vp.sc) np.a vp).s ! t ! a ! p ! SDecl ;
c2 = vp.c2
} ;
@@ -30,13 +30,13 @@ concrete SentenceEst of Sentence = CatEst ** open Prelude, ResEst in {
} ;
SlashPrep cl prep = {
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl ;
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl ;
c2 = prep
} ;
SlashVS np vs slash = {
s = \\t,a,p =>
(mkClause (subjForm np vs.sc) np.a
SlashVS np vs slash = {
s = \\t,a,p =>
(mkClause (subjForm np vs.sc) np.a
(insertExtrapos (etta_Conj ++ slash.s)
(predV vs))
).s ! t ! a ! p ! SDecl ;

View File

@@ -29,7 +29,7 @@ lin
SymbNum n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ;
SymbOrd n = {s = \\_ => glue n.s "."} ;
lincat
lincat
Symb, [Symb] = SS ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
concrete TerminologyEst of Terminology = CatEst ** open
concrete TerminologyEst of Terminology = CatEst ** open
ResEst,
ParadigmsEst,
(G = GrammarEst),
@@ -17,9 +17,9 @@ lincat
ParameterType = G.N ;
Parameter = G.N ;
Modifier = G.A ;
Heading = {s : Str} ;
lin
noun_Category = mkN "käändsõna" ;
@@ -59,7 +59,7 @@ lin
active_Parameter = mkN "isikuline tegumood" ;
passive_Parameter = mkN "umbsikuline tegumood" ;
imperative_Parameter = mkN "käskiv kõneviis" "käskiva kõneviisi";
indicative_Parameter = mkN "kindel kõneviis" "kindla kõneviisi";
conjunctive_Parameter = mkN "konjunktiiv" ;
@@ -67,7 +67,7 @@ lin
present_Parameter = mkN "olevik" ;
past_Parameter = mkN "lihtminevik" ;
future_Parameter = mkN "futuur" ; ---- ???
future_Parameter = mkN "futuur" ; ---- ???
conditional_Parameter = mkN "tingiv kõneviis" "tingiva kõneviisi";
perfect_Parameter = mkN "täisminevik" ;
quotative_Parameter = mkN "kaudne kõneviis" "kaudse kõneviisi";

View File

@@ -9,17 +9,17 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
SlashV2a v = predV v ** {c2 = v.c2} ;
Slash2V3 v np =
insertObj
Slash2V3 v np =
insertObj
(\\fin,b,_ => appCompl fin b v.c2 np) (predV v) ** {c2 = v.c3} ;
Slash3V3 v np =
insertObj
Slash3V3 v np =
insertObj
(\\fin,b,_ => appCompl fin b v.c3 np) (predV v) ** {c2 = v.c2} ;
ComplVV v vp =
insertObj
(\\_,b,a => infVP v.sc b a vp v.vi)
(predV {s = v.s ;
ComplVV v vp =
insertObj
(\\_,b,a => infVP v.sc b a vp v.vi)
(predV {s = v.s ;
p = v.p ;
sc = case vp.sc of {
NPCase Nom => v.sc ; -- minul tuleb kirjutada (VV 'tulema' determines the subject case)
@@ -30,47 +30,47 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
ComplVS v s = insertExtrapos (etta_Conj ++ s.s) (predV v) ;
ComplVQ v q = insertExtrapos ( q.s) (predV v) ;
ComplVA v ap =
insertObj
(\\_,b,agr =>
ComplVA v ap =
insertObj
(\\_,b,agr =>
let n = (complNumAgr agr) in
ap.s ! False ! (NCase n (npform2case n v.c2.c))) --- v.cs.s ignored
(predV v) ;
SlashV2S v s =
SlashV2S v s =
insertExtrapos (etta_Conj ++ s.s) (predV v) ** {c2 = v.c2} ;
SlashV2Q v q =
SlashV2Q v q =
insertExtrapos (q.s) (predV v) ** {c2 = v.c2} ;
SlashV2V v vp =
SlashV2V v vp =
insertObj (\\_,b,a => infVP v.sc b a vp v.vi) (predV v) ** {c2 = v.c2} ;
---- different infinitives
SlashV2A v ap =
insertObj
(\\fin,b,_ =>
SlashV2A v ap =
insertObj
(\\fin,b,_ =>
ap.s ! False ! (NCase Sg (npform2case Sg v.c3.c))) ----agr to obj
(predV v) ** {c2 = v.c2} ;
ComplSlash vp np = insertObjPre (\\fin,b,_ => appCompl fin b vp.c2 np) vp ;
UseComp comp =
UseComp comp =
insertObj (\\_,_ => comp.s) (predV (verbOlema ** {sc = NPCase Nom})) ;
SlashVV v vp =
insertObj
(\\_,b,a => infVP v.sc b a vp v.vi)
(predV {s = v.s ;
SlashVV v vp =
insertObj
(\\_,b,a => infVP v.sc b a vp v.vi)
(predV {s = v.s ;
p = v.p ;
sc = case vp.sc of {
NPCase Nom => v.sc ; -- minun täytyy pestä auto
c => c -- minulla täytyy olla auto
}
}
}
) ** {c2 = vp.c2} ; ---- correct ??
SlashV2VNP v np vp =
insertObjPre
SlashV2VNP v np vp =
insertObjPre
(\\fin,b,a => appCompl True b v.c2 np ++ ---- fin -> stack overflow
infVP v.sc b a vp v.vi)
infVP v.sc b a vp v.vi)
(predV v) ** {c2 = vp.c2} ;
AdvVP vp adv = insertAdv adv.s vp ;
@@ -91,7 +91,7 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
----b UseVS, UseVQ = \v -> v ** {c2 = {s = [] ; c = NPAcc ; isPre = True}} ;
CompAP = compAP ;
CompAP = compAP ;
CompCN = compCN ;
CompNP np = {s = \\_ => np.s ! NPCase Nom} ;
CompAdv a = {s = \\_ => a.s} ;
@@ -102,17 +102,17 @@ concrete VerbEst of Verb = CatEst ** open Prelude, ResEst in {
--2 The object case
--
-- The rules involved are ComplV2 and ComplVV above.
-- The work is done jointly in ResEst.infVP and appCompl.
-- The work is done jointly in ResEst.infVP and appCompl.
-- Cases to test: l -table (to see negated forms)
--```
-- minun täytyy ostaa auto
-- PredVP (UsePron i_Pron) (ComplVV must_VV
-- PredVP (UsePron i_Pron) (ComplVV must_VV
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
-- minä tahdon ostaa auton
-- PredVP (UsePron i_Pron) (ComplVV want_VV
-- PredVP (UsePron i_Pron) (ComplVV want_VV
-- (ComplV2 buy_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
-- minulla täytyy olla auto
-- PredVP (UsePron i_Pron) (ComplVV must_VV
-- PredVP (UsePron i_Pron) (ComplVV must_VV
-- (ComplV2 have_V2 (DetCN (DetSg (SgQuant DefArt) NoOrd) (UseN car_N))))
--```
-- Unfortunately, there is no nice way to say "I want to have a car".