1
0
forked from GitHub/gf-rgl

(Som) Add Predets

This commit is contained in:
Inari Listenmaa
2019-08-26 15:25:41 +02:00
parent ea6fcd4815
commit db8356aa49
3 changed files with 17 additions and 7 deletions

View File

@@ -62,7 +62,7 @@ concrete CatSom of Cat = CommonX - [Adv] ** open ResSom, Prelude in {
NP = ResSom.NounPhrase ;
Pron = ResSom.Pronoun ; --Pronouns need enough info to turn it into NP or Quant.
Det = ResSom.Determiner ;
Predet = {s : Str} ;
Predet = {s : Str ; da : DefArticle ; isPoss : Bool} ;
Quant = ResSom.Quant ;
Num = ResSom.Num ;
Ord = {s : Str ; n : Number} ;

View File

@@ -57,9 +57,18 @@ concrete NounSom of Noun = CatSom ** open ResSom, Prelude in {
UsePron pron = pron ** {st = Definite} ;
-- : Predet -> NP -> NP ; -- only the man
PredetNP predet np = np ** {
s = \\c => predet.s ++ np.s ! c ---- ?
} ;
PredetNP predet np =
let qnt = PossPron (pronTable ! np.a) ;
det = qnt.shortPoss ! predet.da ;
predetS : Str = case predet.isPoss of {
True => glue predet.s det ;
False => predet.s
} ;
in np ** {s = \\c =>
case <np.isPron,predet.isPoss> of {
<True,True> => np.empty ++ predetS ;
_ => np.s ! c ++ predetS}
} ;
-- A noun phrase can also be postmodified by the past participle of a

View File

@@ -51,10 +51,11 @@ lin or_Conj = {s2 = \\_ => "ama" ; s1 = [] ; n = Sg} ; -- mise with interrogativ
-----------------
-- *Det and Quant
{-
lin how8many_IDet = R.indefDet "" pl ;
lin all_Predet = { s = "" } ;
--lin how8many_IDet = R.indefDet "" pl ;
lin all_Predet = {s = "giddi" ; isPoss = True ; da = M GA} ;
{-
lin not_Predet = { s = "" } ;
lin only_Predet = { s = "" } ;
lin most_Predet = { s = "" } ;