1
0
forked from GitHub/gf-rgl

Merge pull request #322 from inariksit/finnish-smart-paradigm

Finnish smart paradigm fix
This commit is contained in:
Inari Listenmaa
2020-05-04 14:28:06 +02:00
committed by GitHub
32 changed files with 735 additions and 739 deletions

View File

@@ -32,14 +32,14 @@ concrete AdjectiveFin of Adjective = CatFin ** open ResFin, StemFin, Prelude in
ComplA2 a np = {
s = \\isMod,af =>
s = \\isMod,af =>
preOrPost isMod (appCompl True Pos a.c2 np) (sAdjFull2nforms Posit a ! af) ;
p = [] ; hasPrefix = False
} ;
ReflA2 a = {
s = \\isMod,af =>
preOrPost isMod
s = \\isMod,af =>
preOrPost isMod
(appCompl True Pos a.c2 (reflPron (agrP3 Sg))) (sAdjFull2nforms Posit a ! af) ;
p = [] ; hasPrefix = False
} ;

View File

@@ -1,7 +1,6 @@
--# -path=.:../abstract:../common:../api:../prelude
concrete AllFin of AllFinAbs =
concrete AllFin of AllFinAbs =
LangFin - [SlashV2VNP,SlashVV, TFut], ---- to speed up linking; to remove spurious parses
ExtraFin - [ProDrop, ProDropPoss, S_OSV, S_VSO, S_ASV, AdvExistNP] -- to exclude spurious parses
** open ExtendFin in {} --- to make it compile by default

View File

@@ -22,7 +22,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
QCl = {s : ResFin.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} ;
@@ -34,15 +34,15 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
-- Verb
VP = StemFin.VP ;
VPSlash = StemFin.VP ** {c2 : Compl} ;
Comp = {s : Agr => Str} ;
VPSlash = StemFin.VP ** {c2 : Compl} ;
Comp = {s : Agr => Str} ;
-- Adjective
-- The $Bool$ tells whether usage is modifying (as opposed to
-- predicative), e.g. "x on suurempi kuin y" vs. "y:tä suurempi luku".
AP = {s : Bool => NForm => Str ; p : Str ; hasPrefix : Bool} ;
AP = {s : Bool => NForm => Str ; p : Str ; hasPrefix : Bool} ;
-- Noun
@@ -82,7 +82,7 @@ concrete CatFin of Cat = CommonX ** open ResFin, StemFin, Prelude in {
-- Open lexical classes, e.g. Lexicon
V, VS, VQ = SVerb1 ;
V, VS, VQ = SVerb1 ;
V2, VA, V2Q, V2S = SVerb1 ** {c2 : Compl} ;
V2A = SVerb1 ** {c2, c3 : Compl} ;
VV = SVerb1 ** {vi : VVType} ; ---- infinitive form

View File

@@ -22,7 +22,7 @@ concrete ConjunctionFin of Conjunction =
c = ss.c
} ;
ConjCN conj ss =
ConjCN conj ss =
let s = (conjunctDistrTable NForm conj ss).s
in {s = s ; h = Back } ; ---- harmony?

View File

@@ -1,6 +1,6 @@
--# -path=alltenses:.:../abstract
concrete ConstructionFin of Construction = CatFin **
concrete ConstructionFin of Construction = CatFin **
open SyntaxFin, SymbolicFin, ParadigmsFin, (L = LexiconFin), (E = ExtraFin), (R = ResFin), Prelude in {
flags coding=utf8 ;
@@ -21,10 +21,10 @@ lin
how_old_QCl x = mkQCl (E.ICompAP (mkAP L.old_A)) (lin NP x) ;
how_far_QCl x = mkQCl (E.IAdvAdv L.far_Adv) (lin NP x) ;
n_unit_CN card unit cn = mkCN (invarA (SyntaxFin.mkAdv (casePrep genitive) (mkNP <lin Card card : Card> (lin CN unit))).s) cn ;
-- some more things
weather_adjCl ap = mkCl (mkVP (lin AP ap)) ;
is_right_VP = mkVP (ParadigmsFin.mkAdv "oikeassa") ;
is_wrong_VP = mkVP (ParadigmsFin.mkAdv "väärässä") ;
@@ -37,16 +37,16 @@ lin
few_X_short_of_Y np x y =
let kaikki_xt : Str = (mkNP all_Predet ( mkNP aPl_Det x)).s ! R.NPCase R.Nom ;
yssa : Str = y.s ! R.NCase R.Sg R.Iness ;
yssa : Str = y.s ! R.NCase R.Sg R.Iness ;
kaikki_xt_yssa : Adv = ParadigmsFin.mkAdv (kaikki_xt ++ yssa) ;
olla_V : V = lin V have_V2 ;
in mkS negativePol
in mkS negativePol
(mkCl np (mkVP (mkVP olla_V) kaikki_xt_yssa)) ;
{-
where_go_QCl np = mkQCl (lin IAdv (ss "minne")) (mkCl np (mkVP L.go_V)) ;
where_come_from_QCl np = mkQCl (lin IAdv (ss "mistä")) (mkCl np (mkVP L.come_V)) ;
go_here_VP = mkVP (mkVP L.go_V) (mkAdv "tänne") ;
come_here_VP = mkVP (mkVP L.come_V) (mkAdv "tänne") ;
come_from_here_VP = mkVP (mkVP L.come_V) (mkAdv "täältä") ;
@@ -74,14 +74,14 @@ lin
yearAdv y = SyntaxFin.mkAdv (prePrep nominative "vuonna") y ;
dayMonthAdv d m = ParadigmsFin.mkAdv ((mkUtt d).s ++ BIND ++ "." ++ (mkUtt (mkNP m)).s) ;
monthYearAdv m y = SyntaxFin.mkAdv in_Prep (mkNP (mkNP m) (SyntaxFin.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 -> (SyntaxFin.mkAdv (casePrep essive) (mkNP w.noun)).s ;
pointWeekday : Weekday -> Str = \w -> (SyntaxFin.mkAdv (casePrep essive) (mkNP w.noun)).s ;
lincat Language = N ;
@@ -101,14 +101,14 @@ lin
oper mkLanguage : Str -> N = \s -> mkN s ;
oper mkWeekday : Str -> Weekday = \d ->
oper mkWeekday : Str -> Weekday = \d ->
lin Weekday {
noun = mkN d ;
noun = mkN d ;
habitual = case d of {
_ + "i" => ParadigmsFin.mkAdv (d + "sin") ; -- tiistaisin
_ => ParadigmsFin.mkAdv (d + "isin") -- keskiviikkoisin
}
} ;
} ;
lin second_Timeunit = mkN "sekuntti" ;
lin minute_Timeunit = mkN "minuutti" ;
@@ -126,9 +126,9 @@ lin friday_Weekday = mkWeekday "perjantai" ;
lin saturday_Weekday = mkWeekday"lauantai" ;
lin sunday_Weekday = mkWeekday "sunnuntai" ;
lin january_Month = mkN "tammikuu" ;
lin february_Month = mkN "helmikuu" ;
lin march_Month = mkN "maaliskuu" ;
lin january_Month = mkN "tammikuu" ;
lin february_Month = mkN "helmikuu" ;
lin march_Month = mkN "maaliskuu" ;
lin april_Month = mkN "huhtikuu" ;
lin may_Month = mkN "toukokuu" ;
lin june_Month = mkN "kesäkuu" ;

View File

@@ -2,5 +2,5 @@
-- documentation of Finnish in Finnish: the default introduced in LangFin
concrete DocumentationFin of Documentation = CatFin **
concrete DocumentationFin of Documentation = CatFin **
DocumentationFinFunctor with (Terminology = TerminologyFin) ;

View File

@@ -2,5 +2,5 @@
-- documentation of Finnish in English
concrete DocumentationFinEng of Documentation = CatFin **
concrete DocumentationFinEng of Documentation = CatFin **
DocumentationFinFunctor with (Terminology = TerminologyEng) ;

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
incomplete concrete DocumentationFinFunctor of Documentation = CatFin ** open
incomplete concrete DocumentationFinFunctor of Documentation = CatFin ** open
Terminology, -- the interface
ResFin,
StemFin,
@@ -34,10 +34,10 @@ lin
InflectionA, InflectionA2 = \adj -> {
t = "a" ;
s1 = heading1 (heading adjective_Category) ;
s2 = inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Posit ! sAN f ; h = adj.h}).s ! nf) ++
heading2 (heading comparative_Parameter) ++
inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Compar ! sAN f ; h = adj.h}).s ! nf) ++
heading2 (heading superlative_Parameter) ++
s2 = inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Posit ! sAN f ; h = adj.h}).s ! nf) ++
heading2 (heading comparative_Parameter) ++
inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Compar ! sAN f ; h = adj.h}).s ! nf) ++
heading2 (heading superlative_Parameter) ++
inflNoun (\nf -> (snoun2nounSep {s = \\f => adj.s ! Superl ! sAN f ; h = adj.h}).s ! nf)
} ;
@@ -55,91 +55,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 : CatFin.Cl -> Str = \cl -> (S.mkUtt cl).s ;
{-
-} --# notpresent
inflVerb : CatFin.V -> Str = \verb0 ->
let
let
verb = sverb2verbSep verb0 ;
vfin : ResFin.VForm -> Str = \f ->
verb.s ! f ;
nounNounHeading : Parameter -> Parameter -> Str = \n1,n2 ->
(S.mkUtt (G.PossNP (S.mkCN n1) (S.mkNP (snoun2nounSep n2)))).s ;
in
@@ -149,7 +149,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
) ++
@@ -164,13 +164,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 (PastPartAct (AN (NCase Sg Nom)))) ++
td (vfin (PastPartAct (AN (NCase Sg Nom)))) ++
td (vfin (PastPartAct (AN (NCase Pl Nom)))) ++
td (vfin (PassImpf False)))
) ++
@@ -180,7 +180,7 @@ 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" (vfin (PassCondit True)) --# notpresent
) ++
@@ -195,7 +195,7 @@ oper
th (heading singular_Parameter) ++
th (heading plural_Parameter)
++ th (heading passive_Parameter) --# notpresent
) ++
) ++
tr (th "1.p" ++ td (vfin (Potent Sg P1)) ++ td (vfin (Potent Pl P1))
++ intagAttr "td" "rowspan=3" (vfin (PassPotent True)) --# notpresent
) ++
@@ -210,34 +210,34 @@ 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 (PassImper True))) ++
tr (th "2.p" ++ td (vfin (Imper Sg)) ++ td (vfin (Imper Pl))) ++
tr (th "3.p" ++ td (vfin (ImperP3 Sg)) ++ td (vfin (ImperP3 Pl))) ++
tr (th (heading negative_Parameter) ++
td (vfin (Imper Sg)) ++
td (vfin (Imper Sg)) ++
td (vfin ImpNegPl) ++
td (vfin (PassImper False)))
) ++
heading2 (nounPluralHeading nominal_form_ParameterType).s ++
heading3 (heading infinitive_Parameter) ++
frameTable (
tr (intagAttr "th" "rowspan=2" "1" ++
tr (intagAttr "th" "rowspan=2" "1" ++
th (heading short_Parameter) ++ ---
td (vfin (Inf Inf1))) ++
tr (th (heading long_Parameter) ++ ---
td (vfin (Inf Inf1Long) ++ BIND ++ "(ni)")) ++
tr (intagAttr "th" "rowspan=2" ("2." ++ heading active_Parameter) ++
th (heading inessive_Parameter) ++
tr (intagAttr "th" "rowspan=2" ("2." ++ heading active_Parameter) ++
th (heading inessive_Parameter) ++
td (vfin (Inf Inf2Iness))) ++
tr (th (heading instructive_Parameter) ++
tr (th (heading instructive_Parameter) ++
td (vfin (Inf Inf2Instr))) ++
tr (th ("2." ++ heading passive_Parameter) ++
th (heading inessive_Parameter) ++
tr (th ("2." ++ heading passive_Parameter) ++
th (heading inessive_Parameter) ++
td (vfin (Inf Inf2InessPass))) ++
tr (intagAttr "th" "rowspan=7" "3." ++
tr (intagAttr "th" "rowspan=7" "3." ++
th (heading inessive_Parameter) ++ td (vfin (Inf Inf3Iness))) ++
tr (th (heading elative_Parameter) ++ td (vfin (Inf Inf3Elat))) ++
tr (th (heading illative_Parameter) ++ td (vfin (Inf Inf3Illat))) ++
@@ -246,7 +246,7 @@ oper
tr (th (heading instructive_Parameter) ++ td (vfin (Inf Inf3Instr))) ++
tr (th (heading instructive_Parameter ++ "pass.") ++ td (vfin (Inf Inf3InstrPass))) ++
tr (intagAttr "th" "rowspan=2" "4." ++
tr (intagAttr "th" "rowspan=2" "4." ++
th (heading nominative_Parameter) ++ td (vfin (Inf Inf4Nom))) ++
tr (th (heading partitive_Parameter) ++ td (vfin (Inf Inf4Part))) ++
@@ -254,25 +254,25 @@ oper
) ++
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 (PresPartAct (AN (NCase Sg Nom))))) ++
tr (th (heading passive_Parameter) ++
tr (th (heading passive_Parameter) ++
td (vfin (PresPartPass (AN (NCase Sg Nom))))) ++
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 (PastPartAct (AN (NCase Sg Nom))))) ++
tr (th (heading passive_Parameter) ++
tr (th (heading passive_Parameter) ++
td (vfin (PastPartPass (AN (NCase Sg Nom))))) ++
tr (intagAttr "th" "colspan=2" (heading agent_Parameter) ++
tr (intagAttr "th" "colspan=2" (heading agent_Parameter) ++
td (vfin (AgentPart (AN (NCase Sg Nom)))))
) ;
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))) ++
@@ -287,7 +287,7 @@ oper
tr (th (heading allative_Parameter) ++ td (nouns (NCase Sg Allat)) ++ td (nouns (NCase Pl Allat))) ++
tr (th (heading abessive_Parameter) ++ td (nouns (NCase Sg Abess)) ++ td (nouns (NCase Pl Abess))) ++
tr (th (heading comitative_Parameter) ++ td "" ++ td (nouns (NComit))) ++
tr (th (heading instructive_Parameter) ++ td "" ++ td (nouns (NInstruct)))
tr (th (heading instructive_Parameter) ++ td "" ++ td (nouns (NInstruct)))
) ;
lin
@@ -300,6 +300,6 @@ lin
MkTag i = ss (i.t) ;
{- --# notpresent
-}
-}
}

View File

@@ -165,11 +165,11 @@ lin
PassVPSlash vp = S.passVP vp vp.c2 ;
PassAgentVPSlash vp np = {
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 ! NPSep ++ vp.s2 ! b ! p ! a ;
adv = vp.adv ;
ext = vp.ext ;
vptyp = vp.vptyp ;
} ;
} ;
}

View File

@@ -1,21 +1,21 @@
--# -path=.:abstract:common:prelude
concrete ExtraFin of ExtraFinAbs = CatFin **
concrete ExtraFin of ExtraFinAbs = CatFin **
open ResFin, MorphoFin, Coordination, Prelude, NounFin, VerbFin, StructuralFin, StemFin, (R = ParamX) in {
flags coding=utf8 ;
lin
GenNP np = {
s1,sp = \\_,_ => np.s ! NPCase Gen ;
s2 = case np.isPron of { -- "isän auto", "hänen autonsa"
True => table {Front => BIND ++ possSuffixFront np.a ;
s2 = case np.isPron of { -- "isän auto", "hänen autonsa"
True => table {Front => BIND ++ possSuffixFront np.a ;
Back => BIND ++ possSuffix np.a } ;
False => \\_ => []
} ;
isNum = False ;
isPoss = np.isPron ; --- also gives "sen autonsa"
isDef = True ; --- "Jussin kolme autoa ovat" ; thus "...on" is missing
isNeg = False
isNeg = False
} ;
GenIP ip = {s = \\_,_ => ip.s ! NPCase Gen} ;
@@ -24,8 +24,8 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
h = n2.h } ;
GenRP num cn = {
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
a = RNoAg
s = \\n,c => let k = npform2case num.n c in relPron ! n ! Gen ++ cn.s ! NCase num.n k ;
a = RNoAg
--- a = RAg (agrP3 num.n)
} ;
@@ -38,18 +38,18 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
MkVPI vp = {s = \\i => infVP SCNom Pos (agrP3 Sg) vp (vvtype2infform i)} ;
ConjVPI = conjunctDistrTable VVType ;
ComplVPIVV vv vpi =
ComplVPIVV vv vpi =
insertObj (\\_,_,_ => vpi.s ! vv.vi) (predSV vv) ;
lincat
VPS = {
s : Agr => Str ;
s : Agr => Str ;
sc : SubjCase ; --- can be different for diff parts
h : Harmony --- can be different for diff parts
} ;
[VPS] = {
s1,s2 : Agr => Str ;
s1,s2 : Agr => Str ;
sc : SubjCase ; --- take the first: minä osaan kutoa ja täytyy virkata
h : Harmony --- take the first: osaanko minä kutoa ja käyn koulua
} ;
@@ -86,38 +86,38 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
s = subjForm np vps.sc Pos ++ vps.s ! np.a
} ;
AdvExistNP adv np =
mkClause (\_ -> adv.s) np.a (insertObj
AdvExistNP adv np =
mkClause (\_ -> adv.s) np.a (insertObj
(\\_,b,_ => np.s ! NPSep) (predV vpVerbOlla)) ;
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 ! NPSep)
np.a
(insertObj
(\\_,b,_ => np.s ! NPSep)
(predV vpVerbOlla)) ;
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,_ => subjForm np v.sc b) (predSV 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 ! NPSep) (predV vpVerbOlla)) ;
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 ! subjcase2npform v.sc) (predSV v)) ;
in {
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
@@ -132,26 +132,26 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
n = Sg
} ;
PartCN cn =
let
PartCN cn =
let
acn = DetCN (DetQuant IndefArt NumSg) cn
in {
s = table {
NPCase Nom | NPAcc => acn.s ! NPCase ResFin.Part ;
c => acn.s ! c
} ;
} ;
a = acn.a ;
isPron = False ; isNeg = False
} ;
PartPlCN cn =
let
PartPlCN cn =
let
acn = DetCN (DetQuant IndefArt NumPl) cn
in {
s = table {
NPCase Nom | NPAcc => acn.s ! NPCase ResFin.Part ;
c => acn.s ! c
} ;
} ;
a = acn.a ;
isPron = False ; isNeg = False
} ;
@@ -167,7 +167,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
---- copied from VerbFin.CompAP, should be shared
ICompAP ap = {
s = \\agr =>
s = \\agr =>
let
n = complNumAgr agr ;
c = case n of {
@@ -181,7 +181,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
ProDrop p = {
s = table {NPCase Nom => [] ; c => p.s ! c} ;
poss = [] ;
poss = [] ;
-- drop Gen only works in adjectival position: "autoni", but not in "ø täytyy mennä"
a = p.a ;
hasPoss = p.hasPoss ;
@@ -191,7 +191,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
s1 = \\_,_ => case p.a of {Ag _ P3 => p.s ! NPCase Gen ; _ => []} ; -- hänen nimensä ; (minun) nimeni
sp = \\_,_ => p.s ! NPCase Gen ;
s2 = case p.hasPoss of {
True => table {Front => BIND ++ possSuffixFront p.a ;
True => table {Front => BIND ++ possSuffixFront p.a ;
Back => BIND ++ possSuffix p.a } ;
False => \\_ => [] -- sen nimi
} ;
@@ -201,53 +201,53 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
isNeg = False
} ;
lincat
lincat
ClPlus, ClPlusObj, ClPlusAdv = ClausePlus ;
Part = {s : Harmony => 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 ! Back ----
in
{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 = t.s ++ p.s ++ cl.subj ++ pa ++ cl.fin ++ cl.inf ++ cl.compl ++ cl.adv ++ cl.ext} ;
S_OSV part t p clp =
let
cl = clp.s ! t.t ! t.a ! p.p ;
pa = part.s ! Back ----
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 ! cl.h
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 ! cl.h
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 ! Back ----
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.s.sc) np.a vp ;
PredClPlusFocSubj np vp = insertKinClausePlus 0 (mkClausePlus (subjForm np vp.s.sc) np.a vp) ;
PredClPlusFocVerb np vp = insertKinClausePlus 1 (mkClausePlus (subjForm np vp.s.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.s.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.s.sc) np.a vps) ;
PredClPlusAdv np vp adv =
PredClPlusAdv np vp adv =
insertObjClausePlus 1 False (\\_ => adv.s) (mkClausePlus (subjForm np vp.s.sc) np.a vp) ;
PredClPlusFocAdv np vp adv =
PredClPlusFocAdv np vp adv =
insertObjClausePlus 1 True (\\_ => adv.s) (mkClausePlus (subjForm np vp.s.sc) np.a vp) ;
ClPlusWithObj c = c ;
@@ -267,7 +267,7 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
{- -----
s = \\vif,ant,pol,agr => case vif of {
VIFin t => vp.s ! VIPass t ! ant ! pol ! agr ;
_ => vp.s ! vif ! ant ! pol ! agr
_ => vp.s ! vif ! ant ! pol ! agr
} ;
-}
@@ -278,12 +278,12 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
---- TODO: agr should be to the agent
PassAgentVPSlash vp np = {
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 ! NPSep ++ vp.s2 ! b ! p ! a ;
adv = vp.adv ;
ext = vp.ext ;
vptyp = vp.vptyp ;
} ;
} ;
AdjAsCN ap = {
@@ -305,13 +305,13 @@ concrete ExtraFin of ExtraFinAbs = CatFin **
quant : NounFin.Quant = lin Quant { -- possessive pronoun with suffix only
s2 : Harmony => Str = \\harm => possSuffixGen harm agr ;
s1,sp = \\_,_ => [] ; isNum,isNeg = False ; isPoss,isDef = True
} ;
} ;
det = NounFin.DetQuant quant num
in
(NounFin.DetCN det cn).s ! npf ;
isPron = False
} ;
}
}

View File

@@ -61,7 +61,7 @@ abstract ExtraFinAbs = Extra [
ClPlusWithObj : ClPlusObj -> ClPlus ; -- to make non-fronted obj focusable
ClPlusWithAdv : ClPlusAdv -> ClPlus ; -- to make non-fronted adv focusable
noPart, han_Part, pa_Part, pas_Part, ko_Part, kos_Part,
kohan_Part, pahan_Part : Part ;
noPart, han_Part, pa_Part, pas_Part, ko_Part, kos_Part,
kohan_Part, pahan_Part : Part ;
}

View File

@@ -1,8 +1,8 @@
--# -path=.:../abstract:../common:prelude
concrete GrammarFin of Grammar =
NounFin,
VerbFin,
concrete GrammarFin of Grammar =
NounFin,
VerbFin,
AdjectiveFin,
AdverbFin,
NumeralFin,

View File

@@ -4,20 +4,20 @@ concrete IdiomFin of Idiom = CatFin **
flags optimize=all_subs ; coding=utf8;
lin
ExistNP np =
let
ExistNP np =
let
cas : Polarity -> NPForm = \p -> case p of {
Pos => NPSep ; -- on olemassa luku
Neg => NPCase Part -- ei ole olemassa lukua
}
in
mkClause noSubj (agrP3 Sg) (insertObj
mkClause noSubj (agrP3 Sg) (insertObj
(\\_,b,_ => "olemassa" ++ np.s ! cas b) (predV olla)) ;
ExistIP ip =
ExistIP ip =
let
cas : SubjCase = SCNom ; ---- also partitive in Extra
vp = insertObj (\\_,b,_ => "olemassa") (predV olla) ;
vp = insertObj (\\_,b,_ => "olemassa") (predV olla) ;
cl = mkClause (subjForm (ip ** {isPron = False ; a = agrP3 ip.n}) cas) (agrP3 ip.n) vp
in {
s = \\t,a,p => cl.s ! t ! a ! p ! SDecl
@@ -25,13 +25,13 @@ concrete IdiomFin of Idiom = CatFin **
-- Notice the nominative in the cleft $NP$: "se on Matti josta Liisa pitää"
CleftNP np rs = mkClause (\_ -> "se") (agrP3 Sg)
CleftNP np rs = mkClause (\_ -> "se") (agrP3 Sg)
(insertExtrapos (rs.s ! np.a)
(insertObj (\\_,_,_ => np.s ! NPSep) (predV olla))) ;
-- This gives the almost forbidden "se on Porissa kun Matti asuu".
CleftAdv ad s = mkClause (\_ -> "se") (agrP3 Sg)
CleftAdv ad s = mkClause (\_ -> "se") (agrP3 Sg)
(insertExtrapos ("kun" ++ s.s)
(insertObj (\\_,_,_ => ad.s) (predV olla))) ;
@@ -39,8 +39,8 @@ concrete IdiomFin of Idiom = CatFin **
GenericCl vp = mkClausePol vp.vptyp.isNeg noSubj (agrP3 Sg) (passVP vp (casePrep nominative)) ;
ProgrVP vp =
let
ProgrVP vp =
let
inf = (sverb2verbSep vp.s).s ! Inf Inf3Iness ;
on = predV olla
in {
@@ -51,14 +51,14 @@ concrete IdiomFin of Idiom = CatFin **
vptyp = vp.vptyp ;
} ;
ImpPl1 vp =
ImpPl1 vp =
let vps = (sverb2verbSep vp.s).s ! ImperP1Pl
in
{s = vps ++
vp.s2 ! True ! Pos ! Ag Pl P1 ++ vp.adv ! Pos ++ vp.ext
} ;
ImpP3 np vp =
ImpP3 np vp =
let vps = (sverb2verbSep vp.s).s ! ImperP3 (verbAgr np.a).n
in
{s = np.s ! subjcase2npform vp.s.sc ++ vps ++
@@ -75,11 +75,11 @@ concrete IdiomFin of Idiom = CatFin **
} ;
ExistNPAdv np adv =
mkClausePol np.isNeg (\_ -> adv.s) np.a (insertObj
mkClausePol np.isNeg (\_ -> adv.s) np.a (insertObj
(\\_,b,_ => np.s ! NPSep) (predV vpVerbOlla)) ;
ExistIPAdv ip adv =
let
let
c = case ip.n of {Sg => Nom ; Pl => Part} ;
cl = mkClause (\_ -> ip.s ! NPCase c ++ adv.s) (agrP3 Sg) -- kuka täällä on ; keitä täällä on
(predV vpVerbOlla) ;
@@ -92,4 +92,3 @@ concrete IdiomFin of Idiom = CatFin **
noSubj : Polarity -> Str = \_ -> [] ;
}

View File

@@ -1,7 +1,7 @@
kayda_V =
kayda_V =
let kay = Predef.tk 2 s ; kavi = init kay + "vi" in
vForms12 s (kay + "n") kay (kay + "vät") (kay + "kää") (kay + "dään")
vForms12 s (kay + "n") kay (kay + "v<EFBFBD>t") (kay + "k<EFBFBD><EFBFBD>") (kay + "d<EFBFBD><EFBFBD>n")
(kavi + "n") kavi (kavi + "si") (kay + "nyt") (kay + "tty")
(kay + "nee") ;
tuntea_V =
@@ -18,4 +18,3 @@ tietaa_V
taitaa_V
siita_V

View File

@@ -17,7 +17,7 @@ oper
d03 : Str -> NForms -- 481 ääntiö
= \s -> dSilakka s (s + "n") (s + "it" + vowelHarmony s) ;
d04A : Str -> NForms -- 273 äpärikkö
= \s -> let ws = weakGrade s in
= \s -> let ws = weakGrade s in
dSilakka s (ws + "n") (ws + "it" + getHarmony (last s)) ;
d05 : Str -> NForms -- 3212 öljymaali
= \s -> case last s of {
@@ -37,7 +37,7 @@ oper
d08A : Str -> NForms -- 5 vinaigrette
= \s -> dNukke s (weakGrade s + "n") ;
d09 : Str -> NForms -- 696 ääriraja
= \s -> let a = last s in dSilakka s
= \s -> let a = last s in dSilakka s
(s + "n")
(init s + case a of {"a" => "o" ; _ => "ö"} + "j" + a) ;
d09A : Str -> NForms -- 1040 ääniraita
@@ -45,7 +45,7 @@ oper
x + "aaka" => dSilakka s (x+"aa'an") (x+"aakoja") ;
x + "aika" => dSilakka s (x+"ajan") (x+"aikoja") ; -- lots of compound words in NewDictFin that end in aika, but are not analysed as compounds
_ => let a = last s
in dSilakka s
in dSilakka s
(weakGrade s + "n")
(init s + case a of {"a" => "o" ; _ => "ö"} + "j" + a)
} ;
@@ -59,21 +59,21 @@ oper
d11 : Str -> NForms -- 46 ödeema
= \s -> dSilakka s (weakGrade s + "n") (init s + "i" + vowelHarmony (last s)) ;
d12 : Str -> NForms -- 1125 örinä
= \s -> let a = vowelHarmony (last s) in
dSilakka s (s + "n")
= \s -> let a = vowelHarmony (last s) in
dSilakka s (s + "n")
(init s + case a of {"a" => "o" ; _ => "ö"} + "it" + a) ;
d13 : Str -> NForms -- 157 virtaska
= \s -> let a = vowelHarmony (last s) in
dSilakka s (s + "n")
= \s -> let a = vowelHarmony (last s) in
dSilakka s (s + "n")
(init s + case a of {"a" => "o" ; _ => "ö"} + "j" + a) ;
d14A : Str -> NForms -- 244 ötökkä
= \s -> let a = vowelHarmony (last s) ; ws = weakGrade s in
dSilakka s (ws + "n")
= \s -> let a = vowelHarmony (last s) ; ws = weakGrade s in
dSilakka s (ws + "n")
(init ws + case a of {"a" => "o" ; _ => "ö"} + "it" + a) ;
d15 : Str -> NForms -- 170 äreä
= dKorkea ;
d16 : Str -> NForms -- 2 kumpikin --?
= \s -> let kumpi = Predef.take 5 s ; kin = Predef.drop 5 s in
= \s -> let kumpi = Predef.take 5 s ; kin = Predef.drop 5 s in
\\i => (dSuurempi kumpi ! i + kin) ;
d16A : Str -> NForms -- 20 ylempi
= dSuurempi ;
@@ -106,13 +106,13 @@ oper
d28A : Str -> NForms -- 1 jälsi
= \s -> dArpi s (Predef.tk 2 s + "len") ;
d29 : Str -> NForms -- 1 lapsi
= \s -> let lapsi = dArpi s (init s + "en") ; a = vowHarmony s in
= \s -> let lapsi = dArpi s (init s + "en") ; a = vowHarmony s in
table {2 => Predef.tk 3 s + "st" + a ; i => lapsi ! i} ;
d30 : Str -> NForms -- 2 veitsi
= \s -> let lapsi = dArpi s (init s + "en") ; a = vowHarmony s in
= \s -> let lapsi = dArpi s (init s + "en") ; a = vowHarmony s in
table {2 => Predef.tk 3 s + "st" + a ; i => lapsi ! i} ;
d31 : Str -> NForms -- 3 yksi
= \s -> let
= \s -> let
y = Predef.tk 3 s ;
a = vowelHarmony y
in nForms10
@@ -127,7 +127,7 @@ oper
d33A : Str -> NForms -- 181 yllytin
= \s -> dLiitin s (strongGrade (init s) + "men") ;
d34 : Str -> NForms -- 1 alaston
= \s -> let alastom = init s in
= \s -> let alastom = init s in
nForms10
s (alastom + "an") (s + "ta") (alastom + "ana") (alastom + "aan")
(alastom + "ien") (alastom + "ia") (alastom + "ina") (alastom + "issa")
@@ -143,7 +143,7 @@ oper
d36 : Str -> NForms -- 11 ylin
= dSuurin ;
d37 : Str -> NForms -- 1 vasen
= \s -> let vasem = init s + "m" in
= \s -> let vasem = init s + "m" in
nForms10
s (vasem + "man") (s + "ta") (vasem + "pana") (vasem + "paan")
(vasem + "pien") (vasem + "pia") (vasem + "pina") (vasem + "missa")
@@ -159,7 +159,7 @@ oper
d41A : Str -> NForms -- 401 öljykangas
= \s -> let is = init s in dRae s (strongGrade is + last is + "n") ;
d42 : Str -> NForms -- 1 mies
= \s -> let mieh = init s + "h" in
= \s -> let mieh = init s + "h" in
nForms10
s (mieh + "en") (s + "tä") (mieh + "enä") (mieh + "een")
(s + "ten") (mieh + "iä") (mieh + "inä") (mieh + "issä")
@@ -169,19 +169,19 @@ oper
d43A : Str -> NForms -- 1 immyt
= \s -> dRae s (strongGrade (init s) + "en") ;
d44 : Str -> NForms -- 1 kevät
= \s -> let kevä = init s in
= \s -> let kevä = init s in
nForms10
s (kevä + "än") (s + "tä") (kevä + "änä") (kevä + "äseen")
(s + "iden") (kevä + "itä") (kevä + "inä") (kevä + "issä")
(kevä + "isiin") ;
d45 : Str -> NForms -- 23 yhdes
= \s -> let yhde = init s ; a = vowelHarmony s in
= \s -> let yhde = init s ; a = vowelHarmony s in
nForms10
s (yhde + "nnen") (yhde + "tt" + a) (yhde + "nten" + a) (yhde + "nteen")
(yhde + "nsien") (yhde + "nsi" + a) (yhde + "nsin" + a) (yhde + "nsiss" + a)
(yhde + "nsiin") ;
d46 : Str -> NForms -- 1 tuhat
= \s -> let tuha = init s ; a = vowelHarmony s in
= \s -> let tuha = init s ; a = vowelHarmony s in
nForms10
s (tuha + "nnen") (tuha + "tt" + a) (tuha + "nten" + a) (tuha + "nteen")
(tuha + "nsien") (tuha + "nsi" + a) (tuha + "nsin" + a) (tuha + "nsiss" + a)
@@ -210,13 +210,13 @@ oper
c52A : Str -> VForms -- 1568 öljyyntyä
= \s -> cHukkua s (weakGrade (init s) + "n") ;
c53 : Str -> VForms -- 605 äänestää
= \s -> let ott = Predef.tk 2 s in
= \s -> let ott = Predef.tk 2 s in
cOttaa s (init s + "n") (ott + "in") (ott + "i") ;
c53A : Str -> VForms -- 2121 örähtää
= \s -> let ota = weakGrade (init s) in
cOttaa s (ota + "n") (init ota + "in") (Predef.tk 2 s + "i") ;
c54 : Str -> VForms -- 2 pieksää
= \s -> let ott = Predef.tk 2 s in
= \s -> let ott = Predef.tk 2 s in
cOttaa s (init s + "n") (ott + "in") (ott + "i") ;
c54A : Str -> VForms -- 316 ääntää
= \s -> let ota = weakGrade (init s) ; o = Predef.tk 2 ota in
@@ -224,7 +224,7 @@ oper
c55A : Str -> VForms -- 7 yltää
= c54A ; --? diff: variation ylti/ylsi
c56 : Str -> VForms -- 22 valaa
= \s -> let val = Predef.tk 2 s in
= \s -> let val = Predef.tk 2 s in
cOttaa s (init s + "n") (val + "oin") (val + "oi") ; -- never ö
c56A : Str -> VForms -- 28 virkkaa
= \s -> let ota = weakGrade (init s) ; ot = init ota in
@@ -293,7 +293,7 @@ oper
c75A : Str -> VForms -- 9 siitä
= \s -> cPudota s (strongGrade (Predef.tk 2 s) + "si") ;
c76A : Str -> VForms -- 2 tietää
= \s -> let tieta = init s ; tieda = weakGrade tieta ; ties = Predef.tk 2 tieta + "s" in
= \s -> let tieta = init s ; tieda = weakGrade tieta ; ties = Predef.tk 2 tieta + "s" in
cOttaa s (tieda + "n") (ties + "in") (ties + "i") ; -- only tietaa, taitaa
-- defective verbs
c77 : Str -> VForms -- 3 vipajaa
@@ -309,12 +309,11 @@ oper
= c99 ; -- dummy
-- compound nouns, latter part inflected
compoundNK : Str -> NForms -> NForms = \x,y ->
compoundNK : Str -> NForms -> NForms = \x,y ->
\\v => x + y ! v ;
--- this is a lot slower
fcompoundNK : (Str -> NForms) -> Str -> Str -> NForms = \d,x,y ->
fcompoundNK : (Str -> NForms) -> Str -> Str -> NForms = \d,x,y ->
let ys = d y in \\v => x + ys ! v ;
}

View File

@@ -1,7 +1,7 @@
--# -path=.:../abstract:../common:../api
concrete LangFin of Lang =
GrammarFin,
concrete LangFin of Lang =
GrammarFin,
LexiconFin
, ConstructionFin
, DocumentationFin --# notpresent

View File

@@ -2,7 +2,7 @@
concrete LexiconFin of Lexicon = CatFin ** open MorphoFin, StemFin, ParadigmsFin in {
flags
flags
coding=utf8 ;
optimize=values ;
@@ -23,7 +23,7 @@ lin
beer_N = mkN "olut" "oluita" ;
beg_V2V = mkV2V (mk2V "pyytää" "pyysi") (casePrep partitive) ;
big_A = mkA (mkN "suuri" "suuria") "suurempi" "suurin" ;
bike_N = mkN "polku" (mkN "pyörä") ;
bike_N = mkN "polku" (mkN "pyörä") ;
bird_N = mkN "lintu" ;
black_A = mkA (mkN "musta") "mustempi" "mustin" ;
blue_A = mkA (mkN "sininen") "sinisempi" "sinisin" ;
@@ -36,7 +36,7 @@ lin
break_V2 = mkV2 (mkV "rikkoa") ;
broad_A = mkA (mkN "leveä") "leveämpi" "levein" ;
brother_N2 = mkN2 (
mkN "veli" "veljen" "veljenä" "veljeä" "veljeen"
mkN "veli" "veljen" "veljenä" "veljeä" "veljeen"
"veljinä" "veljissä" "veljien" "veljiä" "veljiin") ;
brown_A = mkA (mkN "ruskea") "ruskeampi" "ruskein" ;
butter_N = mk3N "voi" "voin" "voita" ; ---- errors in Part
@@ -49,7 +49,7 @@ lin
ceiling_N = mkN "katto" ;
chair_N = mkN "tuoli" ;
cheese_N = mkN "juusto" ;
child_N = mkN "lapsi" "lapsen" "lasta" "lapsena" "lapseen"
child_N = mkN "lapsi" "lapsen" "lasta" "lapsena" "lapseen"
"lasten" "lapsia" "lapsina" "lapsissa" "lapsiin" ;
church_N = mkN "kirkko" ;
city_N = mkN "kaupunki" ;
@@ -70,7 +70,7 @@ lin
dog_N = mkN "koira" ;
door_N = mkN "ovi" "ovia" ;
drink_V2 = mkV2 (mkV "juoda") (casePrep partitive) ;
easy_A2V = mkA2 (mkA (mkN "helppo") "helpompi" "helpoin")
easy_A2V = mkA2 (mkA (mkN "helppo") "helpompi" "helpoin")
(casePrep allative) ;
eat_V2 = mkV2 (mkV "syödä") (casePrep partitive) ;
empty_A = mkA (mkN "tyhjä") "tyhjempi" "tyhjin" ;
@@ -111,7 +111,7 @@ lin
know_V2 = mkV2 (mkV "tuntea" "tunsi") ;
lake_N = mkN "järvi" "järviä" ;
lamp_N = mkN "lamppu" ;
learn_V2 =
learn_V2 =
mkV2 (mk12V "oppia" "opin" "oppii" "oppivat" "oppikaa" "opitaan"
"opin" "oppi" "oppisi" "oppinut" "opittu" "opitun") ;
leather_N = mkN "nahka" ; --- nahan
@@ -123,8 +123,8 @@ lin
lose_V2 = mkV2 (mkV "hävitä" "hävisi") ; --- hukata
love_N = mk3N "rakkaus" "rakkauden" "rakkauksia" ;
love_V2 = mkV2 (mkV "rakastaa") partitive ;
man_N = mkN "mies" "miehen" "miestä" "miehenä" "mieheen"
"miesten" "miehiä" "miehinä" "miehissä" "miehiin" ;
man_N = mkN "mies" "miehen" "miestä" "miehenä" "mieheen"
"miesten" "miehiä" "miehinä" "miehissä" "miehiin" ;
married_A2 = mkA2 (mkA "avioitunut") (postPrep genitive "kanssa") ; ---- infl
meat_N = mkN "liha" ;
milk_N = mkN "maito" ;
@@ -169,7 +169,7 @@ lin
seek_V2 = mkV2 (mkV "etsiä") cpartitive ;
see_V2 = mkV2 (
mk12V "nähdä" "näen" "näkee" "näkevät" "nähkää" "nähdään"
"näin" "näki" "näkisi" "nähnyt" "nähty" "nähdyn") ;
"näin" "näki" "näkisi" "nähnyt" "nähty" "nähdyn") ;
sell_V3 = mkV3 (mkV "myydä") accPrep (casePrep allative) ;
send_V3 = mkV3 (mkV "lähettää") accPrep (casePrep allative) ;
sheep_N = mkN "lammas" ;
@@ -211,10 +211,10 @@ lin
village_N = mkN "kylä" ;
wait_V2 = mkV2 (mkV "odottaa") partitive ;
walk_V = mkV "kävellä" "käveli" ;
warm_A = mkA
(mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään"
warm_A = mkA
(mkN "lämmin" "lämpimän" "lämmintä" "lämpimänä" "lämpimään"
"lämpiminä" "lämpimiä" "lämpimien" "lämpimissä" "lämpimiin"
)
)
"lämpimämpi" "lämpimin" ;
war_N = mkN "sota" ;
watch_V2 = mkV2 (mkV "katsella") cpartitive ;
@@ -232,7 +232,7 @@ lin
do_V2 = mkV2 (
mkV "tehdä" "teen" "tekee" "tekevät" "tehkää" "tehdään"
"tein" "teki" "tekisi" "tehnyt" "tehty" "tehdyn") ;
"tein" "teki" "tekisi" "tehnyt" "tehty" "tehdyn") ;
now_Adv = mkAdv "nyt" ;
already_Adv = mkAdv "jo" ;
@@ -289,8 +289,8 @@ lin
heart_N = mkN "sydän" "sydämen" "sydäntä" "sydämenä" "sydämeen"
"sydänten" "sydämiä" "sydäminä" "sydämissä" "sydämiin" ;
horn_N = mk2N "sarvi" "sarvia" ;
husband_N = mkN "mies" "miehen" "miestä" "miehenä" "mieheen"
"miesten" "miehiä" "miehinä" "miehissä" "miehiin" ;
husband_N = mkN "mies" "miehen" "miestä" "miehenä" "mieheen"
"miesten" "miehiä" "miehinä" "miehissä" "miehiin" ;
ice_N = mkN "jää" ;
knee_N = mk2N "polvi" "polvia" ;
leaf_N = mk2N "lehti" "lehtiä" ;

View File

@@ -2,10 +2,10 @@
resource MakeStructuralFin = open CatFin, ParadigmsFin, MorphoFin, Prelude in {
oper
mkConj : Str -> Str -> ParadigmsFin.Number -> Conj = \x,y,n ->
oper
mkConj : Str -> Str -> ParadigmsFin.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 = <>} ; ----
@@ -23,7 +23,7 @@ oper
isNeg = isNeg ;
} ;
} ;
partDet : N -> Number -> Det = \s,n ->
lin Det (MorphoFin.partDet False n s) ;

View File

@@ -12,4 +12,4 @@ lin
MarkupPhr m phr = {s = appMark m phr.s} ;
MarkupText m txt = {s = appMark m txt.s} ;
}
}

View File

@@ -15,25 +15,25 @@ resource MorphoFin = ResFin ** open Prelude in {
oper
dLujuus : Str -> NForms = \lujuus ->
dLujuus : Str -> NForms = \lujuus ->
let
lujuu = init lujuus ;
lujuuksi = lujuu + "ksi" ;
a = vowHarmony (last lujuu) ;
in nForms10
lujuus (lujuu + "den") (lujuu + "tt" + a)
lujuus (lujuu + "den") (lujuu + "tt" + a)
(lujuu + "ten" + a) (lujuu + "teen")
(lujuuksi + "en") (lujuuksi + a)
(lujuuksi + "n" + a) (lujuuksi + "ss" + a) (lujuuksi + "in") ;
(lujuuksi + "en") (lujuuksi + a)
(lujuuksi + "n" + a) (lujuuksi + "ss" + a) (lujuuksi + "in") ;
dNainen : Str -> NForms = \nainen ->
let
let
a = vowHarmony nainen ;
nais = Predef.tk 3 nainen + "s"
in nForms11
nainen (nais + "en") (nais + "t" + a) (nais + "en" + a) (nais + "een")
(nais + "ten") (nais + "i" + a)
(nais + "in" + a) (nais + "iss" + a) (nais + "iin") nais ;
(nais + "ten") (nais + "i" + a)
(nais + "in" + a) (nais + "iss" + a) (nais + "iin") nais ;
dPaluu : Str -> NForms = \paluu ->
let
@@ -42,7 +42,7 @@ resource MorphoFin = ResFin ** open Prelude in {
u = last paluu ;
in nForms10
paluu (paluu + "n") (paluu + "t" + a) (paluu + "n" + a) (paluu + "seen")
(palui + "den") (palui + "t" + a)
(palui + "den") (palui + "t" + a)
(palui + "n" + a) (palui + "ss" + a) (palui + "siin") ;
dPuu : Str -> NForms = \puu ->
@@ -52,7 +52,7 @@ resource MorphoFin = ResFin ** open Prelude in {
u = last puu ;
in nForms10
puu (puu + "n") (puu + "t" + a) (puu + "n" + a) (puu + "h" + u + "n")
(pui + "den") (pui + "t" + a)
(pui + "den") (pui + "t" + a)
(pui + "n" + a) (pui + "ss" + a) (pui + "hin") ;
dSuo : Str -> NForms = \suo ->
@@ -62,7 +62,7 @@ resource MorphoFin = ResFin ** open Prelude in {
soi = Predef.tk 2 suo + o + "i" ;
in nForms10
suo (suo + "n") (suo + "t" + a) (suo + "n" + a) (suo + "h" + o + "n")
(soi + "den") (soi + "t" + a)
(soi + "den") (soi + "t" + a)
(soi + "n" + a) (soi + "ss" + a) (soi + "hin") ;
dKorkea : Str -> NForms = \korkea ->
@@ -70,10 +70,10 @@ resource MorphoFin = ResFin ** open Prelude in {
a = last korkea ;
korke = init korkea ;
in nForms10
korkea (korkea + "n") (korkea + a)
korkea (korkea + "n") (korkea + a)
(korkea + "n" + a) (korkea + a + "n")
(korke + "iden") (korke + "it" + a)
(korke + "in" + a) (korke + "iss" + a)
(korke + "iden") (korke + "it" + a)
(korke + "in" + a) (korke + "iss" + a)
(korke + "isiin") ; --- NSSK: korkeihin
dKaunis : Str -> NForms = \kaunis ->
@@ -81,10 +81,10 @@ resource MorphoFin = ResFin ** open Prelude in {
a = vowHarmony kaunis ;
kaunii = init kaunis + "i" ;
in nForms10
kaunis (kaunii + "n") (kaunis + "t" + a)
kaunis (kaunii + "n") (kaunis + "t" + a)
(kaunii + "n" + a) (kaunii + "seen")
(kaunii + "den") (kaunii + "t" + a)
(kaunii + "n" + a) (kaunii + "ss" + a)
(kaunii + "den") (kaunii + "t" + a)
(kaunii + "n" + a) (kaunii + "ss" + a)
(kaunii + "siin") ;
dLiitin : (_,_ : Str) -> NForms = \liitin,liittimen ->
@@ -92,10 +92,10 @@ resource MorphoFin = ResFin ** open Prelude in {
a = vowHarmony liitin ;
liittim = Predef.tk 2 liittimen ;
in nForms10
liitin (liittim + "en") (liitin + "t" + a)
liitin (liittim + "en") (liitin + "t" + a)
(liittim + "en" + a) (liittim + "een")
(liittim + "ien") (liittim + "i" + a)
(liittim + "in" + a) (liittim + "iss" + a)
(liittim + "ien") (liittim + "i" + a)
(liittim + "in" + a) (liittim + "iss" + a)
(liittim + "iin") ;
dOnneton : Str -> NForms = \onneton ->
@@ -103,10 +103,10 @@ resource MorphoFin = ResFin ** open Prelude in {
a = vowHarmony onneton ;
onnettom = Predef.tk 2 onneton + "t" + last (init onneton) + "m" ;
in nForms10
onneton (onnettom + a + "n") (onneton + "t" + a)
onneton (onnettom + a + "n") (onneton + "t" + a)
(onnettom + a + "n" + a) (onnettom + a + a + "n")
(onnettom + "ien") (onnettom + "i" + a)
(onnettom + "in" + a) (onnettom + "iss" + a)
(onnettom + "ien") (onnettom + "i" + a)
(onnettom + "in" + a) (onnettom + "iss" + a)
(onnettom + "iin") ;
-- 2-syllable a/ä, o/ö, u/y
@@ -118,7 +118,7 @@ resource MorphoFin = ResFin ** open Prelude in {
uko = init ukon ;
uk = init uko ;
ukkoja = case <ukko : Str> of {
_ + "ä" => -- kylä,kyliä,kylien,kylissä,kyliin
_ + "ä" => -- kylä,kyliä,kylien,kylissä,kyliin
<ukk + "iä", ukk + "ien", ukk, uk, ukk + "iin"> ;
_ + ("au" | "eu") + _ + "a" => -- kauhojen,seurojen
<ukk + "oja",ukk + "ojen",ukk + "o", uk + "o", ukk + "oihin"> ;
@@ -129,12 +129,12 @@ resource MorphoFin = ResFin ** open Prelude in {
_ => -- suku,sukuja,sukujen,-uissa,-uihin
<ukko + "j" + a,ukko + "jen",ukko, uko, ukko + "ihin">
} ;
ukkoina = ukkoja.p3 + "in" + a ;
ukkoina = ukkoja.p3 + "in" + a ;
ukoissa = ukkoja.p4 + "iss" + a ;
in nForms10
ukko ukon (ukko + a) (ukko + "n" + a) (ukko + o + "n")
ukkoja.p2 ukkoja.p1
ukkoina ukoissa ukkoja.p5 ;
ukkoina ukoissa ukkoja.p5 ;
-- 3-syllable a/ä/o/ö
dSilakka : (_,_,_ : Str) -> NForms = \silakka,silakan,silakoita ->
@@ -155,14 +155,14 @@ resource MorphoFin = ResFin ** open Prelude in {
<silakka+a,silakk+O+"jen",silakk+O, silak+O, silakk +O+ "ihin"> ;
_ + O@("o" | "ö" | "u" | "y" | "e") + ("ita" | "itä") => -- silakoita
<silakkaa, silak+O+"iden",silakk+O, silak+O, silakk +O+ "ihin"> ;
_ => Predef.error silakoita
_ => Predef.error silakoita
} ;
silakkoina = silakoiden.p3 + "in" + a ;
silakkoina = silakoiden.p3 + "in" + a ;
silakoissa = silakoiden.p4 + "iss" + a ;
in nForms10
silakka silakan silakoiden.p1 (silakka + "n" + a) (silakka + o + "n")
silakoiden.p2 silakoita
silakkoina silakoissa silakoiden.p5 ;
silakkoina silakoissa silakoiden.p5 ;
dArpi : (_,_ : Str) -> NForms = \arpi,arven ->
let
@@ -178,16 +178,16 @@ resource MorphoFin = ResFin ** open Prelude in {
<arp + "t" + a,arp + "ien",arpi, arp>
} ;
"r" | "n" => -- suurta,suurten
<arp + "t" + a,arp + "ten",arpi, arp>;
<arp + "t" + a,arp + "ten",arpi, arp>;
"l" | "h" => -- tuulta,tuulien
<arp + "t" + a,arp + "ien",arpi, arp>;
<arp + "t" + a,arp + "ien",arpi, arp>;
_ => -- arpea,arpien,arvissa
<arp + "e" + a,arp + "ien",arv+"i",arp>
<arp + "e" + a,arp + "ien",arv+"i",arp>
} ; ---- pieni,pientä; uni,unta
in nForms10
arpi arven arpe.p1 (arpe.p4 + "en" + a) (arpe.p4 + "een")
arpe.p2 (arpi + a)
(arp + "in" + a) (arpe.p3 + "ss" + a) (arp + "iin") ;
(arp + "in" + a) (arpe.p3 + "ss" + a) (arp + "iin") ;
dRae : (_,_ : Str) -> NForms = \rae,rakeen ->
let
@@ -195,17 +195,17 @@ resource MorphoFin = ResFin ** open Prelude in {
rakee = init rakeen ;
rakei = init rakee + "i" ;
raetta = case <rae : Str> of {
_ + "e" =>
_ + "e" =>
<rae + "tt" + a, rakee + "seen"> ; -- raetta,rakeeseen
_ + "u" =>
_ + "u" =>
<rae + "tt" + a, rakee + "seen"> ; -- kiiru, kiiruuseen
_ + "i" =>
_ + "i" =>
<rae + "tt" + a, rakee + "seen"> ; -- ori, oriin
_ + "s" =>
_ + "s" =>
<rae + "t" + a, rakee + "seen"> ; -- rengasta,renkaaseen
_ + "t" =>
_ + "t" =>
<rae + "t" + a, rakee + "en"> ; -- olutta,olueen
_ + "r" =>
_ + "r" =>
<rae + "t" + a, rakee + "en"> ; -- sisarta,sisareen
_ => Predef.error (["expected ending e/t/s/r, found"] ++ rae)
} ;
@@ -222,8 +222,8 @@ resource MorphoFin = ResFin ** open Prelude in {
paate = init paati + "e" ;
in nForms10
paatti paatin (paatti + a) (paatti + "n" + a) (paatti + "in")
(paatti + "en") (paatte + "j" + a)
(paatte + "in" + a) (paate + "iss" + a) (paatte + "ihin") ;
(paatti + "en") (paatte + "j" + a)
(paatte + "in" + a) (paate + "iss" + a) (paatte + "ihin") ;
dTohtori : (_ : Str) -> NForms = \tohtori ->
let
@@ -231,24 +231,24 @@ resource MorphoFin = ResFin ** open Prelude in {
tohtor = init tohtori ;
in nForms10
tohtori (tohtori+"n") (tohtori + a) (tohtori + "n" + a) (tohtori + "in")
(tohtor + "eiden") (tohtor + "eit" + a)
(tohtor + "ein" + a) (tohtor + "eiss" + a) (tohtor + "eihin") ;
(tohtor + "eiden") (tohtor + "eit" + a)
(tohtor + "ein" + a) (tohtor + "eiss" + a) (tohtor + "eihin") ;
dPiennar : (_,_ : Str) -> NForms = \piennar,pientaren ->
let
let
a = vowHarmony piennar ;
pientar = Predef.tk 2 pientaren ;
in nForms10
piennar pientaren (piennar +"t" + a)
piennar pientaren (piennar +"t" + a)
(pientar + "en" + a) (pientar + "een")
(piennar + "ten") (pientar + "i" + a) (pientar + "in" + a)
(pientar + "iss" + a) (pientar + "iin") ;
dUnix : (_ : Str) -> NForms = \unix ->
let
let
a = vowHarmony unix ;
unixi = unix + "i" ;
unixe = unix + "e" ;
unixi = unix + "i" ;
unixe = unix + "e" ;
in nForms10
unix (unixi + "n") (unixi + a) (unixi + "n" + a) (unixi + "in")
(unixi + "en") (unixe + "j" + a) (unixe + "in" + a)
@@ -265,45 +265,45 @@ resource MorphoFin = ResFin ** open Prelude in {
(nukk + "ien") (nukk + "ej" + a) (nukk + "ein" + a)
(nuke + "iss" + a) (nukk + "eihin") ;
dJalas : Str -> NForms = \jalas ->
dJalas : Str -> NForms = \jalas ->
let
a = vowHarmony jalas ;
jalaks = init jalas + "ks" ;
jalaksi = jalaks + "i" ;
in nForms10
jalas (jalaks + "en") (jalas + "t" + a)
jalas (jalaks + "en") (jalas + "t" + a)
(jalaks + "en" + a) (jalaks + "een")
(jalas + "ten") (jalaksi + a)
(jalaksi + "n" + a) (jalaksi + "ss" + a) (jalaksi + "in") ;
(jalas + "ten") (jalaksi + a)
(jalaksi + "n" + a) (jalaksi + "ss" + a) (jalaksi + "in") ;
dSDP : Str -> NForms = \SDP ->
let
let
c = case Predef.toUpper (last SDP) of {
"A" =>
"A" =>
<"n","ta","na","han","iden","ita","ina","issa","ihin"> ;
"B" | "C" | "D" | "E" | "G" | "P" | "T" | "V" | "W" =>
"B" | "C" | "D" | "E" | "G" | "P" | "T" | "V" | "W" =>
<"n","tä","nä","hen","iden","itä","inä","issä","ihin"> ;
"F" | "L" | "M" | "N" | "R" | "S" | "X" =>
"F" | "L" | "M" | "N" | "R" | "S" | "X" =>
<"n","ää","nä","ään","ien","iä","inä","issä","iin"> ;
"H" | "K" | "O" | "Å" =>
"H" | "K" | "O" | "Å" =>
<"n","ta","na","hon","iden","ita","ina","issa","ihin"> ;
"I" | "J" =>
"I" | "J" =>
<"n","tä","nä","hin","iden","itä","inä","issä","ihin"> ;
"Q" | "U" =>
"Q" | "U" =>
<"n","ta","na","hun","iden","ita","ina","issa","ihin"> ;
"Z" =>
"Z" =>
<"n","aa","na","aan","ojen","oja","oina","oissa","oihin"> ;
"Ä" =>
"Ä" =>
<"n","tä","nä","hän","iden","itä","inä","issä","ihin"> ;
"Ö" =>
"Ö" =>
<"n","tä","nä","hön","iden","itä","inä","issä","ihin"> ;
"Y" =>
"Y" =>
<"n","tä","nä","hyn","iden","itä","inä","issä","ihin"> ;
_ => Predef.error (["illegal abbreviation"] ++ SDP)
} ;
in nForms10
SDP (SDP + ":" + c.p1) (SDP + ":" + c.p2) (SDP + ":" + c.p3)
(SDP + ":" + c.p4) (SDP + ":" + c.p5) (SDP + ":" + c.p6)
SDP (SDP + ":" + c.p1) (SDP + ":" + c.p2) (SDP + ":" + c.p3)
(SDP + ":" + c.p4) (SDP + ":" + c.p5) (SDP + ":" + c.p6)
(SDP + ":" + c.p7) (SDP + ":" + c.p8) (SDP + ":" + c.p9) ;
-- for adjective comparison
@@ -314,10 +314,10 @@ resource MorphoFin = ResFin ** open Prelude in {
suuremp = init suurempi ;
suuremm = Predef.tk 2 suurempi + "m" ;
in nForms10
suurempi (suuremm + a + "n") (suuremp + a + a)
suurempi (suuremm + a + "n") (suuremp + a + a)
(suuremp + a + "n" + a) (suuremp + a + a + "n")
(suuremp + "ien") (suurempi + a)
(suurempi + "n" + a) (suuremm + "iss" + a) (suurempi + "in") ;
(suuremp + "ien") (suurempi + a)
(suurempi + "n" + a) (suuremm + "iss" + a) (suurempi + "in") ;
dSuurin : Str -> NForms = \suurin ->
let
@@ -325,10 +325,10 @@ resource MorphoFin = ResFin ** open Prelude in {
suurimm = init suurin + "mm" ;
suurimp = init suurimm + "p" ;
in nForms10
suurin (suurimm + a + "n") (suurin + "t" + a)
suurin (suurimm + a + "n") (suurin + "t" + a)
(suurimp + a + "n" + a) (suurimp + a + a + "n")
(suurimp + "ien") (suurimp + "i" + a)
(suurimp + "in" + a) (suurimm + "iss" + a) (suurimp + "iin") ;
(suurimp + "ien") (suurimp + "i" + a)
(suurimp + "in" + a) (suurimm + "iss" + a) (suurimp + "iin") ;
-- for verb participle forms
@@ -338,10 +338,10 @@ resource MorphoFin = ResFin ** open Prelude in {
ottane = Predef.tk 2 ottanut + "e" ;
ottanee = ottane + "e" ;
in nForms10
ottanut (ottanee + "n") (ottanut + "t" + a)
ottanut (ottanee + "n") (ottanut + "t" + a)
(ottanee + "n" + a) (ottanee + "seen")
(ottane + "iden") (ottane + "it" + a)
(ottane + "in" + a) (ottane + "iss" + a) (ottane + "isiin") ;
(ottane + "iden") (ottane + "it" + a)
(ottane + "in" + a) (ottane + "iss" + a) (ottane + "isiin") ;
-------------------
-- auxiliaries ----
@@ -351,7 +351,7 @@ resource MorphoFin = ResFin ** open Prelude in {
NForms : Type = Predef.Ints 10 => Str ;
nForms10 : (x1,_,_,_,_,_,_,_,_,x10 : Str) -> NForms =
nForms10 : (x1,_,_,_,_,_,_,_,_,x10 : Str) -> NForms =
\Ukko,ukon,ukkoa,ukkona,ukkoon,
ukkojen,ukkoja,ukkoina,ukoissa,ukkoihin -> table {
0 => Ukko ;
@@ -366,8 +366,8 @@ resource MorphoFin = ResFin ** open Prelude in {
9 => ukkoihin ;
10 => Ukko
} ;
nForms11 : (x1,_,_,_,_,_,_,_,_,_,x11 : Str) -> NForms =
nForms11 : (x1,_,_,_,_,_,_,_,_,_,x11 : Str) -> NForms =
\Ukko,ukon,ukkoa,ukkona,ukkoon,
ukkojen,ukkoja,ukkoina,ukoissa,ukkoihin,ukko_ -> table {
0 => Ukko ;
@@ -385,7 +385,7 @@ resource MorphoFin = ResFin ** open Prelude in {
Noun = {s : NForm => Str; h : Harmony} ;
nForms2N : NForms -> Noun = \f ->
nForms2N : NForms -> Noun = \f ->
let
Ukko = f ! 0 ;
ukon = f ! 1 ;
@@ -404,12 +404,12 @@ resource MorphoFin = ResFin ** open Prelude in {
ukko = Predef.tk 2 ukkona ;
ukkoi = Predef.tk 2 ukkoina ;
ukoi = Predef.tk 3 ukoissa ;
harmony : Harmony = case a of
harmony : Harmony = case a of
{"a" => Back ; _ => Front } ;
in
in
{s = table {
NCase Sg Nom => Ukko ;
NCase Sg Gen => uko + "n" ;
NCase Sg Gen => ukon ;
NCase Sg Part => ukkoa ;
NCase Sg Transl => uko + "ksi" ;
NCase Sg Ess => ukkona ;
@@ -477,22 +477,22 @@ resource MorphoFin = ResFin ** open Prelude in {
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) ;
@@ -508,7 +508,7 @@ resource MorphoFin = ResFin ** open Prelude in {
oper
cHukkua : (_,_ : Str) -> VForms = \hukkua,hukun ->
cHukkua : (_,_ : Str) -> VForms = \hukkua,hukun ->
let
a = last hukkua ;
hukku = init hukkua ;
@@ -519,8 +519,8 @@ resource MorphoFin = ResFin ** open Prelude in {
_ => u
} ;
y = uyHarmony a ;
hukkui = init hukku + i + "i" ;
hukui = init huku + i + "i" ;
hukkui = init hukku + i + "i" ;
hukui = init huku + i + "i" ;
in vForms12
hukkua
hukun
@@ -535,7 +535,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(huku + "tt" + y)
(hukku + "nee") ;
cOttaa : (_,_,_,_ : Str) -> VForms = \ottaa,otan,otin,otti ->
cOttaa : (_,_,_,_ : Str) -> VForms = \ottaa,otan,otin,otti ->
let
a = last ottaa ;
aa = a + a ;
@@ -547,8 +547,8 @@ resource MorphoFin = ResFin ** open Prelude in {
ottaa
otan
ottaa
(otta + "v" + a + "t")
(otta + "k" + aa)
(otta + "v" + a + "t")
(otta + "k" + aa)
(ote + "t" + aa + "n")
otin
otti
@@ -557,7 +557,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(ote + "tt" + u)
(otta + "nee") ;
cJuosta : (_,_ : Str) -> VForms = \juosta,juoksen ->
cJuosta : (_,_ : Str) -> VForms = \juosta,juoksen ->
let
a = last juosta ;
juos = Predef.tk 2 juosta ;
@@ -580,7 +580,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(juos + "t" + u)
(juoss + "ee") ;
cJuoda : (_ : Str) -> VForms = \juoda ->
cJuoda : (_ : Str) -> VForms = \juoda ->
let
a = last juoda ;
juo = Predef.tk 2 juoda ;
@@ -605,7 +605,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(juo + "t" + u)
(juo + "nee") ;
cPudota : (_,_ : Str) -> VForms = \pudota,putosi ->
cPudota : (_,_ : Str) -> VForms = \pudota,putosi ->
let
a = last pudota ;
pudot = init pudota ;
@@ -630,7 +630,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(pudot + "t" + u)
(pudo + "nnee") ;
cHarkita : (_ : Str) -> VForms = \harkita ->
cHarkita : (_ : Str) -> VForms = \harkita ->
let
a = last harkita ;
harkit = init harkita ;
@@ -650,7 +650,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(harkit + "t" + u)
(harki + "nnee") ;
cValjeta : (_,_ : Str) -> VForms = \valjeta,valkeni ->
cValjeta : (_,_ : Str) -> VForms = \valjeta,valkeni ->
let
a = last valjeta ;
valjet = init valjeta ;
@@ -671,7 +671,7 @@ resource MorphoFin = ResFin ** open Prelude in {
(valjet + "t" + u)
(valje + "nnee") ;
cKuunnella : (_,_ : Str) -> VForms = \kuunnella,kuuntelin ->
cKuunnella : (_,_ : Str) -> VForms = \kuunnella,kuuntelin ->
let
a = last kuunnella ;
kuunnel = Predef.tk 2 kuunnella ;
@@ -701,7 +701,7 @@ resource MorphoFin = ResFin ** open Prelude in {
VForms : Type = Predef.Ints 11 => Str ;
vForms12 : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> VForms =
vForms12 : (x1,_,_,_,_,_,_,_,_,_,_,x12 : Str) -> VForms =
\olla,olen,on,ovat,olkaa,ollaan,olin,oli,olisi,ollut,oltu,lienee ->
table {
0 => olla ;
@@ -718,16 +718,16 @@ resource MorphoFin = ResFin ** open Prelude in {
11 => lienee
} ;
vforms2V : VForms -> Verb ** {qp : Bool} = \vh ->
vforms2V : VForms -> Verb ** {qp : Bool} = \vh ->
let
tulla = vh ! 0 ;
tulla = vh ! 0 ;
tull = init tulla ;
tulen = vh ! 1 ;
tulee = vh ! 2 ;
tulen = vh ! 1 ;
tulee = vh ! 2 ;
tulevat = vh ! 3 ;
tulkaa = vh ! 4 ;
tullaan = vh ! 5 ;
tulin = vh ! 6 ;
tulkaa = vh ! 4 ;
tullaan = vh ! 5 ;
tulin = vh ! 6 ;
tuli = vh ! 7 ;
tulisi = vh ! 8 ;
tullut = vh ! 9 ;
@@ -744,7 +744,7 @@ resource MorphoFin = ResFin ** open Prelude in {
tulleen = (nForms2N (dOttanut tullut)).s ;
tullu : Str = weakGrade tultu ;
tullun = (nForms2N (dUkko tultu (tullu + "n"))).s ;
tule__ = Predef.tk 3 tulevat ;
tule__ = Predef.tk 3 tulevat ;
tulema = tule__ + "m" + a ;
tuleva = tule__ + "v" + a ;
vat = "v" + a + "t" ;
@@ -769,7 +769,7 @@ resource MorphoFin = ResFin ** open Prelude in {
Inf Inf3Instr => tulema + "n" ;
Inf Inf3InstrPass => tult + a + "m" + a + "n" ;
Inf Inf4Nom => tule__ + "minen" ;
Inf Inf4Part => tule__ + "mist" + a ;
Inf Inf4Part => tule__ + "mist" + a ;
Inf Inf5 => tulema + "isill" + a ;
Inf InfPresPart => tuleva + "n" ;
Inf InfPresPartAgr => tuleva ;
@@ -861,9 +861,9 @@ resource MorphoFin = ResFin ** open Prelude in {
("k"|"p") + "t" + _ => kukko ; -- *projekti-projekdin
"uku" => ku + "uvu" ;
"yky" => ku + "yvy" ;
x + "k" + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") => ku + x + o ;
x + "p" + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") => ku + x + "v" + o ;
x + "t" + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") => ku + x + "d" + o ;
x + "k" + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") => ku + x + o ;
x + "p" + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") => ku + x + "v" + o ;
x + "t" + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") => ku + x + "d" + o ;
_ => kukko
} ;
@@ -872,8 +872,8 @@ resource MorphoFin = ResFin ** open Prelude in {
strongGrade : Str -> Str = \hanke ->
let
ha = Predef.tk 3 hanke ;
nke = Predef.dp 3 hanke ;
in
nke = Predef.dp 3 hanke ;
in
ha + case nke of {
"ng" + a => "nk" + a ;
"nn" + e => "nt" + e ;
@@ -881,9 +881,9 @@ resource MorphoFin = ResFin ** open Prelude in {
"rr" + e => "rt" + e ;
"ll" + a => "lt" + a ;
h@("h" | "l") + "je" + e => h + "ke" ; -- pohje/lahje impossible
("tk" | "hk" | "sk" | "sp" | "st") + _ => nke ; -- viuhke,kuiske
("tk" | "hk" | "sk" | "sp" | "st") + _ => nke ; -- viuhke,kuiske
a + k@("k"|"p"|"t") + e@("e"|"a"|"ä"|"u"|"y"|"i"|"o"|"ö") => a + k + k + e ;
a + "d" + e@("e"|"a"|"ä"|"u"|"i"|"o"|"ö") => a + "t" + e ;
a + "d" + e@("e"|"a"|"ä"|"u"|"i"|"o"|"ö") => a + "t" + e ;
s + a@("a"|"ä"|"o"|"ö") + "e" => s + a + "ke" ; -- säe, tae, koe
s + "u" + i@("i"|"e") => s + "uk" + i ; -- ruis, aueta
s + "aa" => s + "aka" ; -- taata
@@ -911,7 +911,7 @@ resource MorphoFin = ResFin ** open Prelude in {
-- for Structural
-----------------------
caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
\\c => cn.s ! NCase n c ;
mkDet = mkDetPol False ;
@@ -940,16 +940,16 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
-- Here we define personal and relative pronouns.
-- Personal pronouns have possessive suffix (hänen talonsa) but "se" doesn't (sen talo)
mkPronoun : (_,_,_,_,_ : Str) -> Number -> Person ->
mkPronoun : (_,_,_,_,_ : Str) -> Number -> Person ->
{s : NPForm => Str ; a : Agr ; hasPoss : Bool ; poss : Str} = mkPronounGen True ;
mkPronounGen : Bool -> (_,_,_,_,_ : Str) -> Number -> Person ->
{s : NPForm => Str ; a : Agr ; hasPoss : Bool ; poss : Str} =
mkPronounGen : Bool -> (_,_,_,_,_ : Str) -> Number -> Person ->
{s : NPForm => Str ; a : Agr ; hasPoss : Bool ; poss : Str} =
\hasPoss, mina, minun, minua, minuna, minuun, n, p ->
let {
minu = Predef.tk 2 minuna ;
a = Predef.dp 1 minuna
} in
} in
{s = table {
NPCase Nom | NPSep => mina ;
NPCase Gen => minun ;
@@ -968,10 +968,10 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
a = Ag n p ;
hasPoss = hasPoss ;
poss = minun ;
} ;
} ;
mkDemPronoun : (_,_,_,_,_ : Str) -> Number ->
{s : NPForm => Str ; a : Agr} =
mkDemPronoun : (_,_,_,_,_ : Str) -> Number ->
{s : NPForm => Str ; a : Agr} =
\tuo, tuon, tuota, tuona, tuohon, n ->
let pro = mkPronoun tuo tuon tuota tuona tuohon n P3
in {
@@ -982,7 +982,7 @@ caseTable : Number -> CommonNoun -> Case => Str = \n,cn ->
a = pro.a
} ;
-- The relative pronoun, "joka", is inflected in case and number,
-- 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".
@@ -994,7 +994,7 @@ oper
Nom => "joka" ;
Gen => "jonka" ;
c => jo.s ! NCase Sg c
} ;
} ;
Pl => table {
Nom => "jotka" ;
c => "j" + (jo.s ! NCase Pl c)

View File

@@ -6,15 +6,15 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, 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.isPoss, det.isDef> of {
<_, NPAcc, True,_,_> => <Nom,NCase Sg Part> ; -- myin kolme kytkintä(ni)
<_, NPCase Nom | NPSep, True,_,_> => <Nom,NCase Sg Part> ; -- kolme kytkintä(ni) on
@@ -25,11 +25,11 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
<_, NPCase Gen,_,True,_> => <k, NPossGen n> ; -- kytkime+ni vika
<_, NPCase Transl,_,True,_> => <k, NPossTransl n> ; -- kytkim(e|i)kse+ni
<_, NPCase Illat,_,True,_> => <k, NPossIllat n> ; -- kytkim(ee|ii)+ni
_ => <k, NCase n k> -- kytkin, kytkimen,...
}
in {
s = \\c => let
s = \\c => let
k = ncase c ;
in
det.s1 ! k.p1 ++ cn.s ! k.p2 ++ det.s2 ! cn.h ;
@@ -40,7 +40,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
isPron = False ; isNeg = det.isNeg
} ;
DetNP det =
DetNP det =
let
n : Number = case det.isNum of {
True => Sg ;
@@ -48,7 +48,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
} ;
in {
s = \\c => let k = npform2case n c in
det.sp ! k ; -- det.s2 is possessive suffix
det.sp ! k ; -- det.s2 is possessive suffix
a = agrP3 (case det.isDef of {
False => Sg ; -- autoja menee; kolme autoa menee
_ => det.n
@@ -57,7 +57,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
} ;
UsePN pn = {
s = snoun2np Sg pn ;
s = snoun2np Sg pn ;
a = agrP3 Sg ;
isPron = False ; isNeg = False
} ;
@@ -92,8 +92,8 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
} ;
DetQuantOrd quant num ord = {
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
sp = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
sp = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! NCase num.n c ;
s2 = quant.s2 ;
n = num.n ;
isNum = num.isNum ;
@@ -105,7 +105,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
DetQuant quant num = {
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ;
sp = \\c => case num.isNum of {
True => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ; -- 0 kolme with Indef
True => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ; -- 0 kolme with Indef
False => quant.sp ! num.n ! c ++ num.s ! Sg ! c -- yksi 0
} ;
s2 = quant.s2 ;
@@ -119,7 +119,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
s1 = \\_,_ => p.poss ; -- [] in det position with proDrop
sp = \\_,_ => p.s ! NPCase Gen ; -- to prevent [] with proDrop
s2 = case p.hasPoss of {
True => table {Front => BIND ++ possSuffixFront p.a ;
True => table {Front => BIND ++ possSuffixFront p.a ;
Back => BIND ++ possSuffix p.a } ;
False => \\_ => []
} ;
@@ -135,19 +135,19 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
NumCard n = n ** {isNum = case n.n of {Sg => False ; _ => True}} ; -- yksi talo/kaksi taloa
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 = \\f => numeral.s ! NOrd f} ;
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 = \\f => numeral.s ! NOrd f} ;
AdNum adn num = {
s = \\n,c => adn.s ++ num.s ! n ! c ;
s = \\n,c => adn.s ++ num.s ! n ! c ;
n = num.n
} ;
@@ -157,7 +157,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
{s = \\f => n.s ! NOrd (NCase Sg Transl) ++ (snoun2nounSep {s = \\nc => a.s ! Superl ! sAN nc ; h = a.h}).s ! f} ;
DefArt = {
s1 = \\_,_ => [] ;
s1 = \\_,_ => [] ;
sp = table {Sg => pronSe.s ; Pl => pronNe.s} ;
s2 = \\_ => [] ;
isNum,isPoss,isNeg = False ;
@@ -166,10 +166,10 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
IndefArt = {
s1 = \\_,_ => [] ; -- Nom is Part in Pl: use isDef in DetCN
sp = \\n,c =>
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
sp = \\n,c =>
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
"yksien" "yksiä" "yksiin")).s ! NCase n c ;
s2 = \\_ => [] ;
s2 = \\_ => [] ;
isNum,isPoss,isDef,isNeg = False -- autoja on
} ;
@@ -179,7 +179,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, 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 ; isNeg = False
} ;
@@ -210,7 +210,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
ComplN3 f x = {
s = \\nf => preOrPost f.isPre (f.s ! nf) (appCompl True Pos f.c2 x) ;
c2 = f.c3 ;
h = f.h ;
h = f.h ;
isPre = f.isPre2
} ;
@@ -224,8 +224,8 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
h = cn.h } ;
RelNP np rs = {
s = \\c => np.s ! c ++ BIND ++ "," ++ rs.s ! np.a ;
a = np.a ;
s = \\c => np.s ! c ++ BIND ++ "," ++ rs.s ! np.a ;
a = np.a ;
isPron = np.isPron ; ---- correct ?
isNeg = np.isNeg
} ;
@@ -236,19 +236,19 @@ concrete NounFin of Noun = CatFin ** open ResFin, MorphoFin, StemFin, Prelude in
SentCN cn sc = {s = \\nf=> cn.s ! nf ++ sc.s;
h = cn.h } ;
ApposCN cn np = {s = \\nf=> cn.s ! nf ++ np.s ! NPSep ;
ApposCN cn np = {s = \\nf=> cn.s ! nf ++ np.s ! NPSep ;
h = cn.h } ; --- luvun x
PossNP cn np = {s = \\nf => np.s ! NPCase Gen ++ cn.s ! nf ;
h = cn.h
PossNP cn np = {s = \\nf => np.s ! NPCase Gen ++ cn.s ! nf ;
h = cn.h
} ;
PartNP cn np = {s = \\nf => cn.s ! nf ++ np.s ! NPCase Part ;
h = cn.h ---- gives "lasin viiniänsa" ; should be "lasinsa viiniä"
PartNP cn np = {s = \\nf => cn.s ! nf ++ np.s ! NPCase Part ;
h = cn.h ---- gives "lasin viiniänsa" ; should be "lasinsa viiniä"
} ;
CountNP det np =
CountNP det np =
let
n : Number = case det.isNum of {
True => Sg ;

View File

@@ -6,39 +6,39 @@ concrete NumeralFin of Numeral = CatFin [Numeral,Digits] ** open Prelude, Parad
flags optimize = all_subs ;
coding=utf8 ;
lincat
lincat
Sub1000000 = {s : CardOrd => Str ; n : MorphoFin.Number} ;
Digit = {s : CardOrd => Str} ;
Sub10, Sub100, Sub1000 = {s : NumPlace => CardOrd => Str ; n : MorphoFin.Number} ;
lin
lin
num x = x ;
n2 = kaksi_toinenN ;
n3 = co
n3 = co
(nhn (mkSubst "a" "kolme" "kolme" "kolme" "kolmea" "kolmeen" "kolmi" "kolmi"
"kolmien" "kolmia" "kolmiin"))
(ordN "a" "kolmas") ;
n4 = co (snoun2nounBind (mkN "neljä")) (ordN "ä" "neljäs") ;
n5 = co (snoun2nounBind (mkN "viisi" "viiden" "viisiä")) (ordN "ä" "viides") ;
n6 = co (snoun2nounBind (mkN "kuusi" "kuuden" "kuusia")) (ordN "a" "kuudes") ;
n7 = co
(nhn (mkSubst "ä" "seitsemän" "seitsemä" "seitsemä" "seitsemää"
n6 = co (snoun2nounBind (mkN "kuusi" "kuuden" "kuusia")) (ordN "a" "kuudes") ;
n7 = co
(nhn (mkSubst "ä" "seitsemän" "seitsemä" "seitsemä" "seitsemää"
"seitsemään" "seitsemi" "seitsemi" "seitsemien" "seitsemiä"
"seitsemiin"))
(ordN "ä" "seitsemäs") ;
n8 = co
(nhn (mkSubst "a" "kahdeksan" "kahdeksa" "kahdeksa" "kahdeksaa"
n8 = co
(nhn (mkSubst "a" "kahdeksan" "kahdeksa" "kahdeksa" "kahdeksaa"
"kahdeksaan" "kahdeksi" "kahdeksi" "kahdeksien" "kahdeksia"
"kahdeksiin"))
(ordN "a" "kahdeksas") ;
n9 = co
(nhn (mkSubst "ä" "yhdeksän" "yhdeksä" "yhdeksä" "yhdeksää"
(nhn (mkSubst "ä" "yhdeksän" "yhdeksä" "yhdeksä" "yhdeksää"
"yhdeksään" "yhdeksi" "yhdeksi" "yhdeksien" "yhdeksiä" "yhdeksiin"))
(ordN "ä" "yhdeksäs") ;
pot01 =
pot01 =
{s = table {
NumAttr => \\_ => [] ;
NumAttr => \\_ => [] ;
NumIndep => yksi_ensiN.s
} ;
n = Sg
@@ -55,14 +55,14 @@ lin
pot1 d = {n = Pl ; s = \\_,c => d.s ! c ++ BIND ++ kymmentaN.s ! c} ;
pot1plus d e = {
n = Pl ;
n = Pl ;
s = \\_,c => d.s ! c ++ BIND ++ kymmentaN.s ! c ++ BIND ++ e.s ! NumIndep ! c
} ;
pot1as2 n = n ;
pot2 d = {n = Pl ; s = \\_,c => d.s ! NumAttr ! c ++ nBIND d.n ++ sataaN.s ! d.n ! c} ; ----
pot2plus d e = {
n = Pl ;
s = \\_,c => d.s ! NumAttr ! c ++ nBIND d.n ++ sataaN.s ! d.n ! c ++
n = Pl ;
s = \\_,c => d.s ! NumAttr ! c ++ nBIND d.n ++ sataaN.s ! d.n ! c ++
BIND ++ e.s ! NumIndep ! c
} ;
pot2as3 n = {n = n.n ; s = n.s ! NumIndep} ;
@@ -85,38 +85,38 @@ oper
-- Too much trouble to infer vowel, cf. "kuudes" vs. "viides".
-- ordN : Str -> Str -> {s : NForm => Str} = \a,sadas ->
ordN : Str -> Str -> CommonNoun = \a,sadas ->
-- ordN : Str -> Str -> {s : NForm => Str} = \a,sadas ->
ordN : Str -> Str -> CommonNoun = \a,sadas ->
let
sada = init sadas
in
snoun2nounBind (mkN
snoun2nounBind (mkN
sadas (sada + "nnen") (sada + "tt" + a) (sada + "nten" + a) (sada + "nteen")
(sada + "nsien") (sada + "nsi" + a) (sada + "nsin" + a)
(sada + "nsiss" + a) (sada + "nsiin")) ;
param
param
NumPlace = NumIndep | NumAttr ;
oper
yksiN = co
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
"yksien" "yksiä" "yksiin"))
yksiN = co
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
"yksien" "yksiä" "yksiin"))
(ordN "ä" "yhdes") ; -- yhdestoista
yksi_ensiN = co
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
"yksien" "yksiä" "yksiin"))
yksi_ensiN = co
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
"yksien" "yksiä" "yksiin"))
(snoun2nounBind (mkN "ensimmäinen")) ; -- ensimmäinen ---- sadasensimmäinentuhannes
kaksi_toinenN = co
(nhn (mkSubst "a" "kaksi" "kahde" "kahte" "kahta" "kahteen" "kaksi" "kaksi"
kaksi_toinenN = co
(nhn (mkSubst "a" "kaksi" "kahde" "kahte" "kahta" "kahteen" "kaksi" "kaksi"
"kaksien" "kaksia" "kaksiin"))
(snoun2nounBind (mkN "toinen")) ;
kymmenenN = co
(nhn (mkSubst "ä" "kymmenen" "kymmene" "kymmene" "kymmentä"
"kymmeneen" "kymmeni" "kymmeni" "kymmenien" "kymmeniä" "kymmeniin"))
(snoun2nounBind (mkN "toinen")) ;
kymmenenN = co
(nhn (mkSubst "ä" "kymmenen" "kymmene" "kymmene" "kymmentä"
"kymmeneen" "kymmeni" "kymmeni" "kymmenien" "kymmeniä" "kymmeniin"))
(ordN "ä" "kymmenes") ;
sataN = co
(snoun2nounBind (mkN "sata"))
sataN = co
(snoun2nounBind (mkN "sata"))
(ordN "a" "sadas") ;
tuhatN = co
@@ -137,7 +137,7 @@ oper
NCard (NCase Sg Nom) => "sataa" ;
k => sataN.s ! k
}
}
}
} ;
tuhattaN = {s = table {
@@ -150,11 +150,11 @@ oper
} ;
lincat
lincat
Dig = TDigit ;
lin
IDig d = d ;
IDig d = d ;
IIDig d i = {
s = \\o => d.s ! NCard (NCase Sg Nom) ++ BIND ++ i.s ! o ;
@@ -187,4 +187,3 @@ oper
} ;
}

View File

@@ -4,12 +4,12 @@
--
-- 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 $MorphoFin.gf$ is that the types
-- referred to are compiled resource grammar types. We have moreover
@@ -21,9 +21,9 @@
-- a few arguments. In Finnish, one argument is enough in 80-90% of
-- cases in average.
resource ParadigmsFin = Kotus ** open
(Predef=Predef),
Prelude,
resource ParadigmsFin = Kotus ** open
(Predef=Predef),
Prelude,
MorphoFin,
CatFin, StemFin
in {
@@ -31,9 +31,9 @@ resource ParadigmsFin = Kotus ** 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 $ResFin$.
@@ -76,7 +76,7 @@ oper
casePrep : Case -> Prep ; -- just case, e.g. adessive
mkPrep = overload {
mkPrep : Case -> Prep
mkPrep : Case -> Prep
= casePrep ;
mkPrep : Str -> Prep
= postGenPrep ;
@@ -107,10 +107,10 @@ oper
-- It does automatic grade alternation, and is hence not usable
-- for words like "auto" (whose genitive would become "audon").
--
-- If the one-argument paradigm does not give the correct result, one can try and give
-- If the one-argument paradigm does not give the correct result, one can try and give
-- two or three forms. Most notably, the two-argument variant is used
-- for nouns like "kivi - kiviä", which would otherwise become like
-- "rivi - rivejä". Three arguments are used e.g. for
-- "rivi - rivejä". Three arguments are used e.g. for
-- "auto - auton - autoja", which would otherwise become
-- "auto - audon".
@@ -133,9 +133,9 @@ oper
-- Nouns where the parts are separate (should perhaps be treated as CN)
separateN = overload {
separateN : Str -> N -> N
separateN : Str -> N -> N
= \s,n -> mkN (s + "_") n ;
separateN : N -> N -> N
separateN : N -> N -> N
= \oma, asunto -> lin N {s = \\c => oma.s ! c + "_" + asunto.s ! c ; h = asunto.h} ;
} ;
@@ -149,7 +149,7 @@ oper
} ;
genitiveCompoundN : Number -> N -> N -> N = \n,veri,paine -> paine ** {
s = \\c => (StemFin.snoun2nounBind veri).s ! NCase n Gen + paine.s ! c
s = \\c => (StemFin.snoun2nounBind veri).s ! NCase n Gen + paine.s ! c
} ;
-- Nouns used as functions need a case, of which the default is
@@ -178,7 +178,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 (except for the superlative "paras" of "hyvä").
@@ -198,7 +198,7 @@ oper
p = pr ;
hasPrefix = True
} ;
-- Two-place adjectives need a case for the second argument.
mkA2 = overload {
@@ -265,11 +265,11 @@ oper
mkV3 = overload {
mkV3 : Str -> V3
= \s -> dirdirV3 (mkV s) ;
= \s -> dirdirV3 (mkV s) ;
mkV3 : V -> V3
= \v -> dirdirV3 v ;
mkV3 : V -> Prep -> Prep -> V3 -- e.g. puhua, allative, elative
= \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
= \v,p,q -> v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
} ;
dirV3 : V -> Case -> V3 ; -- siirtää, (accusative), illative
@@ -283,9 +283,9 @@ oper
mkVV = overload {
mkVV : Str -> VV -- e.g. "yrittää" (puhua)
= \s -> mkVVf (mkV s) infFirst ;
= \s -> mkVVf (mkV s) infFirst ;
mkVV : V -> VV -- e.g. "alkaa" (puhua)
= \v -> mkVVf v infFirst ;
= \v -> mkVVf v infFirst ;
mkVV : Str -> InfForm -> VV -- e.g. "ruveta" (puhumaan)
= \s,i -> mkVVf (mkV s) i ;
mkVV : V -> InfForm -> VV -- e.g. "lakata" (puhumasta)
@@ -300,15 +300,15 @@ mkVS = overload {
} ;
mkV2V = overload {
mkV2V : Str -> V2V -- reg verb, partitive + infIllat
mkV2V : Str -> V2V -- reg verb, partitive + infIllat
= \s -> mkV2Vf (mkV s) (casePrep partitive) infIllat ; ----
mkV2V : V -> V2V -- partitive + infillat
= \v -> mkV2Vf v (casePrep partitive) infIllat ; ----
mkV2V : V -> Prep -> V2V -- e.g. "käskeä" genitive + infFiilat
= \v,p -> mkV2Vf v p infIllat ;
mkV2V : V -> Prep -> InfForm -> V2V -- e.g. "kieltää" partitive infElat
mkV2V : V -> Prep -> InfForm -> V2V -- e.g. "kieltää" partitive infElat
= \v,p,f -> mk2V2 v p ** {vi = infform2vvtype f ; lock_V2V = <>} ;
mkV2V : V -> Case -> InfForm -> V2V
mkV2V : V -> Case -> InfForm -> V2V
= \v,c,f -> mk2V2 v (casePrep c) ** {vi = infform2vvtype f ; lock_V2V = <>} ;
} ;
@@ -316,20 +316,20 @@ mkVS = overload {
mkV2S : V -> Prep -> V2S ; -- e.g. "sanoa" allative
mkVVf : V -> InfForm -> VV ; -- e.g. "ruveta" infIllat
mkV2Vf : V -> Prep -> InfForm -> V2V ; -- e.g. "kieltää" partitive infElat
mkV2Vf : V -> Prep -> InfForm -> V2V ; -- e.g. "kieltää" partitive infElat
mkVA : V -> Prep -> VA ; -- e.g. "maistua" ablative
mkV2A : V -> Prep -> Prep -> V2A ; -- e.g. "maalata" accusative translative
mkVQ : V -> VQ ;
mkV2Q : V -> Prep -> V2Q ; -- e.g. "kysyä" ablative
mkVQ : V -> VQ ;
mkV2Q : V -> Prep -> V2Q ; -- e.g. "kysyä" 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 ; --%
@@ -354,16 +354,16 @@ mkVS = overload {
mkConj = overload {
mkConj : Str -> Conj
= \y -> {s1 = [] ; s2 = y ; n = Pl ; lock_Conj = <>} ;
mkConj : Str -> Str -> Conj
mkConj : Str -> Str -> Conj
= \x,y -> {s1 = x ; s2 = y ; n = Pl ; lock_Conj = <>} ;
mkConj : Str -> Str -> Number -> Conj
mkConj : Str -> Str -> Number -> Conj
= \x,y,n -> {s1 = x ; s2 = y ; n = n ; lock_Conj = <>} ;
} ;
mkDet = overload {
mkDet : Number -> N -> Det
mkDet : Number -> N -> Det
= \nu,noun -> lin Det (MorphoFin.mkDet nu (snoun2nounBind noun)) ;
mkDet : (isNeg : Bool) -> Number -> N -> Det -- use this with True to create a negative determiner
mkDet : (isNeg : Bool) -> Number -> N -> Det -- use this with True to create a negative determiner
= \isNeg,nu,noun -> lin Det (MorphoFin.mkDetPol isNeg nu (snoun2nounBind noun)) ;
mkDet : (isNeg : Bool) -> Number -> N -> Case -> Det -- paljon + False + partitive, ei yhtään + True + partitive
= \isNeg,nu,noun,c -> case c of {
@@ -373,10 +373,10 @@ mkVS = overload {
} ;
mkQuant = overload {
mkQuant : N -> Quant =
mkQuant : N -> Quant =
\noun -> heavyQuant {s1 = \\n,c => (snoun2nounBind noun).s ! NCase n c ; s2 = \\_ => [] ; isNum,isPoss,isNeg,isDef = False} ;
mkQuant : N -> N -> Quant =
\sg,pl -> heavyQuant {s1 = table {Sg => \\c => (snoun2nounBind pl).s ! NCase Sg c ; Pl => \\c => (snoun2nounBind pl).s ! NCase Pl c} ;
mkQuant : N -> N -> Quant =
\sg,pl -> heavyQuant {s1 = table {Sg => \\c => (snoun2nounBind pl).s ! NCase Sg c ; Pl => \\c => (snoun2nounBind pl).s ! NCase Pl c} ;
s2 = \\_ => [] ; isNum,isPoss,isNeg,isDef = False} ;
} ;
@@ -411,16 +411,16 @@ mkVS = overload {
infPart = Inf4Part ;
infPresPart = InfPresPart ; infPresPartAgr = InfPresPartAgr ;
prePrep : Case -> Str -> Prep =
prePrep : Case -> Str -> Prep =
\c,p -> lin Prep {c = NPCase c ; s = <tagFeature (tagPOS "ADP" p) "AdvType" "Pre", [],\\_ => []>} ; -- no possessive suffix
postPrep : Case -> Str -> Prep =
\c,p ->
let
\c,p ->
let
h = guessHarmony p ;
a2p : Agr => Str = case c of {
Gen => \\a => p ++ possSuffixGen h a ;
_ => \\a => p
_ => \\a => p
} ;
pt = tagFeature (tagPOS "ADP" p) "AdvType" "Post" ;
in case p of {
@@ -433,7 +433,7 @@ mkVS = overload {
casePrep : Case -> Prep =
\c -> lin Prep {c = NPCase c ; s = <[],[],\\_ => []>} ;
accPrep : Prep =
accPrep : Prep =
lin Prep {c = NPAcc ; s = <[],[],\\_ => []>} ;
NK = {s : NForms} ; --- lock_NK : {}} ;
@@ -451,7 +451,7 @@ mkVS = overload {
-- \s,t,u -> nforms2snoun (nForms3 s t u) ;
mkN : (talo,talon,taloja,taloa : Str) -> N = mk4N ;
-- \s,t,u,v -> nforms2snoun (nForms4 s t u v) ;
mkN :
mkN :
(talo,talon,taloa,talona,taloon,talojen,taloja,taloina,taloissa,taloihin
: Str) -> N = mk10N ;
mkN : (sora : Str) -> (tie : N) -> N = mkStrN ;
@@ -463,30 +463,30 @@ mkVS = overload {
exceptNomN : N -> Str -> N = \noun,nom -> lin N (exceptNomSNoun noun nom) ;
---- mk1A : Str -> A = \jalo -> aForms2A (nforms2aforms (nForms1 jalo)) ;
---- mkNA : N -> A = snoun2sadj ;
---- mkNA : N -> A = snoun2sadj ;
mk1N : (talo : Str) -> N = \s -> lin N (nforms2snoun (nForms1 s)) ;
mk2N : (talo,talon : Str) -> N = \s,t -> lin N (nforms2snoun (nForms2 s t)) ;
mk3N : (talo,talon,taloja : Str) -> N = \s,t,u -> lin N (nforms2snoun (nForms3 s t u)) ;
mk4N : (talo,talon,taloa,taloja : Str) -> N = \s,t,u,v ->
mk4N : (talo,talon,taloa,taloja : Str) -> N = \s,t,u,v ->
lin N (nforms2snoun (nForms4 s t u v)) ;
mk10N :
mk10N :
(talo,talon,taloa,talona,taloon,talojen,taloja,taloina,taloissa,taloihin
: Str) -> N = \a,b,c,d,e,f,g,h,i,j ->
: Str) -> N = \a,b,c,d,e,f,g,h,i,j ->
lin N (nforms2snoun (nForms10 a b c d e f g h i j)) ;
mkSeparateN : Str -> N -> N = \unissa,kulkija -> {
s = \\c => unissa ++ kulkija.s ! c ;
s = \\c => unissa ++ kulkija.s ! c ;
h = kulkija.h ;
lock_N = <>
} ;
mkStrN : Str -> N -> N = \sora,tie -> {
s = \\c => sora + tie.s ! c ;
s = \\c => sora + tie.s ! c ;
h = tie.h ;
lock_N = <>
} ;
mkNN : N -> N -> N = \oma,tunto -> {
s = \\c => oma.s ! c + tunto.s ! c ;
s = \\c => oma.s ! c + tunto.s ! c ;
h = tunto.h ;
lock_N = <>
} ; ---- TODO: oma in possessive suffix forms
@@ -496,7 +496,7 @@ mkVS = overload {
ukk = init ukko ;
uko = weakGrade ukko ;
ukon = uko + "n" ;
o = case last ukko of {"ä" => "ö" ; "a" => "o"} ; -- only used then
o = case last ukko of {"ä" => "ö" ; "a" => "o"} ; -- only used then
renka = strongGrade (init ukko) ;
rake = strongGrade ukko ;
in
@@ -514,26 +514,26 @@ mkVS = overload {
_ + ("ut" | "yt") => dOttanut ukko ;
_ + ("as" | "äs") => dRae ukko (renka + last renka + "n") ;
_ + ("uus" | "yys" | "eus" | "eys") => dLujuus ukko ;
_ + "s" => dJalas ukko ;
_ + "s" => dJalas ukko ;
-- {- heuristics for 3-syllable nouns ending a/ä
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? +
_ + "i" + ? + a@("a" | "ä") =>
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? +
_ + "i" + ? + a@("a" | "ä") =>
dSilakka ukko (ukko + "n") (ukk + o + "it" + a) ; -- pesijä
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? + _ +
("a" | "e" | "o" | "u" | "y" | "ä" | "ö") +
("l" | "r" | "n") + a@("a" | "ä") =>
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? + _ +
("a" | "e" | "o" | "u" | "y" | "ä" | "ö") +
("l" | "r" | "n") + a@("a" | "ä") =>
dSilakka ukko (ukko + "n") (ukk + o + "it" + a) ; -- sarana, omena
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? + _ +
("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") +
("n" | "k" | "s") + "k" + a@("a" | "ä") =>
dSilakka ukko (uko + "n") (init uko + o + "it" + a) ; -- silakka
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? + _ +
("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") +
("n" | "t" | "s") + "t" + a@("a" | "ä") =>
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? + _ +
("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") +
("n" | "k" | "s") + "k" + a@("a" | "ä") =>
dSilakka ukko (uko + "n") (init uko + o + "it" + a) ; -- silakka
_ + ("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") + ? + _ +
("a" | "e" | "i" | "o" | "u" | "y" | "ä" | "ö") +
("n" | "t" | "s") + "t" + a@("a" | "ä") =>
dSilakka ukko (uko + "n") (ukk + o + "j" + a) ; -- yhdyntä (but not isäntä)
_ + ("a" | "e" | "i" | "o" | "u") + ? + _ +
("a" | "e" | "o" | "u") + ? + "a" =>
_ + ("a" | "e" | "i" | "o" | "u") + ? + _ +
("a" | "e" | "o" | "u") + ? + "a" =>
dSilakka ukko (ukko + "n") (ukk + "ia") ; -- asema, johtaja
-- -}
_ + "i" +o@("o"|"ö") => dSilakka ukko (ukko+"n") (ukko+"it"+getHarmony o);
@@ -544,51 +544,51 @@ mkVS = overload {
_ + ("ar" | "är") => dPiennar ukko (renka + "ren") ;
_ + "e" + ("l" | "n") => dPiennar ukko (ukko + "en") ;
_ => dUnix ukko
} ;
} ;
nForms2 : (_,_ : Str) -> NForms = \ukko,ukkoja ->
nForms2 : (_,_ : Str) -> NForms = \ukko,ukkoja ->
let
ukot = nForms1 ukko ;
ukot = nForms1 ukko ;
ukon = weakGrade ukko + "n" ;
in
case <ukko,ukkoja> of {
<_, _ + ":" + ? + ("a" | "ä")> => dSDP ukko ;
<_ + "ea", _ + "oita"> =>
<_ + "ea", _ + "oita"> =>
dSilakka ukko ukon ukkoja ; -- idea, but not korkea
<_ + ("aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö" |
"ie" | "uo" | "yö" | "ea" | "eä" |
"ia" | "iä" | "io" | "iö"), _ + ("a" | "ä")> =>
<_ + ("aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö" |
"ie" | "uo" | "yö" | "ea" | "eä" |
"ia" | "iä" | "io" | "iö"), _ + ("a" | "ä")> =>
nForms1 ukko ; --- to protect --- how to get "dioja"?
<_ + ("a" | "ä" | "o" | "ö"), _ + ("a" | "ä")> =>
<_ + ("a" | "ä" | "o" | "ö"), _ + ("a" | "ä")> =>
dSilakka ukko ukon ukkoja ;
<arp + "i", _ + "i" + ("a" | "ä")> =>
dArpi ukko (init (weakGrade ukko) + "en") ;
<_ + "i", _ + ("eita" | "eitä")> =>
<_ + "i", _ + ("eita" | "eitä")> =>
dTohtori ukko ;
<_ + ("ut" | "yt"),_ + ("uita" | "yitä")> => dRae ukko (init ukko + "en") ;
<_ + "e", nuk + ("eja" | "ejä")> =>
<_ + "e", nuk + ("eja" | "ejä")> =>
dNukke ukko ukon ;
<_ + "s", _ + "ksi" + ?> => dJalas ukko ;
<_ + ("l" | "n" | "r" | "s"), _ + ("eja" | "ejä")> => dUnix ukko ;
<_, _ + ("a" | "ä")> => ukot ;
_ =>
Predef.error
_ =>
Predef.error
(["last argument should end in a/ä, not"] ++ ukkoja)
} ;
nForms3 : (_,_,_ : Str) -> NForms = \ukko,ukon,ukkoja ->
nForms3 : (_,_,_ : Str) -> NForms = \ukko,ukon,ukkoja ->
let
ukk = init ukko ;
ukot = nForms2 ukko ukkoja ;
in
case <ukko,ukon> of {
<_, _ + ":n"> => dSDP ukko ;
<_ + ("aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö" |
"ie" | "uo" | "yö" | "ea" | "eä" |
"ia" | "iä" | "io" | "iö" | "ja" | "jä"), _ + "n"> =>
<_ + ("aa" | "ee" | "ii" | "oo" | "uu" | "yy" | "ää" | "öö" |
"ie" | "uo" | "yö" | "ea" | "eä" |
"ia" | "iä" | "io" | "iö" | "ja" | "jä"), _ + "n"> =>
ukot ; --- to protect
<_ + ("a" | "o" | "u" | "y" | "ä" | "ö"), _ + "n"> =>
<_ + ("a" | "o" | "u" | "y" | "ä" | "ö"), _ + "n"> =>
dSilakka ukko ukon ukkoja ; -- auto,auton
<_ + "mpi", _ + ("emman" | "emmän")> => dSuurempi ukko ;
<_ + "in", _ + ("imman" | "immän")> => dSuurin ukko ;
@@ -598,27 +598,30 @@ mkVS = overload {
dRae ukko ukon ;
<nukk + "e", nuk + "een"> => dRae ukko ukon ;
<arp + "i", arv + "en"> => dArpi ukko ukon ;
<muk + "i", muk_ + "in",
muk__ + "ej" + ("a"|"ä")> => -- don't match voi - voin - voita
dPaatti ukko ukon ; -- 1-arg paradigm forces consonant gradation
<_ + ("us" | "ys"), _ + "den"> => dLujuus ukko ;
<laid + ("u"|"a"|"ä") + "n", laitu + "men">
<laid + ("u"|"a"|"ä") + "n", laitu + "men">
=> dLiitin ukko ukon ; -- laidun,hapan,sydän not caught in previous
<_, _ + "n"> => ukot ;
_ =>
_ =>
Predef.error (["second argument should end in n, not"] ++ ukon)
} ;
nForms4 : (_,_,_,_ : Str) -> NForms = \ukko,ukon,ukkoja,ukkoa ->
nForms4 : (_,_,_,_ : Str) -> NForms = \ukko,ukon,ukkoja,ukkoa ->
let
ukot = nForms3 ukko ukon ukkoja ;
in
case <ukko,ukon,ukkoja,ukkoa> of {
<_,_ + "n", _ + ("a" | "ä"), _ + ("a" | "ä")> =>
<_,_ + "n", _ + ("a" | "ä"), _ + ("a" | "ä")> =>
table {
2 => ukkoa ;
n => ukot ! n
} ;
_ =>
Predef.error
(["last arguments should end in n, a/ä, and a/ä, not"] ++
_ =>
Predef.error
(["last arguments should end in n, a/ä, and a/ä, not"] ++
ukon ++ ukkoja ++ ukkoa)
} ;
@@ -628,15 +631,15 @@ mkVS = overload {
} ;
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 Lontoosta Pariisiin
isPre2 = mkIsPre e ; -- Suomen voitto Ruotsista
lock_N3 = <>
} ;
mkIsPre : Prep -> Bool = \p -> case p.c of {
NPCase Gen => case p.s.p2 of {
"" => False ; -- Jussin veli
"" => False ; -- Jussin veli
_ => True -- puhe Jussin puolesta
} ;
_ => True -- syyte Jussia vastaan ; puhe Jussille
@@ -657,7 +660,7 @@ mkVS = overload {
_ => dUnix s
}
} ;
-- adjectives
@@ -667,7 +670,7 @@ mkVS = overload {
mkA : N -> (kivempi,kivin : Str) -> A = \n -> regAdjective n ;
mkA : (sana : AK) -> A = \w -> noun2adjDeg (nforms2snoun w.s) ;
mkA : (hyva,parempi,paras : N) -> (hyvin,paremmin,parhaiten : Str) -> A
mkA : (hyva,parempi,paras : N) -> (hyvin,paremmin,parhaiten : Str) -> A
= \h,p,ps,hn,pn,ph -> lin A (mkAdj h p ps hn pn ph ** {p=[]; hasPrefix=False}) ;
mkA : V -> A = presActA ;
} ;
@@ -686,17 +689,17 @@ mkVS = overload {
hasPrefix = False
} ;
regAdjective : SNoun -> Str -> Str -> A = \kiva, kivempi, kivin ->
mkAdjective
(snoun2sadj kiva)
(snoun2sadjComp False (nforms2snoun (dSuurempi kivempi)))
mkAdjective
(snoun2sadj kiva)
(snoun2sadjComp False (nforms2snoun (dSuurempi kivempi)))
(snoun2sadjComp False (nforms2snoun (dSuurin kivin))) ;
noun2adjDeg : SNoun -> A = \suuri ->
regAdjective
suuri
noun2adjDeg : SNoun -> A = \suuri ->
regAdjective
suuri
(snoun2compar suuri)
(snoun2superl suuri) ;
(snoun2superl suuri) ;
presActA : SVerb -> A = \tulla ->
let tuleva : NForm => Str = \\nf => (sverb2verb True tulla).s ! PresPartAct (AN nf) ;
in noun2adjDeg { s = tuleva ; h = tulla.h } ;
@@ -704,7 +707,7 @@ mkVS = overload {
presPassA : SVerb -> A = \mennä ->
let mentävä : NForm => Str = \\nf => (sverb2verb True mennä).s ! PresPartPass (AN nf) ;
in noun2adjDeg { s = mentävä ; h = mennä.h } ;
pastActA : SVerb -> A = \syntyä ->
let syntynyt : NForm => Str = \\nf => (sverb2verb True syntyä).s ! PastPartAct (AN nf) ;
in noun2adjDeg { s = syntynyt ; h = syntyä.h } ;
@@ -727,22 +730,22 @@ mkVS = overload {
mkV : Str -> V -> V = \s,v -> {s = \\f => s + v.s ! f ; sc = v.sc ; lock_V = <> ; h = v.h ; p = v.p} ;
} ;
mk1V : Str -> V = \s ->
let vfs = vforms2sverb (vForms1 s) in
mk1V : Str -> V = \s ->
let vfs = vforms2sverb (vForms1 s) in
vfs ** {sc = SCNom ; lock_V = <> ; p = []} ;
mk2V : (_,_ : Str) -> V = \x,y ->
mk2V : (_,_ : Str) -> V = \x,y ->
let vfs = vforms2sverb (vForms2 x y) in vfs ** {sc = SCNom ; lock_V = <> ; p = []} ;
mk3V : (huutaa,huudan,huusi : Str) -> V = \x,_,y -> mk2V x y ; ----
mk12V : (
huutaa,huudan,huutaa,huutavat,huutakaa,huudetaan,
huusin,huusi,huusisi,huutanut,huudettu,huutanee : Str) -> V =
\a,b,c,d,e,f,g,h,i,j,k,l ->
huusin,huusi,huusisi,huutanut,huudettu,huutanee : Str) -> V =
\a,b,c,d,e,f,g,h,i,j,k,l ->
vforms2sverb (vForms12 a b c d e f g h i j k l) ** {sc = SCNom ; lock_V = <> ; p = []} ;
vForms1 : Str -> VForms = \ottaa ->
let
a = last ottaa ;
otta = init ottaa ;
otta = init ottaa ;
ott = init otta ;
ots = init ott + "s" ;
ota = weakGrade otta ;
@@ -752,36 +755,36 @@ mkVS = overload {
case ottaa of {
_ + ("e" | "i" | "o" | "u" | "y" | "ö") + ("a" | "ä") =>
cHukkua ottaa (ota + "n") ;
_ + ("l" | "n" | "r") + ("taa" | "tää") =>
_ + ("l" | "n" | "r") + ("taa" | "tää") =>
cOttaa ottaa (ota + "n") (ots + "in") (ots + "i") ;
("" | ?) + ("a" | "e" | "i" | "o" | "u") + ? + _ +
("a" | "e" | "i" | "o" | "u") + _ + "aa" =>
("" | ?) + ("a" | "e" | "i" | "o" | "u") + ? + _ +
("a" | "e" | "i" | "o" | "u") + _ + "aa" =>
cOttaa ottaa (ota + "n") (ot + "in") (ott + "i") ;
("" | ?) + ("a" | "e" | "i") + _ + "aa" =>
("" | ?) + ("a" | "e" | "i") + _ + "aa" =>
cOttaa ottaa (ota + "n") (ot + "oin") (ott + "oi") ;
_ + ("aa" | "ää") =>
_ + ("aa" | "ää") =>
cOttaa ottaa (ota + "n") (ot + "in") (ott + "i") ;
_ + ("ella" | "ellä") =>
_ + ("ella" | "ellä") =>
cKuunnella ottaa otin ;
_ + ("osta" | "östä") =>
_ + ("osta" | "östä") =>
cJuosta ottaa (init ott + "ksen") ;
_ + ("st" | "nn" | "ll" | "rr") + ("a" | "ä") =>
_ + ("st" | "nn" | "ll" | "rr") + ("a" | "ä") =>
cJuosta ottaa (ott + "en") ;
_ + ("ita" | "itä") =>
_ + ("ita" | "itä") =>
cHarkita ottaa ;
_ + ("eta" | "etä" | "ota" | "ata" | "uta" | "ytä" | "ätä" | "ötä") =>
_ + ("eta" | "etä" | "ota" | "ata" | "uta" | "ytä" | "ätä" | "ötä") =>
cPudota ottaa (strongGrade ott + "si") ;
_ + ("da" | "dä") =>
_ + ("da" | "dä") =>
cJuoda ottaa ;
_ => Predef.error (["expected infinitive, found"] ++ ottaa)
} ;
_ => Predef.error (["expected infinitive, found"] ++ ottaa)
} ;
vForms2 : (_,_ : Str) -> VForms = \huutaa,huusi ->
let
huuda = weakGrade (init huutaa) ;
huusin = weakGrade huusi + "n" ;
autoin = weakGrade (init huusi) + "in" ;
in
in
case <huutaa,huusi> of {
<_ + ("taa" | "tää"), _ + ("oi" | "öi")> =>
cOttaa huutaa (huuda + "n") autoin huusi ;
@@ -807,10 +810,10 @@ mkVS = overload {
sc = SCNom ; h = Back ; lock_V = <> ; p = []} ; ---- lieneekö
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 ;
mkAdv = overload {
mkAdv = overload {
mkAdv : Str -> Adv = \s -> {s = tagPOS "ADV" s ; lock_Adv = <>} ;
mkAdv : AdvK -> Adv = \s -> {s = tagPOS "ADV" s.s ; lock_Adv = <>} ;
} ;
@@ -828,7 +831,7 @@ mkVS = overload {
caseV2 : V -> Case -> V2 ;
dirV2 : V -> V2 ;
dirV3 v p = v ** {c2 = accPrep ; c3 = casePrep p ; lock_V3 = <>} ;
dirV3 v p = v ** {c2 = accPrep ; c3 = casePrep p ; lock_V3 = <>} ;
dirdirV3 v = dirV3 v allative ;

View File

@@ -9,16 +9,16 @@ concrete QuestionFin of Question = CatFin ** open ResFin, StemFin, 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.s.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
@@ -30,15 +30,15 @@ concrete QuestionFin of Question = CatFin ** open ResFin, StemFin, Prelude in {
} ;
QuestIComp icomp np = {
s = \\t,a,p =>
let
s = \\t,a,p =>
let
vp = predV vpVerbOlla ;
cl = mkClause (subjForm np vp.s.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 = {
@@ -47,12 +47,12 @@ concrete QuestionFin of Question = CatFin ** open ResFin, StemFin, Prelude in {
} ;
-- The computation of $ncase$ is a special case of that in $NounFin.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 = npform2case n c ;
ncase = case <k,idet.isNum> of {
<Nom, True> => NCase Sg Part ; -- mitkä kolme kytkintä
@@ -60,33 +60,33 @@ concrete QuestionFin of Question = CatFin ** open ResFin, StemFin, Prelude in {
_ => NCase n k -- mitkä kytkimet
}
in
idet.s ! k ++ cn.s ! ncase ;
idet.s ! k ++ 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

@@ -12,14 +12,14 @@ concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin, St
} ;
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.s.sc) agr vp
in
cl.s ! t ! ant ! b ! SDecl ;
@@ -27,8 +27,8 @@ concrete RelativeFin of Relative = CatFin ** open Prelude, ResFin, MorphoFin, St
} ;
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

@@ -18,19 +18,19 @@ resource ResFin = ParamX ** open Prelude in {
-- This is the $Case$ as needed for both nouns and $NP$s.
param
Case = Nom | Gen | Part | Transl | Ess
| Iness | Elat | Illat | Adess | Ablat | Allat
| Abess ; -- Comit, Instruct in NForm
Case = Nom | Gen | Part | Transl | Ess
| Iness | Elat | Illat | Adess | Ablat | Allat
| Abess ; -- Comit, Instruct in NForm
NForm = NCase Number Case
NForm = NCase Number Case
| NComit | NInstruct -- no number dist
| NPossNom Number | NPossGen Number --- number needed for syntax of AdjCN
| NPossTransl Number | NPossIllat Number
| NPossTransl Number | NPossIllat Number
| NCompound ; -- special compound form, e.g. "nais"
--- These cases are possible for subjects.
SubjCase = SCNom | SCGen | SCPart | SCIness | SCElat | SCAdess | SCAblat ;
SubjCase = SCNom | SCGen | SCPart | SCIness | SCElat | SCAdess | SCAblat ;
oper
appSubjCase : SubjCase -> ResFin.NP -> Str = \sc,np -> np.s ! subjcase2npform sc ;
@@ -59,13 +59,13 @@ oper
param
Agr = Ag Number Person | AgPol ;
-- Vowel harmony, used for CNs in determining the correct possessive suffix.
Harmony = Back | Front ;
oper
complNumAgr : Agr -> Number = \a -> case a of {
Ag n _ => n ;
@@ -93,12 +93,12 @@ oper
--2 Noun phrases
--
-- Two forms of *virtual accusative* are needed for nouns in singular,
-- the nominative and the genitive one ("ostan talon"/"osta talo").
-- Two forms of *virtual accusative* are needed for nouns in singular,
-- the nominative and the genitive one ("ostan talon"/"osta talo").
-- For nouns in plural, only a nominative accusative exist. Pronouns
-- have a uniform, special accusative form ("minut", etc).
param
param
NPForm = NPCase Case | NPAcc | NPSep ; -- NPSep is NP used alone, e.g. in an Utt and as complement to copula. Equals NPCase Nom except for pro-drop
oper
@@ -126,7 +126,7 @@ oper
-- A special form is needed for the negated plural imperative.
param
VForm =
VForm =
Inf InfForm
| Presn Number Person
| Impf Number Person --# notpresent
@@ -137,11 +137,11 @@ param
| ImperP3 Number
| ImperP1Pl
| ImpNegPl
| PassPresn Bool
| PassPresn Bool
| PassImpf Bool --# notpresent
| PassCondit Bool --# notpresent
| PassPotent Bool --# notpresent
| PassImper Bool
| PassPotent Bool --# notpresent
| PassImper Bool
| PastPartAct AForm
| PastPartPass AForm
| PresPartAct AForm
@@ -195,7 +195,7 @@ param
SType = SDecl | SQuest ;
--2 For $Relative$
RAgr = RNoAg | RAg Agr ;
--2 For $Numeral$
@@ -205,21 +205,21 @@ 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
} ;
---
Compl : Type = {
s : Str * Str * (Agr => Str) ;
c : NPForm ;
c : NPForm ;
} ;
appCompl : Bool -> Polarity -> Compl -> ResFin.NP -> Str = \isFin,b,co,np ->
@@ -257,14 +257,14 @@ param
param
VIForm =
VIFin Tense
VIFin Tense
| VIInf InfForm
| VIPass Tense
| VIImper
;
| VIImper
;
oper
-- For $Sentence$.
@@ -276,10 +276,10 @@ oper
s : Tense => Anteriority => Polarity => {subj,fin,inf,compl,adv,ext : Str ; h : Harmony}
} ;
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 ++ kin b Back ; fin = c.fin ; inf = c.inf ; -- Jussikin nukkuu
@@ -289,21 +289,21 @@ 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 Back) [] ;
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 ; 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 ; adv = co ; ext = c.adv ++ c.ext ; h = c.h} -- Jussi nukkuu nytkin
}
} ;
kin : Polarity -> Harmony -> Str =
kin : Polarity -> Harmony -> Str =
\p,b -> case p of {Pos => (mkPart "kin" "kin").s ! b ; Neg => (mkPart "kaan" "kään").s ! b} ;
mkPart : Str -> Str -> {s : Harmony => Str} = \ko,koe ->
@@ -320,7 +320,7 @@ oper
} ;
-- This is used for subjects of passives: therefore isFin in False.
subjForm : NP -> SubjCase -> Polarity -> Str = \np,sc,b ->
subjForm : NP -> SubjCase -> Polarity -> Str = \np,sc,b ->
appCompl False b {s = <[],[],\\_ => []> ; c = subjcase2npform sc} np ;
questPart : Harmony -> Str = \b -> case b of {Back => "ko" ; _ => "kö"} ;
@@ -328,7 +328,7 @@ oper
-- The definitions below were moved here from $MorphoFin$ so that the
-- auxiliary of predication can be defined.
verbOlla : Verb =
verbOlla : Verb =
let
ollut = (noun2adj (nhn (sRae "ollut" "olleena"))).s ;
oltu = (noun2adj (nhn (sKukko "oltu" "ollun" "oltuja"))).s ;
@@ -417,8 +417,8 @@ oper
noun2adj : CommonNoun -> Adj = noun2adjComp True ;
noun2adjComp : Bool -> CommonNoun -> 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 ;
@@ -439,8 +439,8 @@ oper
-- worst-case macro
mkSubst : Str -> (_,_,_,_,_,_,_,_,_,_ : Str) -> NounH =
\a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin ->
mkSubst : Str -> (_,_,_,_,_,_,_,_,_,_ : Str) -> NounH =
\a,vesi,vede,vete,vetta,veteen,vetii,vesii,vesien,vesia,vesiin ->
{a = a ;
vesi = vesi ;
vede = vede ;
@@ -467,8 +467,8 @@ oper
vesien = nh.vesien ;
vesia = nh.vesia ;
vesiin = nh.vesiin ;
harmony : Harmony = case a of
{"a" => Back ; _ => Front }
harmony : Harmony = case a of
{"a" => Back ; _ => Front }
in
{s = table {
NCase Sg Nom => vesi ;
@@ -509,7 +509,7 @@ oper
NPossIllat Pl => Predef.tk 1 vesiin ;
NCompound => vesi
} ;
h = harmony
h = harmony
} ;
-- Surprisingly, making the test for the partitive, this not only covers
-- "rae", "perhe", "savuke", but also "rengas", "lyhyt" (except $Sg Illat$), etc.
@@ -520,20 +520,20 @@ oper
rakee = Predef.tk 2 rakeena ;
rakei = Predef.tk 1 rakee + "i" ;
raet = rae + (ifTok Str (Predef.dp 1 rae) "e" "t" [])
}
}
in
mkSubst a
mkSubst a
rae
rakee
rakee
(raet + ("t" + a))
rakee
(raet + ("t" + a))
(rakee + "seen")
rakei
rakei
(rakei + "den")
(rakei + "den")
(rakei + ("t" + a))
(rakei + "siin") ;
-- Nouns with partitive "a"/"ä" ;
-- Nouns with partitive "a"/"ä" ;
-- to account for grade and vowel alternation, three forms are usually enough
-- Examples: "talo", "kukko", "huippu", "koira", "kukka", "syylä",...
@@ -547,26 +547,26 @@ oper
kukkoi = ifi kukkoj (Predef.tk 1 kukkoj) ;
e = Predef.dp 1 kukkoi ;
kukoi = Predef.tk 2 kukon + Predef.dp 1 kukkoi
}
}
in
mkSubst a
kukko
(Predef.tk 1 kukon)
mkSubst a
kukko
(kukko + a)
(Predef.tk 1 kukon)
kukko
(kukko + a)
(kukko + o + "n")
(kukkoi + ifi "" "i")
(kukoi + ifi "" "i")
(kukkoi + ifi "" "i")
(kukoi + ifi "" "i")
(ifTok Str e "e" (Predef.tk 1 kukkoi + "ien") (kukkoi + ifi "en" "jen"))
kukkoja
(kukkoi + ifi "in" "ihin") ;
-- Reflexive pronoun.
-- Reflexive pronoun.
--- Possessive could be shared with the more general $NounFin.DetCN$.
oper
reflPron : Agr -> NP = \agr ->
let
reflPron : Agr -> NP = \agr ->
let
itse = (nhn (sKukko "itse" "itsen" "itsejä")).s ;
nsa = possSuffixFront agr
in {
@@ -582,13 +582,13 @@ oper
} ;
possSuffixGen : Harmony -> Agr -> Str = \h,agr -> case h of {
Front => BIND ++ possSuffixFront agr ;
Front => BIND ++ possSuffixFront agr ;
Back => BIND ++ possSuffix agr
} ;
possSuffixFront : Agr -> Str = \agr ->
possSuffixFront : Agr -> Str = \agr ->
table Agr ["ni" ; "si" ; "nsä" ; "mme" ; "nne" ; "nsä" ; "nne"] ! agr ;
possSuffix : Agr -> Str = \agr ->
possSuffix : Agr -> Str = \agr ->
table Agr ["ni" ; "si" ; "nsa" ; "mme" ; "nne" ; "nsa" ; "nne"] ! agr ;
oper
@@ -611,14 +611,14 @@ oper
isNeg : Bool
} ;
heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d ->
d ** {sp = d.s1} ;
heavyQuant : PQuant -> PQuant ** {sp : Number => Case => Str} = \d ->
d ** {sp = d.s1} ;
PQuant : Type = {
s1 : Number => Case => Str ;
s2 : Harmony => Str ;
s2 : Harmony => Str ;
isPoss : Bool ;
isDef : Bool ;
isNeg : Bool
} ;
} ;
}

View File

@@ -10,8 +10,8 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin, StemFin in {
PredSCVP sc vp = mkClause (\_ -> sc.s) (agrP3 Sg) vp ;
ImpVP vp0 = let vp = vp2old_vp vp0 in {
s = \\pol,agr =>
let
s = \\pol,agr =>
let
verb = vp.s ! VIImper ! Simul ! pol ! agr ;
compl = vp.s2 ! False ! pol ! agr ++ vp.adv ! pol ++ vp.ext --- False = like inf (osta auto)
in
@@ -20,7 +20,7 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin, StemFin in {
-- 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.s.sc) np.a vp).s ! t ! a ! p ! SDecl ;
c2 = vp.c2
} ;
@@ -31,14 +31,14 @@ concrete SentenceFin of Sentence = CatFin ** open Prelude, ResFin, StemFin 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
(insertExtrapos ("että" ++ slash.s)
SlashVS np vs slash = {
s = \\t,a,p =>
(mkClause (subjForm np vs.sc) np.a
(insertExtrapos ("että" ++ slash.s)
(predSV vs))
).s ! t ! a ! p ! SDecl ;
c2 = slash.c2

View File

@@ -23,16 +23,16 @@ oper
snoun2np : Number -> SPN -> NPForm => Str = \n,sn ->
\\c => sn.s ! (npform2case n c) ;
\\c => sn.s ! (npform2case n c) ;
noun2snoun : Noun -> SNoun = \n -> n ;
aHarmony : Str -> Harmony = \a -> case a of
aHarmony : Str -> Harmony = \a -> case a of
{"a" => Back ; _ => Front} ;
harmonyA : Harmony -> Str = harmonyV "a" "ä" ;
harmonyV : Str -> Str -> Harmony -> Str = \u,y,h -> case h of
harmonyV : Str -> Str -> Harmony -> Str = \u,y,h -> case h of
{Back => u ; Front => y} ;
@@ -64,9 +64,9 @@ oper
snoun2sadj : SNoun -> SAdj = snoun2sadjComp True ;
snoun2sadjComp : Bool -> SNoun -> SAdj = \isPos,tuore ->
let
let
tuoree = init (tuore.s ! NCase Sg Gen) ;
tuoreesti = tuoree + "sti" ;
tuoreesti = tuoree + "sti" ;
tuoreemmin = init tuoree ;
in {s = table {
AN f => tuore.s ! f ;
@@ -84,11 +84,11 @@ oper
Posit => table {
AN nf => h.s ! nf ;
AAdv => hn
} ;
} ;
Compar => table {
AN nf => p.s ! nf ;
AAdv => pn
} ;
} ;
Superl => table {
AN nf => ps.s ! nf ;
AAdv => ph
@@ -114,24 +114,24 @@ oper
sverb2verbBind : SVerb -> Verb = sverb2verb True ;
sverb2verbSep : SVerb -> Verb = sverb2verb False ;
vforms2sverb : VForms -> SVerb = \v ->
vforms2sverb : VForms -> SVerb = \v ->
{s = (vforms2V v).s ; h = case (last (v ! 0)) of {"a" => Back ; _ => Front}} ;
sverb2verb : Bool -> SVerb -> Verb = \b,sverb -> {s = sverb.s} ;
predSV : SVerb1 -> VP = \sv ->
predV sv ;
predV sv ;
-- (sverb2verbSep sv ** {p = sv.p ; sc = sv.sc ; h = sv.h}) ;
-- word formation functions
sverb2snoun : SVerb1 -> SNoun = \v -> -- syöminen
let tekem = Predef.tk 4 (v.s ! Inf Inf3Iness) in
let tekem = Predef.tk 4 (v.s ! Inf Inf3Iness) in
nforms2snoun (dNainen (tekem + "inen")) ;
{-
sverb2nounPresPartAct : SVerb1 -> SNoun = \v -> -- syövä
let teke = Predef.tk 5 (v.s ! Inf Inf3Iness) in
let teke = Predef.tk 5 (v.s ! Inf Inf3Iness) in
nforms2snoun (dLava (teke + "v" + last (v.s ! Inf1))) ;
sverb2nounPresPartPass : SVerb1 -> SNoun = \v -> -- syötävä
@@ -140,7 +140,7 @@ oper
-}
dLava : Str -> NForms = \s -> dUkko s (s + "n") ;
--- to use these at run time in ParseFin
partPlus = glue ;
@@ -148,12 +148,12 @@ oper
plusIf : Bool -> Str -> Str -> Str = \b,x,y -> case b of {
True => x + y ;
False => glue x y
False => glue x y
} ;
-- for Symbol
addStemEnding : Str -> SPN = \i ->
addStemEnding : Str -> SPN = \i ->
{s = \\c => i ++ bindColonIfS (NCase Sg c) ++ defaultCaseEnding c} ;
bindIfS : SNForm -> Str = \c -> case c of {
@@ -167,15 +167,15 @@ oper
} ;
-----------------------------------------------------------------------
---- a hack to make VerbFin compile accurately for library (here),
---- a hack to make VerbFin compile accurately for library (here),
---- and in a simplified way for ParseFin (in stemmed/)
slashV2VNP : (SVerb1 ** {c2 : Compl ; vi : VVType}) -> (NP ** {isNeg : Bool}) ->
(VP ** {c2 : Compl}) -> (VP ** {c2 : Compl})
= \v, np, vp ->
slashV2VNP : (SVerb1 ** {c2 : Compl ; vi : VVType}) -> (NP ** {isNeg : Bool}) ->
(VP ** {c2 : Compl}) -> (VP ** {c2 : Compl})
= \v, np, vp ->
insertObjPre np.isNeg
(\fin,b,a -> appCompl fin b v.c2 np ++
infVP v.sc b a vp (vvtype2infform v.vi))
(\fin,b,a -> appCompl fin b v.c2 np ++
infVP v.sc b a vp (vvtype2infform v.vi))
(predSV v) ** {c2 = vp.c2} ;
@@ -190,9 +190,9 @@ oper
} ;
defaultVPTyp = {isNeg = False ; isPass = False} ;
HVerb : Type = Verb ** {sc : SubjCase ; h : Harmony ; p : Str} ;
predV : HVerb -> VP = \verb -> {
s = verb ;
s2 = \\_,_,_ => [] ;
@@ -202,7 +202,7 @@ oper
} ;
old_VP = {
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
s : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} ;
s2 : Bool => Polarity => Agr => Str ; -- talo/talon/taloa
adv : Polarity => Str ; -- ainakin/ainakaan
ext : Str ;
@@ -211,17 +211,17 @@ oper
h : Harmony
} ;
vp2old_vp : VP -> old_VP = \vp ->
let
verb = vp.s ;
sverb : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} = \\vi,ant,b,agr0 =>
vp2old_vp : VP -> old_VP = \vp ->
let
verb = vp.s ;
sverb : VIForm => Anteriority => Polarity => Agr => {fin, inf : Str} = \\vi,ant,b,agr0 =>
let
agr = verbAgr agr0 ;
verbs = verb.s ;
part : Str = case vi of {
VIPass _ => verbs ! PastPartPass (AN (NCase agr.n Nom)) ;
VIPass _ => verbs ! PastPartPass (AN (NCase agr.n Nom)) ;
_ => verbs ! PastPartAct (AN (NCase agr.n Nom))
} ;
} ;
eiv : Str = case agr of {
{n = Sg ; p = P1} => "en" ;
@@ -258,7 +258,7 @@ oper
vf => verbOlla.s ! vf
} ;
vf : Str -> Str -> {fin, inf : Str} = \x,y ->
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) [] ;
@@ -277,14 +277,14 @@ oper
VIPass Past => mkvf (PassImpf passPol) ; --# notpresent
VIPass Cond => mkvf (PassCondit passPol) ; --# notpresent
VIPass Fut => mkvf (PassPresn passPol) ; --# notpresent
VIPass Pres => mkvf (PassPresn passPol) ;
VIPass Pres => mkvf (PassPresn passPol) ;
VIInf i => mkvf (Inf i)
}
in {
s = case vp.vptyp.isPass of {
True => \\vif,ant,pol,agr => case vif of {
VIFin t => sverb ! VIPass t ! ant ! pol ! agr ;
_ => sverb ! vif ! ant ! pol ! agr
_ => sverb ! vif ! ant ! pol ! agr
} ;
_ => sverb
} ;
@@ -293,7 +293,7 @@ oper
ext = vp.ext ;
sc = verb.sc ;
h = verb.h ;
isNeg = vp.vptyp.isNeg
isNeg = vp.vptyp.isNeg
} ;
insertObj : (Bool => Polarity => Agr => Str) -> VP -> VP = \obj,vp -> {
@@ -301,7 +301,7 @@ oper
s2 = \\fin,b,a => vp.s2 ! fin ! b ! a ++ obj ! fin ! b ! a ;
adv = vp.adv ;
ext = vp.ext ;
sc = vp.sc ;
sc = vp.sc ;
h = vp.h ;
vptyp = vp.vptyp
} ;
@@ -319,7 +319,7 @@ oper
s2 = vp.s2 ;
ext = vp.ext ;
adv = \\b => vp.adv ! b ++ adv ! b ;
sc = vp.sc ;
sc = vp.sc ;
h = vp.h ;
vptyp = vp.vptyp --- missään
} ;
@@ -329,7 +329,7 @@ oper
s2 = \\b,p,a => pr.s.p1 ++ vp.s2 ! b ! p ! a ++ pr.s.p2 ; ---- possessive suffix
ext = vp.ext ;
adv = vp.adv ;
vptyp = {isNeg = vp.vptyp.isNeg ; isPass = True} ;
vptyp = {isNeg = vp.vptyp.isNeg ; isPass = True} ;
} ;
insertExtrapos : Str -> VP -> VP = \obj,vp -> {
@@ -337,29 +337,29 @@ oper
s2 = vp.s2 ;
ext = vp.ext ++ obj ;
adv = vp.adv ;
sc = vp.sc ;
sc = vp.sc ;
h = vp.h ;
vptyp = vp.vptyp
} ;
mkClausePol : Bool -> (Polarity -> Str) -> Agr -> VP -> Clause =
mkClausePol : Bool -> (Polarity -> Str) -> Agr -> VP -> Clause =
\isNeg,sub,agr,vp -> {
s = \\t,a,b =>
s = \\t,a,b =>
let
pol = case isNeg of {
True => Neg ;
True => Neg ;
_ => b
} ;
c = (mkClausePlus sub agr vp).s ! t ! a ! pol
in
} ;
c = (mkClausePlus sub agr vp).s ! t ! a ! pol
in
table {
SDecl => c.subj ++ c.fin ++ c.inf ++ c.compl ++ c.adv ++ c.ext ;
SQuest => c.fin ++ BIND ++ questPart c.h ++ c.subj ++ c.inf ++ c.compl ++ c.adv ++ c.ext
}
} ;
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause =
mkClause : (Polarity -> Str) -> Agr -> VP -> Clause =
\sub,agr,vp -> {
s = \\t,a,b => let c = (mkClausePlus sub agr vp).s ! t ! a ! b in
s = \\t,a,b => let c = (mkClausePlus sub agr vp).s ! t ! a ! b in
table {
SDecl => c.subj ++ c.fin ++ c.inf ++ c.compl ++ c.adv ++ c.ext ;
SQuest => c.fin ++ BIND ++ questPart c.h ++ c.subj ++ c.inf ++ c.compl ++ c.adv ++ c.ext
@@ -368,24 +368,24 @@ oper
mkClausePlus : (Polarity -> Str) -> Agr -> VP -> ClausePlus =
\sub,agr,vp0 -> let vp = vp2old_vp vp0 in {
s = \\t,a,b =>
let
s = \\t,a,b =>
let
agrfin = case vp.sc of {
SCNom => <agr,True> ;
_ => <agrP3 Sg,False> -- minun täytyy, minulla 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 ;
adv = vp.adv ! b ;
ext = vp.ext ;
adv = vp.adv ! b ;
ext = vp.ext ;
h = selectPart vp0 a b
}
} ;
selectPart : VP -> Anteriority -> Polarity -> Harmony = \vp,a,p ->
selectPart : VP -> Anteriority -> Polarity -> Harmony = \vp,a,p ->
case p of {
Neg => Front ; -- eikö tule
_ => case a of {
@@ -398,7 +398,7 @@ oper
-- ([main] tahdon | en tahdo) ([internal] nukkua | olla nukkumatta)
infVPGen : Polarity -> SubjCase -> Polarity -> Agr -> VP -> InfForm -> Str =
\ipol,sc,pol,agr,vp0,vi ->
let
let
vp = vp2old_vp vp0 ;
fin = case sc of { -- subject case
SCNom => True ; -- minä tahdon nähdä auton
@@ -422,4 +422,4 @@ oper
vpVerbOlla : HVerb = verbOlla ** {sc = SCNom ; h = Back ; p = []} ;
}
}

View File

@@ -8,7 +8,7 @@ concrete StructuralFin of Structural = CatFin **
above_Prep = postGenPrep "yläpuolella" ;
after_Prep = postGenPrep "jälkeen" ;
all_Predet = {s = \\n,c =>
all_Predet = {s = \\n,c =>
let
kaiket = caseTable n (snoun2nounBind (mkN "kaikki" "kaiken" "kaikkena"))
in
@@ -47,15 +47,15 @@ concrete StructuralFin of Structural = CatFin **
here7from_Adv = mkAdv "täältä" ;
how_IAdv = ssp "ADV" "miten" ;
how8much_IAdv = ssp "ADV" ("kuinka" ++ tagPOS "ADV" "paljon") ;
how8many_IDet =
how8many_IDet =
{s = \\c => "kuinka" ++ (snoun2nounBind (mkN "moni" "monia")).s ! NCase Sg c ; n = Sg ; isNum = False} ;
if_Subj = ssp "CONJ" "jos" ;
in8front_Prep = postGenPrep "edessä" ;
i_Pron = mkPersonPronoun "minä" "minun" "minua" "minuna" "minuun" Sg P1 ;
in_Prep = casePrep inessive ;
it_Pron = {
s = \\c => pronSe.s ! npform2case Sg c ;
a = agrP3 Sg ;
s = \\c => pronSe.s ! npform2case Sg c ;
a = agrP3 Sg ;
hasPoss = False ;
poss = "sen" ;
} ;
@@ -79,7 +79,7 @@ concrete StructuralFin of Structural = CatFin **
so_AdA = ssp "ADV" "niin" ;
somebody_NP = {
s = \\c => jokuPron ! Sg ! npform2case Sg c ;
a = agrP3 Sg ;
a = agrP3 Sg ;
isPron = False ; isNeg = False
} ;
someSg_Det = heavyDet {
@@ -89,12 +89,12 @@ concrete StructuralFin of Structural = CatFin **
} ;
somePl_Det = heavyDet {
s1 = jokuPron ! Pl ;
s2 = \\_ => [] ; isNum,isPoss = False ; isNeg = False ; isDef = True ;
s2 = \\_ => [] ; isNum,isPoss = False ; isNeg = False ; isDef = True ;
n = Pl ; isNeg = False
} ;
something_NP = {
s = \\c => jokinPron ! Sg ! npform2case Sg c ;
a = agrP3 Sg ;
a = agrP3 Sg ;
isPron = False ; isNeg = False ; isNeg = False
} ;
somewhere_Adv = ssp "ADV" "jossain" ;
@@ -107,7 +107,7 @@ concrete StructuralFin of Structural = CatFin **
c => (mkPersonPronoun "nuo" "noiden" "noita" "noina" "noihin" Sg P3).s ! NPCase c
}
} ;
s2 = \\_ => [] ; isNum,isPoss = False ; isDef = True ; isNeg = False
s2 = \\_ => [] ; isNum,isPoss = False ; isDef = True ; isNeg = False
} ;
that_Subj = ssp "CONJ" "että" ;
there_Adv = ssp "ADV" "siellä" ; --- tuolla
@@ -161,21 +161,21 @@ concrete StructuralFin of Structural = CatFin **
yes_Utt = ssp "INTERJ" "kyllä" ;
youSg_Pron = mkPersonPronoun "sinä" "sinun" "sinua" "sinuna" "sinuun" Sg P2 ;
youPl_Pron = mkPersonPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 ;
youPol_Pron =
youPol_Pron =
let p = mkPersonPronoun "te" "teidän" "teitä" "teinä" "teihin" Pl P2 in
{s = p.s ; a = AgPol ; hasPoss = True ; poss = p.poss} ;
oper
jokuPron : MorphoFin.Number => (MorphoFin.Case) => Str =
let
kui = snoun2nounBind (mkN "kuu")
let
kui = snoun2nounBind (mkN "kuu")
in
table {
Sg => table {
Nom => "joku" ;
Gen => "jonkun" ;
c => relPron ! Sg ! c + "ku" + Predef.drop 3 (kui.s ! NCase Sg c)
} ;
} ;
Pl => table {
Nom => "jotkut" ;
c => relPron ! Pl ! c + kui.s ! NCase Pl c
@@ -188,14 +188,14 @@ oper
Nom => "jokin" ;
Gen => "jonkin" ;
c => relPron ! Sg ! c + "kin"
} ;
} ;
Pl => table {
Nom => "jotkin" ;
c => relPron ! Pl ! c + "kin"
}
} ;
mikaInt : MorphoFin.Number => (MorphoFin.Case) => Str =
mikaInt : MorphoFin.Number => (MorphoFin.Case) => Str =
let {
mi = snoun2nounBind (mkN "mi")
} in
@@ -206,7 +206,7 @@ oper
Part => "mitä" ;
Illat => "mihin" ;
c => mi.s ! NCase Sg c
} ;
} ;
Pl => table {
Nom => "mitkä" ;
Gen => "minkä" ;
@@ -216,15 +216,15 @@ oper
}
} ;
kukaInt : MorphoFin.Number => (MorphoFin.Case) => Str =
let
kuka = snoun2nounBind (mkN "kuka" "kenen" "ketä" "kenä" "keneen"
kukaInt : MorphoFin.Number => (MorphoFin.Case) => Str =
let
kuka = snoun2nounBind (mkN "kuka" "kenen" "ketä" "kenä" "keneen"
"keiden" "keitä" "keinä" "keissä" "keihin") ;
in
table {
Sg => table {
c => kuka.s ! NCase Sg c
} ;
} ;
Pl => table {
Nom => "ketkä" ;
c => kuka.s ! NCase Pl c
@@ -243,7 +243,7 @@ oper
<_,Adess> => "millään" ;
<_,Ablat> => "miltään" ;
_ => mikaInt ! n ! c + "kään"
} ;
} ;
kukaanPron : MorphoFin.Number => (MorphoFin.Case) => Str =
table {
@@ -257,7 +257,7 @@ oper
Adess => "kellään" ;
Ablat => "keltään" ;
c => kukaInt ! Sg ! c + "kään"
} ;
} ;
Pl => table {
Nom => "ketkään" ;
Part => "keitään" ;
@@ -271,9 +271,9 @@ oper
} ;
oper
makeNP : SNoun -> MorphoFin.Number -> CatFin.NP ;
makeNP : SNoun -> MorphoFin.Number -> CatFin.NP ;
makeNP noun num = {
s = \\c => (snoun2nounBind noun).s ! NCase num (npform2case num c) ;
s = \\c => (snoun2nounBind noun).s ! NCase num (npform2case num c) ;
a = agrP3 num ;
isPron, isNeg = False ;
lock_NP = <>
@@ -290,13 +290,13 @@ lin
if_then_Conj = {s1 = "jos" ; s2 = "niin" ; n = Sg} ;
nobody_NP = {
s = \\c => kukaanPron ! Sg ! npform2case Sg c ; --- requires negative polarity
a = agrP3 Sg ;
a = agrP3 Sg ;
isPron = False ; isNeg = True
} ;
nothing_NP = {
s = \\c => mikaanPron ! Sg ! npform2case Sg c ; --- requires negative polarity
a = agrP3 Sg ;
a = agrP3 Sg ;
isPron = False ; isNeg = True
} ;
@@ -317,4 +317,3 @@ oper
mkPersonPronoun : (_,_,_,_,_ : Str) -> Number -> Person -> Pron = \a,b,c,d,e,n,p ->
lin Pron (MorphoFin.mkPronoun a b c d e n p) ;
}

View File

@@ -3,9 +3,9 @@
concrete SymbolFin of Symbol = CatFin ** open Prelude, NounFin, ResFin, MorphoFin, StemFin in {
lin
SymbPN i = addStemEnding i.s ;
IntPN i = addStemEnding i.s ;
FloatPN i = addStemEnding i.s ;
SymbPN i = addStemEnding i.s ;
IntPN i = addStemEnding i.s ;
FloatPN i = addStemEnding i.s ;
NumPN i = {s = \\c => i.s!Sg!Nom ; h = Back} ; --- c
CNIntNP cn i = {
@@ -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 ;
@@ -41,4 +41,3 @@ lin
ConsSymb = infixSS (SOFT_BIND ++ ",") ;
}

View File

@@ -1,6 +1,6 @@
--# -path=.:../abstract:../common
concrete TerminologyFin of Terminology = CatFin ** open
concrete TerminologyFin of Terminology = CatFin ** open
ResFin,
StemFin,
ParadigmsFin,
@@ -18,9 +18,9 @@ lincat
ParameterType = G.N ;
Parameter = G.N ;
Modifier = G.A ;
Heading = {s : Str} ;
lin
noun_Category = mkN "substantiivi" ;
@@ -59,7 +59,7 @@ lin
active_Parameter = mkN "aktiivi" ;
passive_Parameter = mkN "passiivi" ;
imperative_Parameter = mkN "imperatiivi" ;
indicative_Parameter = mkN "indikatiivi" ;
conjunctive_Parameter = mkN "konjunktiivi" ;

View File

@@ -10,17 +10,17 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
SlashV2a v = predSV v ** {c2 = v.c2} ;
Slash2V3 v np =
insertObj
Slash2V3 v np =
insertObj
(\\fin,b,_ => appCompl fin b v.c2 np) (predSV v) ** {c2 = v.c3} ;
Slash3V3 v np =
insertObj
Slash3V3 v np =
insertObj
(\\fin,b,_ => appCompl fin b v.c3 np) (predSV v) ** {c2 = v.c2} ;
ComplVV v vp =
insertObj
(\\_,b,a => infVP v.sc b a vp (vvtype2infform v.vi))
(predSV {s = v.s ;
ComplVV v vp =
insertObj
(\\_,b,a => infVP v.sc b a vp (vvtype2infform v.vi))
(predSV {s = v.s ;
sc = case vp.s.sc of {
SCNom => v.sc ; -- minun täytyy pestä auto
c => c -- minulla täytyy olla auto
@@ -31,34 +31,34 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
ComplVS v s = insertExtrapos (SOFT_BIND ++ "," ++ etta_Conj ++ s.s) (predSV v) ;
ComplVQ v q = insertExtrapos (SOFT_BIND ++ "," ++ q.s) (predSV 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
(predSV v) ;
SlashV2S v s =
SlashV2S v s =
insertExtrapos (SOFT_BIND ++ "," ++ etta_Conj ++ s.s) (predSV v) ** {c2 = v.c2} ;
SlashV2Q v q =
SlashV2Q v q =
insertExtrapos (SOFT_BIND ++ "," ++ q.s) (predSV v) ** {c2 = v.c2} ;
SlashV2V v vp =
SlashV2V v vp =
insertObj (\\_,b,a => infVP v.sc b a vp (vvtype2infform v.vi)) (predSV v) ** {c2 = v.c2} ;
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
(predSV v) ** {c2 = v.c2} ;
ComplSlash vp np = insertObjPre np.isNeg (\fin,b,_ -> appCompl fin b vp.c2 np) vp ;
UseComp comp =
UseComp comp =
insertObj (\\_,_ => comp.s) (predV vpVerbOlla) ;
UseCopula = predV vpVerbOlla ;
SlashVV v vp = {
s = v ;
s = v ;
s2 = \\_,b,a => infVP v.sc b a vp (vvtype2infform v.vi) ;
adv = \\_ => v.p ;
vptyp = vp.vptyp ;
@@ -66,10 +66,10 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
c2 = vp.c2
} ;
{-
insertObj
(\\_,b,a => infVP v.sc b a vp v.vi)
(predSV {s = v.s ;
{-
insertObj
(\\_,b,a => infVP v.sc b a vp v.vi)
(predSV {s = v.s ;
sc = case vp.s.sc of {
NPCase Nom => v.sc ; -- minun täytyy pestä auto
c => c -- minulla täytyy olla auto
@@ -97,14 +97,14 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
{- ----
s = \\vif,ant,pol,agr => case vif of {
VIFin t => vp.s ! VIPass t ! ant ! pol ! agr ;
_ => vp.s ! vif ! ant ! pol ! agr
_ => vp.s ! vif ! ant ! pol ! agr
} ;
sc = v.c2.c ; -- minut valitaan ; minua rakastetaan ; minulle kuiskataan
sc = v.c2.c ; -- minut valitaan ; minua rakastetaan ; minulle kuiskataan
} ; ---- talon valitaan: should be marked like inf.
-}
CompAP ap = {
s = \\agr =>
s = \\agr =>
let
n = complNumAgr agr ;
c = case n of {
@@ -114,7 +114,7 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
in ap.s ! False ! (NCase n c)
} ;
CompCN cn = {
s = \\agr =>
s = \\agr =>
let
n = complNumAgr agr ;
c = case n of {
@@ -133,17 +133,17 @@ concrete VerbFin of Verb = CatFin ** open Prelude, ResFin, StemFin in {
--2 The object case
--
-- The rules involved are ComplV2 and ComplVV above.
-- The work is done jointly in ResFin.infVP and appCompl.
-- The work is done jointly in ResFin.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".