Added overloaded mkQuant to ParadigmsEng.

This commit is contained in:
bjorn
2008-11-18 15:30:53 +00:00
parent eba86d2f24
commit 081b5707c3
3 changed files with 18 additions and 8 deletions

View File

@@ -21,13 +21,6 @@ resource MorphoEng = open Prelude, (Predef=Predef), ResEng in {
sp = regGenitiveS s ;
n = n} ;
mkQuant : Str -> Str -> {s : Bool => Number => Str; sp : Bool => Number => Case => Str } = \sg,pl -> mkQuant4 sg pl sg pl ;
mkQuant4 : Str -> Str -> Str -> Str -> {s : Bool => Number => Str; sp : Bool => Number => Case => Str } = \sg,pl,sg',pl' -> {
s = \\_ => table { Sg => sg ; Pl => pl } ;
sp = \\_ => table { Sg => regGenitiveS sg' ; Pl => regGenitiveS pl' }
} ;
regGenitiveS : Str -> Case => Str = \s ->
table { Gen => genitiveS s; _ => s } ;

View File

@@ -128,6 +128,12 @@ oper
mkPN : N -> PN
} ;
--3 Determiners and quantifiers
mkQuant : overload {
mkQuant : (this, these : Str) -> Quant ;
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant ;
} ;
--2 Adjectives
@@ -391,6 +397,17 @@ mkSubj : Str -> Subj = \s -> {s = s ; lock_Subj = <>} ;
g = g ; lock_PN = <>} ;
nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
mkQuant = overload {
mkQuant : (this, these : Str) -> Quant = \sg,pl -> mkQuantifier sg pl sg pl;
mkQuant : (no_sg, no_pl, none_sg, non_pl : Str) -> Quant = mkQuantifier;
} ;
mkQuantifier : Str -> Str -> Str -> Str -> Quant = \sg,pl,sg',pl' -> {
s = \\_ => table { Sg => sg ; Pl => pl } ;
sp = \\_ => table { Sg => regGenitiveS sg' ; Pl => regGenitiveS pl' } ;
lock_Quant = <>
} ;
mk2A a b = mkAdjective a a a b ** {lock_A = <>} ;
regA a = case a of {
_ + ("a" | "e" | "i" | "o" | "u" | "y") + ? + _ +

View File

@@ -123,7 +123,7 @@ concrete StructuralEng of Structural = CatEng **
youPol_Pron = mkPron "you" "you" "your" "yours" singular P2 human ;
not_Predet = {s = "not" ; lock_Predet = <>} ;
no_Quant = mkQuant4 "no" "no" "none" "none" ;
no_Quant = mkQuant "no" "no" "none" "none" ;
if_then_Conj = {s1 = "if" ; s2 = "then" ; n = singular ; lock_Conj = <>} ;
nobody_NP = regNP "nobody" singular ;
nothing_NP = regNP "nothing" singular ;