mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-19 16:12:52 -06:00
worked on Finnish morphology
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
--
|
--
|
||||||
-- We use the parameter types and word classes defined in $TypesFin.gf$.
|
-- We use the parameter types and word classes defined in $TypesFin.gf$.
|
||||||
|
|
||||||
resource MorphoFin = TypesFin ** open (Predef = Predef), Prelude in {
|
resource MorphoFin = TypesFin ** open Prelude in {
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
--
|
--
|
||||||
@@ -94,6 +94,11 @@ oper
|
|||||||
kukkoja
|
kukkoja
|
||||||
(kukkoi + ifi "in" "ihin") ;
|
(kukkoi + ifi "in" "ihin") ;
|
||||||
|
|
||||||
|
sLukko : Str -> CommonNoun = \lukko ->
|
||||||
|
let a = getHarmony (last lukko)
|
||||||
|
in
|
||||||
|
sKukko lukko (weakGrade lukko + "n") (lukko + "n" + a) ;
|
||||||
|
|
||||||
-- The special case with no alternations: the vowel harmony is inferred from the
|
-- The special case with no alternations: the vowel harmony is inferred from the
|
||||||
-- last letter - which must be one of "o", "u", "ö", "y".
|
-- last letter - which must be one of "o", "u", "ö", "y".
|
||||||
|
|
||||||
@@ -129,6 +134,17 @@ oper
|
|||||||
(korpi + a)
|
(korpi + a)
|
||||||
(korpi + "in") ;
|
(korpi + "in") ;
|
||||||
|
|
||||||
|
sArpi : Str -> CommonNoun = \arpi ->
|
||||||
|
sKorpi arpi (init (weakGrade arpi) + "en") (init arpi + "ena") ;
|
||||||
|
sSylki : Str -> CommonNoun = \sylki ->
|
||||||
|
sKorpi sylki (init (weakGrade sylki) + "en") (init sylki + "enä") ;
|
||||||
|
|
||||||
|
--- This is not quite right.
|
||||||
|
|
||||||
|
sKoira : Str -> CommonNoun = \koira ->
|
||||||
|
let a = getHarmony (last koira) in
|
||||||
|
sKorpi koira (koira + "n") (koira + "n" + a) ;
|
||||||
|
|
||||||
-- Loan words ending in consonants are actually similar to words like
|
-- Loan words ending in consonants are actually similar to words like
|
||||||
-- "malli"/"mallin"/"malleja", with the exception that the "i" is not attached
|
-- "malli"/"mallin"/"malleja", with the exception that the "i" is not attached
|
||||||
-- to the singular nominative.
|
-- to the singular nominative.
|
||||||
@@ -397,33 +413,58 @@ oper
|
|||||||
|
|
||||||
-- This auxiliary resolves vowel harmony from a given letter.
|
-- This auxiliary resolves vowel harmony from a given letter.
|
||||||
|
|
||||||
getHarmony : Str -> Str = \u ->
|
getHarmony : Str -> Str = \u -> case u of {
|
||||||
ifTok Str u "a" "a" (
|
"a" => "a" ;
|
||||||
ifTok Str u "o" "a" (
|
"o" => "a" ;
|
||||||
ifTok Str u "u" "a" "ä")) ;
|
"u" => "a" ;
|
||||||
|
_ => "ä"
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- We could use an extension of the following for grade alternation, but we don't;
|
-- The following function defines how grade alternation works if it is active.
|
||||||
-- in general, *whether there is* grade alternation must be given in the lexicon
|
-- In general, *whether there is* grade alternation must be given in the lexicon
|
||||||
-- anyway (cf. "auto" - "auton", not "audon").
|
-- (cf. "auto" - "auton", not "audon").
|
||||||
|
|
||||||
weakGrade : Str -> Str = \kukko ->
|
weakGrade : Str -> Str = \kukko ->
|
||||||
let {
|
let {
|
||||||
|
kukk = init kukko ;
|
||||||
ku = Predef.tk 3 kukko ;
|
ku = Predef.tk 3 kukko ;
|
||||||
kk = Predef.tk 1 (Predef.dp 3 kukko) ;
|
kul = Predef.tk 2 kukko ;
|
||||||
o = Predef.dp 1 kukko ;
|
kk = init (Predef.dp 3 kukko) ;
|
||||||
ifkk = ifTok Str kk ;
|
k = last kk ;
|
||||||
k =
|
o = last kukko ;
|
||||||
ifkk "kk" "k" (
|
kuk = case kk of {
|
||||||
ifkk "pp" "p" (
|
"kk" => ku + "k" ;
|
||||||
ifkk "tt" "t" (
|
"pp" => ku + "p" ;
|
||||||
ifkk "nt" "nn" (
|
"tt" => ku + "t" ;
|
||||||
ifkk "mp" "mm" (
|
"nt" => ku + "nn" ;
|
||||||
ifkk "rt" "rr" (
|
"mp" => ku + "mm" ;
|
||||||
ifkk "lt" "ll" (
|
"rt" => ku + "rr" ;
|
||||||
kk)))))))
|
"lt" => ku + "ll" ;
|
||||||
|
"lk" => kul + case o of {
|
||||||
|
"i" => "j" ;
|
||||||
|
_ => ""
|
||||||
|
} ;
|
||||||
|
"rk" => kul + case o of {
|
||||||
|
"i" => "rj" ;
|
||||||
|
_ => ""
|
||||||
|
} ;
|
||||||
|
"hk" => kukk ; -- *tahko-tahon
|
||||||
|
"sk" => kukk ; -- *lasku-lasvun
|
||||||
|
"sp" => kukk ; -- *raspi-rasvin
|
||||||
|
"st" => kukk ; -- *lastu-lasdun
|
||||||
|
_ => case k of {
|
||||||
|
"k" => case o of {
|
||||||
|
"u" => kul + "v" ;
|
||||||
|
_ => kul
|
||||||
|
};
|
||||||
|
"p" => kul + "v" ;
|
||||||
|
"t" => kul + "d" ;
|
||||||
|
_ => kukk
|
||||||
}
|
}
|
||||||
in ku + k + o ;
|
}
|
||||||
|
}
|
||||||
|
in kuk + o ;
|
||||||
|
|
||||||
|
|
||||||
--3 Proper names
|
--3 Proper names
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
--
|
--
|
||||||
-- The following modules are presupposed:
|
-- The following modules are presupposed:
|
||||||
|
|
||||||
resource ParadigmsFin = open (Predef=Predef), Prelude, SyntaxFin, ResourceFin in {
|
resource ParadigmsFin = open Prelude, SyntaxFin, ResourceFin in {
|
||||||
|
|
||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
@@ -66,6 +66,13 @@ oper
|
|||||||
|
|
||||||
nTalo : (talo : Str) -> Gender -> N ;
|
nTalo : (talo : Str) -> Gender -> N ;
|
||||||
|
|
||||||
|
-- Another special case are nouns where the last two consonants
|
||||||
|
-- undergo regular weak-grade alternation:
|
||||||
|
-- "kukko - kukon", "rutto - ruton", "hyppy - hypyn", "sampo - sammon",
|
||||||
|
-- "kunto - kunnon", "sisältö - sisällön", .
|
||||||
|
|
||||||
|
nLukko : (lukko : Str) -> Gender -> N ;
|
||||||
|
|
||||||
-- Foreign words ending in consonants are actually similar to words like
|
-- Foreign words ending in consonants are actually similar to words like
|
||||||
-- "malli"/"mallin"/"malleja", with the exception that the "i" is not attached
|
-- "malli"/"mallin"/"malleja", with the exception that the "i" is not attached
|
||||||
-- to the singular nominative. Examples: "linux", "savett", "screen".
|
-- to the singular nominative. Examples: "linux", "savett", "screen".
|
||||||
@@ -224,6 +231,7 @@ oper
|
|||||||
mkNoun a b c d e f g h i j ** {g = k ; lock_N = <>} ;
|
mkNoun a b c d e f g h i j ** {g = k ; lock_N = <>} ;
|
||||||
|
|
||||||
nKukko = \a,b,c,g -> sKukko a b c ** {g = g ; lock_N = <>} ;
|
nKukko = \a,b,c,g -> sKukko a b c ** {g = g ; lock_N = <>} ;
|
||||||
|
nLukko = \a,g -> sLukko a ** {g = g ; lock_N = <>} ;
|
||||||
nTalo = \a,g -> sTalo a ** {g = g ; lock_N = <>} ;
|
nTalo = \a,g -> sTalo a ** {g = g ; lock_N = <>} ;
|
||||||
nLinux = \a,g -> sLinux a ** {g = g ; lock_N = <>} ;
|
nLinux = \a,g -> sLinux a ** {g = g ; lock_N = <>} ;
|
||||||
nPeruna = \a,g -> sPeruna a ** {g = g ; lock_N = <>} ;
|
nPeruna = \a,g -> sPeruna a ** {g = g ; lock_N = <>} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user