mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-28 09:28:54 -06:00
(Hun) Replace SgAcc with SgAccStem; will be reused with poss. suffixes
This commit is contained in:
@@ -11,7 +11,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
|
|||||||
s = \\c => case det.caseagr of {
|
s = \\c => case det.caseagr of {
|
||||||
True => det.s ! c ;
|
True => det.s ! c ;
|
||||||
False => det.s ! Nom
|
False => det.s ! Nom
|
||||||
} ++ caseFromStem True c cn det.n
|
} ++ caseFromStem glue cn c det.n
|
||||||
++ cn.compl ! det.n ! c ;
|
++ cn.compl ! det.n ! c ;
|
||||||
agr = <P3,det.n> ;
|
agr = <P3,det.n> ;
|
||||||
} ;
|
} ;
|
||||||
@@ -57,7 +57,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
|
|||||||
|
|
||||||
-- : CN -> NP ;
|
-- : CN -> NP ;
|
||||||
MassNP cn = emptyNP ** {
|
MassNP cn = emptyNP ** {
|
||||||
s = \\c => caseFromStem True c cn Sg ++
|
s = \\c => caseFromStem glue cn c Sg ++
|
||||||
cn.compl ! Sg ! c ;
|
cn.compl ! Sg ! c ;
|
||||||
agr = <P3,Sg> ;
|
agr = <P3,Sg> ;
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ oper
|
|||||||
s = \\nc => case nc of {
|
s = \\nc => case nc of {
|
||||||
|
|
||||||
-- All plural forms and Sg Acc, Sg Sup use the "lova" stem
|
-- All plural forms and Sg Acc, Sg Sup use the "lova" stem
|
||||||
PlStem | PlAcc | SgAcc => nLova.s ! nc ;
|
PlStem | PlAcc | SgAccStem => nLova.s ! nc ;
|
||||||
SgSup => nLov.s ! nc ;
|
SgSup => nLov.s ! nc ;
|
||||||
|
|
||||||
-- The rest of the forms are formed with the regular constructor,
|
-- The rest of the forms are formed with the regular constructor,
|
||||||
@@ -75,7 +75,7 @@ oper
|
|||||||
in nMajmo ** {
|
in nMajmo ** {
|
||||||
s = \\nc => case nc of {
|
s = \\nc => case nc 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
|
||||||
PlStem | PlAcc | SgAcc => nMajmo.s ! nc ;
|
PlStem | PlAcc | SgAccStem => nMajmo.s ! nc ;
|
||||||
SgSup => nMajmo.s ! nc ;
|
SgSup => nMajmo.s ! nc ;
|
||||||
|
|
||||||
-- The rest of the forms are formed with the regular constructor,
|
-- The rest of the forms are formed with the regular constructor,
|
||||||
@@ -94,7 +94,7 @@ oper
|
|||||||
in nTolla ** {
|
in nTolla ** {
|
||||||
s = \\nc => case nc of {
|
s = \\nc => case nc of {
|
||||||
-- All plural forms and Sg Acc use the "tolla" stem
|
-- All plural forms and Sg Acc use the "tolla" stem
|
||||||
PlStem | PlAcc | SgAcc => nTolla.s ! nc ;
|
PlStem | PlAcc | SgAccStem => nTolla.s ! nc ;
|
||||||
|
|
||||||
-- The rest of the forms are formed with the regular constructor,
|
-- The rest of the forms are formed with the regular constructor,
|
||||||
-- using "toll" as the stem.
|
-- using "toll" as the stem.
|
||||||
@@ -303,27 +303,29 @@ oper
|
|||||||
-- Variant of case forms when the noun stem ends in consonant.
|
-- Variant of case forms when the noun stem ends in consonant.
|
||||||
endCaseCons : NumCaseStem -> HarmForms = \c -> case c of {
|
endCaseCons : NumCaseStem -> HarmForms = \c -> case c of {
|
||||||
SgSup => harm3 "on" "en" "ön" ;
|
SgSup => harm3 "on" "en" "ön" ;
|
||||||
SgAcc|PlAcc => harm3 "ot" "et" "öt" ;
|
PlAcc => harm3 "ot" "et" "öt" ;
|
||||||
|
SgAccStem => harm3 "o" "e" "ö" ;
|
||||||
_ => harm1 []
|
_ => harm1 []
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
-- Variant where accusative has the allomorph -at
|
-- Variant where accusative has the allomorph -at
|
||||||
endCaseConsAccAt : NumCaseStem -> HarmForms = \c -> case c of {
|
endCaseConsAccAt : NumCaseStem -> HarmForms = \c -> case c of {
|
||||||
SgAcc|PlAcc => harm3 "at" "et" "öt" ;
|
SgAccStem => harm3 "a" "e" "ö" ;
|
||||||
|
PlAcc => harm3 "at" "et" "öt" ;
|
||||||
_ => endCaseCons c
|
_ => endCaseCons c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Variant where accusative has the allomorph -t for consonants
|
-- Variant where accusative has the allomorph -t for consonants
|
||||||
-- Examples: "pénz, bor, orr, szín, lány, kés, dal"
|
-- Examples: "pénz, bor, orr, szín, lány, kés, dal"
|
||||||
endCaseConsAcc : NumCaseStem -> HarmForms = \c -> case c of {
|
endCaseConsAcc : NumCaseStem -> HarmForms = \c -> case c of {
|
||||||
SgAcc => harm1 "t" ;
|
SgAccStem => harm1 "" ;
|
||||||
_ => endCaseCons c
|
_ => endCaseCons c
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Variant of case forms when the noun stem ends in vowel.
|
-- Variant of case forms when the noun stem ends in vowel.
|
||||||
endCaseVow : NumCaseStem -> HarmForms = \c -> case c of {
|
endCaseVow : NumCaseStem -> HarmForms = \c -> case c of {
|
||||||
SgAcc => harm1 "t" ;
|
SgAccStem => harm1 "" ;
|
||||||
SgSup => harm1 "n" ;
|
SgSup => harm1 "n" ;
|
||||||
SgInsStem => harm1 "v" ;
|
SgInsStem => harm1 "v" ;
|
||||||
-- Other forms are shared with endCaseCons.
|
-- Other forms are shared with endCaseCons.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ oper
|
|||||||
param
|
param
|
||||||
|
|
||||||
NumCaseStem =
|
NumCaseStem =
|
||||||
SgNom | SgAcc | SgSup -- These may use 2-3 different stems
|
SgNom | SgAccStem | SgSup -- These may use 2-3 different stems
|
||||||
| PlAcc -- May have irregular vowel in suffix
|
| PlAcc -- May have irregular vowel in suffix
|
||||||
| SgInsStem -- Instrumental and translative: -v after vowels
|
| SgInsStem -- Instrumental and translative: -v after vowels
|
||||||
| SgStem -- Rest of the cases in Sg
|
| SgStem -- Rest of the cases in Sg
|
||||||
|
|||||||
@@ -18,20 +18,20 @@ oper
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkCaseNoun : Str -> Number => Case => Str = \s ->
|
mkCaseNoun : Str -> Number => Case => Str = \s ->
|
||||||
\\n,c => caseFromStem False c (mkNoun s) n ;
|
\\n,c => caseFromStem (\a,b -> a+b) (mkNoun s) c n ;
|
||||||
mkCaseNoun2 : (n,a : Str) -> Number => Case => Str = \no,ac ->
|
mkCaseNoun2 : (n,a : Str) -> Number => Case => Str = \no,ac ->
|
||||||
\\n,c => caseFromStem False c (regNounNomAcc no ac) n ;
|
\\n,c => caseFromStem (\a,b -> a+b) (regNounNomAcc no ac) c n ;
|
||||||
|
|
||||||
caseFromStem : Bool -> Case -> Noun -> Number -> Str = \usebind,cas,cn,n ->
|
caseFromStem : (Str->Str->Str) -> Noun -> Case -> Number -> Str = \bind,cn,cas,n ->
|
||||||
case <n,cas> of {
|
case <n,cas> of {
|
||||||
<Sg,Nom> => cn.s ! SgNom ;
|
<Sg,Nom> => cn.s ! SgNom ;
|
||||||
<Sg,Acc> => cn.s ! SgAcc ;
|
<Sg,Acc> => bind (cn.s ! SgAccStem) "t" ;
|
||||||
<Sg,Sup> => cn.s ! SgSup ;
|
<Sg,Sup> => cn.s ! SgSup ;
|
||||||
<Pl,Acc> => cn.s ! PlAcc ;
|
<Pl,Acc> => cn.s ! PlAcc ;
|
||||||
<Pl,Nom> => cn.s ! PlStem ;
|
<Pl,Nom> => cn.s ! PlStem ;
|
||||||
<Sg,Ins|Tra> => glueIf usebind (cn.s ! SgInsStem) (endCase cas ! cn.h) ;
|
<Sg,Ins|Tra> => bind (cn.s ! SgInsStem) (endCase cas ! cn.h) ;
|
||||||
<Pl,Ins|Tra> => glueIf usebind (glue (cn.s ! PlStem) "k") (endCase cas ! cn.h) ;
|
<Pl,Ins|Tra> => bind (bind (cn.s ! PlStem) "k") (endCase cas ! cn.h) ;
|
||||||
_ => applyOblCase usebind (endCase cas) n cn
|
_ => applyOblCase bind (endCase cas) n cn
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
BaseNP : Type = {
|
BaseNP : Type = {
|
||||||
@@ -162,14 +162,11 @@ oper
|
|||||||
applyAdp : Adposition -> NounPhrase -> Str = \adp,np ->
|
applyAdp : Adposition -> NounPhrase -> Str = \adp,np ->
|
||||||
adp.pr ++ np.s ! adp.c ++ adp.s ;
|
adp.pr ++ np.s ! adp.c ++ adp.s ;
|
||||||
|
|
||||||
applyOblCase : Bool -> HarmForms -> Number -> Noun -> Str =
|
applyOblCase : (Str->Str->Str) -> HarmForms -> Number -> Noun -> Str =
|
||||||
\usebind,adp,n,np ->
|
\bind,adp,n,np ->
|
||||||
let stem : NumCaseStem = case n of {
|
let stem : NumCaseStem = case n of {
|
||||||
Sg => SgStem ; Pl => PlStem } ;
|
Sg => SgStem ; Pl => PlStem } ;
|
||||||
in glueIf usebind (np.s ! stem) (adp ! np.h) ;
|
in bind (np.s ! stem) (adp ! np.h) ;
|
||||||
|
|
||||||
glueIf : Bool -> (_,_ : Str) -> Str = \f,a,b ->
|
|
||||||
if_then_Str f (glue a b) (a + b) ;
|
|
||||||
|
|
||||||
------------------
|
------------------
|
||||||
-- Conj
|
-- Conj
|
||||||
|
|||||||
Reference in New Issue
Block a user