(Hun) Add new QuantType param to Quants

This commit is contained in:
Inari Listenmaa
2020-04-23 19:56:10 +02:00
parent f3fd085318
commit 4dc5b53c3c
3 changed files with 18 additions and 6 deletions

View File

@@ -69,11 +69,11 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
-- : Quant -> Num -> Det ; -- : Quant -> Num -> Det ;
DetQuant quant num = quant ** num ** { DetQuant quant num = quant ** num ** {
s = \\c => case <isNum num,quant.isIndefArt> of { s = \\c => case <isNum num,isIndefArt quant> of {
<True,True> => [] ; -- don't output "a 2 cars" <True,True> => [] ; -- don't output "a 2 cars"
_ => quant.s ! num.n ! c } _ => quant.s ! num.n ! c }
++ num.s ! Attrib ; -- TODO: add inflection table in numbers ++ num.s ! Attrib ; -- TODO: add inflection table in numbers
sp = \\c => case <isNum num,quant.isIndefArt> of { sp = \\c => case <isNum num,isIndefArt quant> of {
<True,True> => [] ; <True,True> => [] ;
_ => quant.sp ! num.n ! c } _ => quant.sp ! num.n ! c }
++ num.s ! Indep ; ++ num.s ! Indep ;
@@ -137,7 +137,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
DefArt = { DefArt = {
s, s,
sp = \\_,_ => pre {"a" ; "az" / v } ; sp = \\_,_ => pre {"a" ; "az" / v } ;
isIndefArt = False ; qt = Article ;
objdef = Def ; objdef = Def ;
caseagr = True ; caseagr = True ;
} ; } ;
@@ -146,7 +146,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
IndefArt = { IndefArt = {
s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ; s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ;
sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ; sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ;
isIndefArt = True ; qt = Article ;
objdef = Indef ; objdef = Indef ;
caseagr = True ; caseagr = True ;
} ; } ;

View File

@@ -13,7 +13,19 @@ oper
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Morphophonology -- Morphophonology
--------------------------------------------------------------------------------
-- Quant
param
QuantType = Possessive | Article ;
oper
-- standard trick to prevent "a one car"
isIndefArt : {qt : QuantType ; objdef : ObjDef} -> Bool = \quant ->
case <quant.qt,quant.objdef> of {
<Article,Indef> => True ;
_ => False
} ;
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- Nouns -- Nouns

View File

@@ -89,13 +89,13 @@ oper
Quant : Type = BaseQuant ** { Quant : Type = BaseQuant ** {
s, -- form that comes before noun: "{this} car" s, -- form that comes before noun: "{this} car"
sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP) sp : Number => Case => Str ; -- independent form, "I like {this}" (DetNP)
isIndefArt : Bool ; -- standard trick to prevent "a one car" qt : QuantType ;
} ; } ;
mkQuant : (s,sp : Str) -> Quant = \s,sp -> { mkQuant : (s,sp : Str) -> Quant = \s,sp -> {
s = mkCaseNoun s ; s = mkCaseNoun s ;
sp = mkCaseNoun sp ; sp = mkCaseNoun sp ;
isIndefArt = False ; qt = Article ;
objdef = Def ; objdef = Def ;
caseagr = True ; caseagr = True ;
} ; } ;