1
0
forked from GitHub/gf-rgl

(Hun) Remove unused parameters

This commit is contained in:
Inari Listenmaa
2020-04-25 14:47:56 +02:00
parent 44603f7db7
commit e2d79a72f6
3 changed files with 25 additions and 37 deletions

View File

@@ -184,11 +184,6 @@ concrete NounHun of Noun = CatHun ** open
-- : N2 -> CN ; -- : N2 -> CN ;
UseN,UseN2 = \n -> n ** { UseN,UseN2 = \n -> n ** {
compl = \\_,_ => [] ; compl = \\_,_ => [] ;
pstems = table {
PossSg (dSg_rP3 _) => n.s ! PossdSg_PossrP3 ;
PossSg dSg_rPl1 => n.s ! PossdSg_PossrPl1 ;
PossSg dSg_rSg1P2 => n.s ! SgAccStem ;
PossPl => n.s ! PossdPl } ;
} ; } ;
-- : N2 -> NP -> CN ; -- : N2 -> NP -> CN ;
@@ -207,7 +202,6 @@ concrete NounHun of Noun = CatHun ** open
-- : 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

@@ -75,8 +75,6 @@ param
SubjCase = SCNom | SCDat ; -- Limited set of subject cases SubjCase = SCNom | SCDat ; -- Limited set of subject cases
CNPossStem = PossPl | PossSg PossStem ;
Possessor = NotPossessed | Poss Person Number ; Possessor = NotPossessed | Poss Person Number ;
oper oper

View File

@@ -15,13 +15,6 @@ resource ResHun = NounMorphoHun ** open Prelude, Predef in {
oper oper
CNoun : Type = Noun ** { CNoun : Type = Noun ** {
compl : Number => Case => Str ; compl : Number => Case => Str ;
pstems : CNPossStem => Str ;
} ;
-- Used to possess NPs even after they become NPs
CNLite : Type = {
h : Harm ;
pstems : CNPossStem => Str
} ; } ;
mkCaseNoun : Str -> Number => Case => Str = \s -> mkCaseNoun : Str -> Number => Case => Str = \s ->
@@ -43,28 +36,35 @@ oper
<Pl,_> => applyCase' PlStem <Pl,_> => applyCase' PlStem
} ; } ;
caseFromPossStem : CNLite -> Determiner -> Case -> Str = \cn,det,cas -> caseFromPossStem : CNoun -> Determiner -> Case -> Str = \cn,det,cas ->
let st : PossStem = case det.dt of { let st : PossStem = case det.dt of {
DetPoss x => x ; DetPoss x => x ;
_ => Predef.error "caseFromPossStem: Not possessive Det" } ; _ => Predef.error "caseFromPossStem: Not possessive Det" } ;
casetable : Case->HarmForms = case <det.n,det.dt> of { casetable : Case->HarmForms = case <det.n,st> of {
-- P3 Sg possessive suffix ends in vowel, others in consonant. -- P3 Sg possessive suffix ends in vowel, others in consonant.
<Sg,DetPoss (dSg_rP3 Sg)> => endCasePossVow ; <Sg, dSg_rP3 Sg> => endCasePossVow ;
_ => endCase } ; _ => endCase } ;
stem : CNPossStem = case det.n of { stem : NumCaseStem = case det.n of {
Sg => PossSg st ; Pl => PossdPl ;
Pl => PossPl } ; Sg => case st of {
dSg_rP3 _ => PossdSg_PossrP3 ;
dSg_rPl1 => PossdSg_PossrPl1 ;
dSg_rSg1P2 => SgAccStem }
} ;
-- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük -- possessive suffix e.g. "their cats-3pl" is just k. not uk/ük
-- possessive suffix e.g. "her cat-3sg" is ∅, we store
suf = case <det.n,st> of { suf = case <det.n,st> of {
<Pl, dSg_rP3 Pl> => "k" ; <Pl, dSg_rP3 Pl> => "k" ;
<Pl, dSg_rP3 Sg> => "" ; <Pl, dSg_rP3 Sg> => "" ;
_ => det.poss ! cn.h _ => det.poss ! cn.h } ;
} ;
in case <cas,det.n,st> of { in case <cas,det.n,st> of {
-- don't use applyCaseSuf, it adds BIND -- Possessor is P3 Sg, possessed is plural, case is Nom:
<Nom,Pl,dSg_rP3 Sg> => cn.pstems ! PossPl ; -- just use the stored PossdPl stem, e.g. 'madarai'
<Nom> => glue (cn.pstems ! stem) suf ; <Nom, Pl, dSg_rP3 Sg> => cn.s ! PossdPl ;
-- Any number of possr or possd, case Nom = empty case ending
<Nom> => glue (cn.s ! stem) suf ;
-- Other forms have non-empty poss. suffix and case ending -- Other forms have non-empty poss. suffix and case ending
_ => applyCaseSuf suf cas cn stem casetable _ => applyCaseSuf suf cas cn stem casetable
@@ -74,8 +74,6 @@ oper
agr : Person*Number ; agr : Person*Number ;
objdef : ObjDef ; objdef : ObjDef ;
empty : Str ; -- standard trick for pro-drop empty : Str ; -- standard trick for pro-drop
pstems : CNPossStem => Str ; -- Verbs might need to add poss. suffixes
h : Harm ; -- NP may need to be possessed again because of have_V2
} ; } ;
NounPhrase : Type = BaseNP ** { NounPhrase : Type = BaseNP ** {
@@ -87,8 +85,6 @@ oper
agr = <P3,Sg> ; agr = <P3,Sg> ;
objdef = Indef ; objdef = Indef ;
empty = [] ; empty = [] ;
h = H_e ;
pstems = \\_ => [] ;
} ; } ;
indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\p,c => s} ; indeclNP : Str -> NounPhrase = \s -> emptyNP ** {s = \\p,c => s} ;
@@ -284,9 +280,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 -> CNLite -> CNPossStem -> (Case -> HarmForms) -> Str = applyCaseSuf : Str -> Case -> CNoun -> NumCaseStem -> (Case -> HarmForms) -> Str =
\suf,cas,cn,stem,casetable -> \suf,cas,cn,stem,casetable ->
glue (glue (cn.pstems ! stem) suf) (casetable cas ! cn.h) ; glue (glue (cn.s ! stem) suf) (casetable cas ! cn.h) ;
------------------ ------------------