(Hun) Add parameter in Det,Quant whether it agrees in case as attribute

This commit is contained in:
Inari Listenmaa
2020-04-20 10:38:53 +02:00
parent 252ecd0bb3
commit 5814f788bc
3 changed files with 35 additions and 13 deletions

View File

@@ -8,7 +8,10 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
-- : Det -> CN -> NP
DetCN det cn = emptyNP ** det ** {
s = \\c => det.s ! Nom ++ cn.s ! det.n ! c ;
s = \\c => case det.caseagr of {
True => det.s ! c ;
False => det.s ! Nom
} ++ cn.s ! det.n ! c ;
agr = <P3,det.n> ;
} ;
@@ -46,7 +49,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
-- Determiners can form noun phrases directly.
-- : Det -> NP ;
DetNP det = emptyNP ** {
DetNP det = emptyNP ** det ** {
s = det.sp ;
agr = <P3,det.n> ;
} ;
@@ -134,6 +137,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
sp = \\_,_ => pre {"a" ; "az" / v } ;
isIndefArt = False ;
objdef = Def ;
caseagr = True ;
} ;
-- : Quant
@@ -142,6 +146,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
sp = \\n,_ => case n of {Sg => "egy" ; Pl => []} ;
isIndefArt = True ;
objdef = Indef ;
caseagr = True ;
} ;
-- : Pron -> Quant

View File

@@ -47,13 +47,17 @@ oper
--------------------------------------------------------------------------------
-- Det, Quant, Card, Ord
BaseQuant : Type = {
objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object
caseagr : Bool ; -- If it agrees in case: "azoknak a nőknek" vs. "sok nőknek"
} ;
-- Quant has variable number:
-- e.g. this_Quant has both "this" and "these"
Quant : Type = {
Quant : Type = BaseQuant ** {
s, -- form that comes before noun: "{this} car"
sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP)
isIndefArt : Bool ; -- standard trick to prevent "a one car"
objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object
} ;
mkQuant : (s,sp : Str) -> Quant = \s,sp -> {
@@ -61,26 +65,35 @@ oper
sp = (mkNoun sp).s ;
isIndefArt = False ;
objdef = Def ;
caseagr = True ;
} ;
-- Det is formed in DetQuant : Quant -> Num -> Det
-- so it has an inherent number.
Determiner : Type = {
Determiner : Type = BaseQuant ** {
s,
sp : Case => Str ;
n : Number ;
numtype : NumType ; -- Whether its Num component is digit, numeral or Sg/Pl
objdef : ObjDef ; -- How V2 agrees if NP with this Det is an object
} ;
mkDet : (s : Str) -> ObjDef -> Number -> Determiner = \s,d,n -> {
mkDet : (s : Str) -> ObjDef -> Number -> Bool -> Determiner = \s,d,n,ca -> {
s,
sp = (mkNoun s).s ! n ;
n = n ;
numtype = NoNum ;
objdef = d ;
caseagr = ca ;
} ;
mkDet2 : (n,a : Str) -> ObjDef -> Number -> Bool -> Determiner = \no,ac,d,n,ca ->
let reg : Determiner = mkDet no d n ca
in reg ** {
s,sp = (regNounNomAcc no ac).s ! n ;
} ;
Numeral : Type = {
s : Place => Str ; -- Independent or attribute
numtype : NumType ; -- Digit, numeral or Sg/Pl : makes a difference in many languages

View File

@@ -61,16 +61,20 @@ lin most_Predet = {s = ""} ;
-}
--lin every_Det =
lin few_Det = mkDet "kevés" Def Sg ; -- TODO check
lin many_Det = mkDet "sok" Def Sg ; -- TODO check
lin few_Det = mkDet "kevés" Def Sg False ; -- TODO check
lin many_Det = mkDet "sok" Def Sg False ; -- TODO check
--lin much_Det =
lin somePl_Det = mkDet "néhány" Indef Sg ;
lin someSg_Det = mkDet "néhány" Indef Sg ;
lin someSg_Det,
somePl_Det = mkDet2 "néhány" "néhányat" Indef Sg False ;
--lin no_Quant =
lin that_Quant = mkQuant "az" "az" ;
lin this_Quant = mkQuant "ez" "ez" ;
lin that_Quant =
let az : Quant = mkQuant "az" "az" ;
in az ** {s = \\n,c => az.s ! n ! c ++ pre {"a" ; "az" / v }} ;
lin this_Quant =
let ez : Quant = mkQuant "ez" "ez" ;
in ez ** {s = \\n,c => ez.s ! n ! c ++ pre {"a" ; "az" / v }} ;
{-lin which_IQuant =