forked from GitHub/gf-rgl
(Hun) Add new QuantType param to Quants
This commit is contained in:
@@ -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 ;
|
||||
} ;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ;
|
||||
} ;
|
||||
|
||||
Reference in New Issue
Block a user