1
0
forked from GitHub/gf-rgl

(Hun) Use the separate pstems in caseFromPossStem

This commit is contained in:
Inari Listenmaa
2020-04-24 07:39:21 +02:00
parent 0442c0d7a7
commit efcfb3cefa
2 changed files with 22 additions and 16 deletions

View File

@@ -192,6 +192,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
-- : AP -> CN -> CN -- : AP -> CN -> CN
AdjCN ap cn = cn ** { AdjCN ap cn = cn ** {
s = \\nc => ap.s ! Sg ++ cn.s ! nc ; s = \\nc => ap.s ! Sg ++ cn.s ! nc ;
pstems = \\cs => ap.s ! Sg ++ cn.pstems ! cs ;
compl = \\n,c => ap.compar ++ cn.compl ! n ! c ; compl = \\n,c => ap.compar ++ cn.compl ! n ! c ;
} ; } ;

View File

@@ -37,22 +37,27 @@ oper
<Pl,_> => applyCase' PlStem <Pl,_> => applyCase' PlStem
} ; } ;
caseFromPossStem : Noun -> Determiner -> Case -> Str = \cn,det,cas -> caseFromPossStem : CNoun -> Determiner -> Case -> Str = \cn,det,cas ->
let stem_casetable : NumCaseStem*(Case->HarmForms) = case <det.n,det.dt> of { let casetable : Case->HarmForms = case <det.n,det.dt> of {
<Sg,DetPoss st> => case st of { -- P3 Sg possessive suffix ends in vowel, others in consonant.
dSg_rSg1P2 => <SgAccStem,endCase> ; <Sg,DetPoss (dSg_rP3 Sg)> => endCasePossVow ;
dSg_rP3 Sg => <PossdSg_PossrP3,endCasePossVow> ; _ => endCase
dSg_rP3 Pl => <PossdSg_PossrP3,endCase> ; } ;
dSg_rPl1 => <PossdSg_PossrPl1,endCase> } ; stem : CNPossStem = case det.n of {
<Pl,DetPoss _> => <PossdPl,endCase> ; Sg => PossSg
_ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" } ; (case det.dt of {
stem = stem_casetable.p1 ; DetPoss x => x ;
casetable = stem_casetable.p2 ; _ => Predef.error "caseFromPossStem: Not possessive Det"}) ;
Pl => PossPl
} ;
-- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük
suf = case <det.n,det.dt> of { suf = case <det.n,det.dt> of {
<Pl,DetPoss (dSg_rP3 Pl)> => "k" ; <Pl,DetPoss (dSg_rP3 Pl)> => "k" ;
_ => det.poss ! cn.h } ; _ => det.poss ! cn.h
} ;
in case cas of { in case cas of {
Nom => glue (cn.s ! stem) suf ; -- don't use applyCaseSuf, it adds BIND Nom => glue (cn.pstems ! stem) suf ; -- don't use applyCaseSuf, it adds BIND
_ => applyCaseSuf suf cas cn stem casetable _ => applyCaseSuf suf cas cn stem casetable
} ; } ;
BaseNP : Type = { BaseNP : Type = {
@@ -201,9 +206,9 @@ oper
applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str = applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str =
\bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ; \bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ;
applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> (Case -> HarmForms) -> Str = applyCaseSuf : Str -> Case -> CNoun -> CNPossStem -> (Case -> HarmForms) -> Str =
\suf,cas,cn,stem,casetable -> \suf,cas,cn,stem,casetable ->
glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ; glue (glue (cn.pstems ! stem) suf) (casetable cas ! cn.h) ;
------------------ ------------------