(Hun) Fix case forms after P3 Sg possessive suffix

This commit is contained in:
Inari Listenmaa
2020-04-24 06:48:28 +02:00
parent fc699d231f
commit 207787a76c
2 changed files with 22 additions and 11 deletions

View File

@@ -429,7 +429,8 @@ oper
} ;
-- This is used in ResHun.caseFromStem, not here.
-- This is used in ResHun.caseFromStem, which makes NP out of CN.
-- Ns only have stems, and these forms are attached to the stems.
endCase : Case -> HarmForms = \c -> case c of {
Nom => harm1 [] ;
@@ -453,4 +454,12 @@ oper
-- Tem => harm1 "kor" -- Temporal 'at <numeral>'. Only used with numerals.
} ;
endCasePossVow : Case -> HarmForms = \c -> case c of {
Acc => harm1 "t" ;
Sup => harm1 "n" ;
Tra => harm "vá" "vé" ;
Ins => harm "val" "vel" ;
_ => endCase c
} ;
}

View File

@@ -37,15 +37,16 @@ oper
} ;
caseFromPossStem : Noun -> Determiner -> Case -> Str = \cn,det,cas ->
let stem : NumCaseStem = case <det.n,det.dt> of {
let stem_casetable : NumCaseStem*(Case->HarmForms) = case <det.n,det.dt> of {
<Sg,DetPoss st> => case st of {
dSg_rSg1P2 => SgAccStem ;
dSg_rP3 => PossdSg_PossrP3 ;
dSg_rPl1 => PossdSg_PossrPl1 } ;
<Pl,DetPoss _> => PossdPl ;
_ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det"
} ;
in applyCaseSuf (det.poss ! cn.h) cas cn stem ;
dSg_rSg1P2 => <SgAccStem,endCase> ;
dSg_rP3 => <PossdSg_PossrP3,endCasePossVow> ; -- TODO nneeds to be vowel only after Sg3
dSg_rPl1 => <PossdSg_PossrPl1,endCase> } ;
<Pl,DetPoss _> => <PossdPl,endCase> ;
_ => Predef.error "caseFromPossStem: Trying to apply to non-possessive Det" } ;
stem = stem_casetable.p1 ;
casetable = stem_casetable.p2 ;
in applyCaseSuf (det.poss ! cn.h) cas cn stem casetable ;
BaseNP : Type = {
agr : Person*Number ;
@@ -191,8 +192,9 @@ oper
applyCase : (Str->Str->Str) -> Case -> Noun -> NumCaseStem -> Str =
\bind,cas,cn,stem -> bind (cn.s ! stem) (endCase cas ! cn.h) ;
applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> Str =
\suf,cas,cn,stem -> glue (glue (cn.s ! stem) suf) (endCase cas ! cn.h) ;
applyCaseSuf : Str -> Case -> Noun -> NumCaseStem -> (Case -> HarmForms) -> Str =
\suf,cas,cn,stem,casetable ->
glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ;
------------------