(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 ;
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"
_ => quant.s ! num.n ! c }
++ 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> => [] ;
_ => quant.sp ! num.n ! c }
++ num.s ! Indep ;
@@ -137,7 +137,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
DefArt = {
s,
sp = \\_,_ => pre {"a" ; "az" / v } ;
isIndefArt = False ;
qt = Article ;
objdef = Def ;
caseagr = True ;
} ;
@@ -146,7 +146,7 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
IndefArt = {
s = \\n,_ => case n of {Sg => "egy" ; Pl => []} ;
sp = \\n,_ => case n of {Sg => "egy" ; Pl => "sok"} ;
isIndefArt = True ;
qt = Article ;
objdef = Indef ;
caseagr = True ;
} ;

View File

@@ -13,7 +13,19 @@ oper
--------------------------------------------------------------------------------
-- 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

View File

@@ -89,13 +89,13 @@ oper
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"
qt : QuantType ;
} ;
mkQuant : (s,sp : Str) -> Quant = \s,sp -> {
s = mkCaseNoun s ;
sp = mkCaseNoun sp ;
isIndefArt = False ;
qt = Article ;
objdef = Def ;
caseagr = True ;
} ;