mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
(Hun) Add 2-argument smart paradigm for nouns
This commit is contained in:
@@ -5,7 +5,7 @@ concrete LexiconHun of Lexicon = CatHun **
|
|||||||
-- A
|
-- A
|
||||||
|
|
||||||
-- lin add_V3 = mkV3 "" ;
|
-- lin add_V3 = mkV3 "" ;
|
||||||
lin airplane_N = mkN "repülőgép" ;
|
lin airplane_N = mkN "repülőgép" "repülőgépet" ;
|
||||||
-- lin alas_Interj = mkInterj "" ;
|
-- lin alas_Interj = mkInterj "" ;
|
||||||
-- lin already_Adv = mkA "" ;
|
-- lin already_Adv = mkA "" ;
|
||||||
lin animal_N = mkN "állat" ;
|
lin animal_N = mkN "állat" ;
|
||||||
@@ -26,7 +26,7 @@ lin bank_N = mkN "bank" ;
|
|||||||
-- lin bark_N = mkN "" ;
|
-- lin bark_N = mkN "" ;
|
||||||
lin beautiful_A = mkA "szép" ;
|
lin beautiful_A = mkA "szép" ;
|
||||||
-- lin become_VA = mkVA "" ;
|
-- lin become_VA = mkVA "" ;
|
||||||
lin beer_N = mkN "sör" ;
|
lin beer_N = mkN "sör" "sört" ;
|
||||||
-- lin beg_V2V = mkV2 "" ;
|
-- lin beg_V2V = mkV2 "" ;
|
||||||
lin belly_N = mkN "has" ;
|
lin belly_N = mkN "has" ;
|
||||||
lin big_A = mkA "nagy" ;
|
lin big_A = mkA "nagy" ;
|
||||||
@@ -235,7 +235,7 @@ lin music_N = mkN "zene" ;
|
|||||||
----
|
----
|
||||||
-- N
|
-- N
|
||||||
|
|
||||||
lin name_N = mkN "név" ;
|
lin name_N = mkN "név" "nevet" ;
|
||||||
lin narrow_A = mkA "keskeny" ; --also "szűk"
|
lin narrow_A = mkA "keskeny" ; --also "szűk"
|
||||||
lin near_A = mkA "közel" ;
|
lin near_A = mkA "közel" ;
|
||||||
lin neck_N = mkN "nyak" ;
|
lin neck_N = mkN "nyak" ;
|
||||||
@@ -406,7 +406,8 @@ lin window_N = mkN "ablak" ;
|
|||||||
lin wine_N = mkN "bor" ;
|
lin wine_N = mkN "bor" ;
|
||||||
lin wing_N = mkN "szárny" ;
|
lin wing_N = mkN "szárny" ;
|
||||||
-- lin wipe_V2 = mkV2 "" ;
|
-- lin wipe_V2 = mkV2 "" ;
|
||||||
lin woman_N = mkN "nő" "k" harmO ;
|
--lin woman_N = mkN "nő" "k" harmO ;
|
||||||
|
lin woman_N = mkN "nő" "nőket" ;
|
||||||
-- lin wonder_VQ = mkVQ "" ;
|
-- lin wonder_VQ = mkVQ "" ;
|
||||||
lin wood_N = mkN "fa" ; --same as tree
|
lin wood_N = mkN "fa" ; --same as tree
|
||||||
lin worm_N = mkN "féreg" ; --also "kukac"
|
lin worm_N = mkN "féreg" ; --also "kukac"
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ oper
|
|||||||
in {s = \\n,c => case <n,c> of {
|
in {s = \\n,c => case <n,c> of {
|
||||||
-- All plural forms and Sg Acc and Sg Sup use the "majmo" stem
|
-- All plural forms and Sg Acc and Sg Sup use the "majmo" stem
|
||||||
<Pl,_> | <Sg,Acc> => nMajmo.s ! n ! c ;
|
<Pl,_> | <Sg,Acc> => nMajmo.s ! n ! c ;
|
||||||
<Sg,Sup> => nMajm.s ! n ! c ;
|
<Sg,Sup> => nMajmo.s ! n ! c ;
|
||||||
|
|
||||||
-- The rest of the forms are formed with the regular constructor,
|
-- The rest of the forms are formed with the regular constructor,
|
||||||
-- using "majom" as the stem.
|
-- using "majom" as the stem.
|
||||||
@@ -91,15 +91,71 @@ oper
|
|||||||
|
|
||||||
-- regNoun is a /smart paradigm/: it takes one or a couple of forms,
|
-- regNoun is a /smart paradigm/: it takes one or a couple of forms,
|
||||||
-- and decides which (non-smart) paradigm is the most likely to match.
|
-- and decides which (non-smart) paradigm is the most likely to match.
|
||||||
regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = n, a ->
|
regNounNomAcc : (nom : Str) -> (acc : Str) -> Noun = \n,a ->
|
||||||
let lastNom = last n ;
|
case <n,a> of {
|
||||||
lastAccShort = shorten (last (init a)) ;
|
-- alma, almát
|
||||||
in ifTok Noun lastNom lastAccShort (dAlma n a) (mkNoun n) ;
|
<_ + "a", _ + "át">
|
||||||
|
|<_ + "e" ,_ + "ét"> => dAlma n a ;
|
||||||
|
|
||||||
-- regNounNomAcc n a | (last n) == shorten (last (init a)) = dAlma n a
|
|
||||||
|
|
||||||
-- guess : (nom : Str) -> (acc : Str) = \sgnom -> case sgnom of
|
<_ + "á" + #c, -- madár, madarat
|
||||||
|
_ + "a" + #c + #v + "t">
|
||||||
|
|
||||||
|
|<_ + "é" + #c, -- név, nevet
|
||||||
|
_ + "e" + #c + #v + "t">
|
||||||
|
|
||||||
|
|<_ + "í" + #c, -- víz, vizet
|
||||||
|
_ + "i" + #c + #v + "t"> => dMadár n a ;
|
||||||
|
|
||||||
|
|
||||||
|
<_ + #v + #c, -- majom, majmot
|
||||||
|
_ + #c + #v + "t"> => dMajom n a ;
|
||||||
|
|
||||||
|
|
||||||
|
<_ + "ó", -- ló, lovat
|
||||||
|
_ + "o" + #c + #v + "t">
|
||||||
|
|
||||||
|
|<_ + "ő", -- kő, követ
|
||||||
|
_ + "ö" + #c + #v + "t">
|
||||||
|
|
||||||
|
|<_ + "é", -- lé, levet
|
||||||
|
_ + "e" + #c + #v + "t"> => dLó n a ;
|
||||||
|
|
||||||
|
_ => mkNoun n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
regNoun : Str -> Noun = \sgnom -> case sgnom of {
|
||||||
|
_ + ("a"|"e") => dAlma sgnom (lengthen sgnom + "t") ;
|
||||||
|
#c + ("á"|"é") + #c => mkNoun sgnom ;
|
||||||
|
_ + ("á"|"é") + #c => dMadár sgnom (név2nevet sgnom) ;
|
||||||
|
_ + ("ó"|"é"|"ő"|"ű") => dLó sgnom (ló2lovat sgnom) ;
|
||||||
|
_ + #v + #c + #v + #c => dMajom sgnom (majom2majmo sgnom);
|
||||||
|
_ => mkNoun sgnom -- Fall back to the regular paradigm
|
||||||
|
} where {
|
||||||
|
név2nevet : Str -> Str = \név ->
|
||||||
|
let né_v : Str*Str = case név of {né + v@#c => <né,v>} ;
|
||||||
|
né = né_v.p1 ;
|
||||||
|
v = né_v.p2 ;
|
||||||
|
ne = shorten né ;
|
||||||
|
e = case last ne of {
|
||||||
|
"i" => "e" ;
|
||||||
|
_ => last ne } ;
|
||||||
|
in ne + v + e + "t" ;
|
||||||
|
ló2lovat : Str -> Str = \ló ->
|
||||||
|
let lo = shorten ló ;
|
||||||
|
lov = lo + "v" ;
|
||||||
|
at : Str = case ló of {
|
||||||
|
_ + "ó" => "at" ;
|
||||||
|
_ => "et" } ;
|
||||||
|
in lov + at ;
|
||||||
|
majom2majmo : Str -> Str = \majom ->
|
||||||
|
let majo_m : Str*Str = case majom of {majo + m@#c => <majo,m>} ;
|
||||||
|
majo = majo_m.p1 ;
|
||||||
|
m = majo_m.p2 ;
|
||||||
|
mo = m + last majo ;
|
||||||
|
maj = init majo ;
|
||||||
|
in maj + mo
|
||||||
|
} ;
|
||||||
|
|
||||||
--TODO: Special cases (enter these words manually to not complicate the paradigms):
|
--TODO: Special cases (enter these words manually to not complicate the paradigms):
|
||||||
--dTó: szó special case which fulfills the plural cases but not the <Sg,Acc> or <Sg,Sup> case ("szót" not "szavat")
|
--dTó: szó special case which fulfills the plural cases but not the <Sg,Acc> or <Sg,Sup> case ("szót" not "szavat")
|
||||||
@@ -120,6 +176,16 @@ oper
|
|||||||
-- Vowels as a pattern.
|
-- Vowels as a pattern.
|
||||||
v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" |
|
v : pattern Str = #("a" | "e" | "i" | "o" | "u" | "ö" | "ü" |
|
||||||
"á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ;
|
"á" | "é" | "í" | "ó" | "ú" | "ő" | "ű") ;
|
||||||
|
|
||||||
|
c : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|
|
||||||
|
"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z"|
|
||||||
|
"cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs"|
|
||||||
|
"dzs") ;
|
||||||
|
|
||||||
|
-- Only single consonants
|
||||||
|
unigraph : pattern Str = #("b"|"c"|"d"|"f"|"g"|"h"|"j"|"k"|"l"|"m"|
|
||||||
|
"n"|"p"|"q"|"r"|"s"|"t"|"v"|"w"|"x"|"z") ;
|
||||||
|
|
||||||
-- Digraphs
|
-- Digraphs
|
||||||
digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ;
|
digraph : pattern Str = #("cs"|"dz"|"gy"|"ly"|"ny"|"sz"|"ty"|"zs") ;
|
||||||
|
|
||||||
@@ -137,7 +203,7 @@ oper
|
|||||||
x + "ty" => x + "tty" ;
|
x + "ty" => x + "tty" ;
|
||||||
x + "zs" => x + "zzs" ;
|
x + "zs" => x + "zzs" ;
|
||||||
|
|
||||||
-- Base cacse: just duplicate the single letter
|
-- Base case: just duplicate the single letter
|
||||||
x + s@? => x + s + s } ;
|
x + s@? => x + s + s } ;
|
||||||
|
|
||||||
-- Function to test if a string ends in a vowel
|
-- Function to test if a string ends in a vowel
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
resource ParadigmsHun = open CatHun, ResHun, ParamHun, NounHun, Prelude in {
|
resource ParadigmsHun = open
|
||||||
|
CatHun, ResHun, ParamHun, NounHun, Prelude in {
|
||||||
|
|
||||||
oper
|
oper
|
||||||
|
|
||||||
@@ -17,8 +18,8 @@ oper
|
|||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
mkN : overload {
|
mkN : overload {
|
||||||
mkN : (sgnom : Str) -> N ; -- Predictable nouns
|
mkN : (sgnom : Str) -> N ; -- Predictable nouns from singular nominative. Accusative vowel is o for back harmony. No stem lowering (TODO better explanation/examples)
|
||||||
mkN : (madár : Str) -> (ak : Str) -> N ; -- Noun with unpredictable plural allomorph
|
mkN : (sgnom : Str) -> (sggen : Str) -> N ; -- Singular nominative and accusative. Takes care of cases like … TODO example
|
||||||
mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph
|
mkN : (férfi : Str) -> (harm : Harmony) -> (ak : Str) -> N ; -- Noun with unpredictable vowel harmony and plural allomorph
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ oper
|
|||||||
\s -> lin N (regNoun s) ;
|
\s -> lin N (regNoun s) ;
|
||||||
|
|
||||||
mkN : Str -> Str -> N =
|
mkN : Str -> Str -> N =
|
||||||
\s,ak -> lin N (mkNounHarm (getHarm s) ak s) ;
|
\n,a-> lin N (regNounNomAcc n a) ;
|
||||||
|
|
||||||
mkN : Str -> Harmony -> N =
|
mkN : Str -> Harmony -> N =
|
||||||
\s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ;
|
\s,h -> lin N (mkNounHarm h (pluralAllomorph s) s) ;
|
||||||
|
|||||||
Reference in New Issue
Block a user