mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-29 04:38:55 -06:00
simplified adjectival predication
This commit is contained in:
@@ -45,7 +45,7 @@ lincat
|
||||
-- = {s : AForm => Str}
|
||||
A2 = Adjective ** {s2 : Preposition} ;
|
||||
ADeg = {s : Degree => AForm => Str} ;
|
||||
AP = Adjective ** {p : Bool} ;
|
||||
AP = {s : Agr => Str ; p : Bool} ;
|
||||
AS = Adjective ; --- "more difficult for him to come than..."
|
||||
A2S = Adjective ** {s2 : Preposition} ;
|
||||
AV = Adjective ;
|
||||
@@ -102,7 +102,7 @@ lincat
|
||||
ConjD = {s1 : Str ; s2 : Str ; n : Number} ;
|
||||
|
||||
ListS = {s1 : Str ; s2 : Str} ;
|
||||
ListAP = {s1,s2 : AForm => Str ; p : Bool} ;
|
||||
ListAP = {s1,s2 : Agr => Str ; p : Bool} ;
|
||||
ListNP = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||
ListAdv = {s1 : Str ; s2 : Str} ;
|
||||
|
||||
|
||||
@@ -22,15 +22,11 @@ concrete ClauseEng of Clause = CategoriesEng **
|
||||
SPredV2S np v x y = predVerbClause np v (complDitransSentVerb v x y) ;
|
||||
SPredV2Q np v x y = predVerbClause np v (complDitransQuestVerb v x y) ;
|
||||
|
||||
SPredAP np v = predBeGroup np (complAdjective v) ;
|
||||
SPredSuperl np a = predBeGroup np (complAdjective (superlAdjPhrase a)) ;
|
||||
SPredAP np v = predBeGroup np v.s ;
|
||||
SPredCN np v = predBeGroup np (complCommNoun v) ;
|
||||
SPredNP np v = predBeGroup np (complNounPhrase v) ;
|
||||
SPredAdv np v = predBeGroup np (complAdverb v) ;
|
||||
|
||||
SPredAV np v x = predBeGroup np (complVerbAdj v x) ;
|
||||
SPredObjA2V np v x y = predBeGroup np (complVerbAdj2 True v x y) ;
|
||||
|
||||
SPredProgVP = progressiveClause ;
|
||||
|
||||
QPredV np v = intVerbClause np v (complVerb v) ;
|
||||
@@ -49,18 +45,15 @@ concrete ClauseEng of Clause = CategoriesEng **
|
||||
QPredV2S np v x y = intVerbClause np v (complDitransSentVerb v x y) ;
|
||||
QPredV2Q np v x y = intVerbClause np v (complDitransQuestVerb v x y) ;
|
||||
|
||||
QPredAP np v = predBeGroupQ np (complAdjective v) ;
|
||||
QPredSuperl np a = predBeGroupQ np (complAdjective (superlAdjPhrase a)) ;
|
||||
QPredAP np v = predBeGroupQ np v.s ;
|
||||
QPredCN np v = predBeGroupQ np (complCommNoun v) ;
|
||||
QPredNP np v = predBeGroupQ np (complNounPhrase v) ;
|
||||
QPredAdv np v = predBeGroupQ np (complAdverb v) ;
|
||||
QPredAV np v x = predBeGroupQ np (complVerbAdj v x) ;
|
||||
QPredObjA2V np v x y = predBeGroupQ np (complVerbAdj2 True v x y) ;
|
||||
|
||||
IPredV a v = predVerbI True a v (complVerb v) ;
|
||||
IPredV2 a v x = predVerbI True a v (complTransVerb v x) ;
|
||||
|
||||
IPredAP a v = predBeGroupI True a (complAdjective v) ;
|
||||
IPredAP a v = predBeGroupI True a v.s ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
@@ -66,9 +66,12 @@ lin
|
||||
UseA = adj2adjPhrase ;
|
||||
ComplA2 = complAdj ;
|
||||
|
||||
PositADeg = positAdjPhrase ;
|
||||
ComplAV v x = complVerbAdj v x ;
|
||||
ComplObjA2V v x y = complVerbAdj2 True v x y ;
|
||||
|
||||
PositADeg = positAdjPhrase ;
|
||||
ComparADeg = comparAdjPhrase ;
|
||||
SuperlNP = superlNounPhrase ;
|
||||
SuperlADeg = superlAdjPhrase ;
|
||||
|
||||
-- verbs and verb prases
|
||||
|
||||
@@ -78,7 +81,6 @@ lin
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 = transAsVerb ;
|
||||
---- ComplV3 = complDitransVerb ;
|
||||
|
||||
ComplA2S = predAdjSent2 ;
|
||||
|
||||
|
||||
@@ -196,9 +196,14 @@ oper
|
||||
-- Adjectival phrases have a parameter $p$ telling if they are prefixed ($True$) or
|
||||
-- postfixed (complex APs).
|
||||
|
||||
AdjPhrase : Type = Adjective ** {p : Bool} ;
|
||||
AdjPhrase : Type = {s : Agr => Str ; p : Bool} ;
|
||||
|
||||
adj2adjPhrase : Adjective -> AdjPhrase = \new -> new ** {p = True} ;
|
||||
noAPAgr : Agr = ASgP2 ;
|
||||
|
||||
adj2adjPhrase : Adjective -> AdjPhrase = \new ->
|
||||
{s = \\_ => new.s ! AAdj ;
|
||||
p = True
|
||||
} ;
|
||||
|
||||
simpleAdjPhrase : Str -> AdjPhrase = \French ->
|
||||
adj2adjPhrase (regAdjective French) ;
|
||||
@@ -217,7 +222,7 @@ oper
|
||||
-- adjectival phrases ("bigger then you").
|
||||
|
||||
comparAdjPhrase : AdjDegr -> NounPhrase -> AdjPhrase = \big, you ->
|
||||
{s = \\a => big.s ! Comp ! a ++ "than" ++ you.s ! NomP ;
|
||||
{s = \\_ => big.s ! Comp ! AAdj ++ "than" ++ you.s ! NomP ;
|
||||
p = False
|
||||
} ;
|
||||
|
||||
@@ -233,7 +238,7 @@ oper
|
||||
-- ("the youngest" - in free variation).
|
||||
|
||||
superlAdjPhrase : AdjDegr -> AdjPhrase = \big ->
|
||||
{s = \\a => "the" ++ big.s ! Sup ! a ;
|
||||
{s = \\_ => "the" ++ big.s ! Sup ! AAdj ;
|
||||
p = True
|
||||
} ;
|
||||
|
||||
@@ -247,7 +252,7 @@ oper
|
||||
AdjCompl = Adjective ** {s2 : Preposition} ;
|
||||
|
||||
complAdj : AdjCompl -> NounPhrase -> AdjPhrase = \related,john ->
|
||||
{s = \\a => related.s ! a ++ related.s2 ++ john.s ! AccP ;
|
||||
{s = \\a => related.s ! AAdj ++ related.s2 ++ john.s ! AccP ;
|
||||
p = False
|
||||
} ;
|
||||
|
||||
@@ -263,8 +268,12 @@ oper
|
||||
|
||||
modCommNounPhrase : AdjPhrase -> CommNounPhrase -> CommNounPhrase = \big, car ->
|
||||
{s = \\n => if_then_else (Case => Str) big.p
|
||||
(\\c => big.s ! AAdj ++ car.s ! n ! c)
|
||||
(table {Nom => car.s ! n ! Nom ++ big.s ! AAdj ; Gen => variants {}}) ;
|
||||
(\\c => big.s ! noAPAgr ++ car.s ! n ! c)
|
||||
(\\c => car.s ! n ! Nom ++ big.s ! noAPAgr ++ case c of {
|
||||
Nom => [] ;
|
||||
Gen => "'s" --- detached clitic
|
||||
}
|
||||
) ;
|
||||
g = car.g
|
||||
} ;
|
||||
|
||||
@@ -537,7 +546,7 @@ oper
|
||||
-- The syntax is the same as for adjectival predication.
|
||||
|
||||
passVerb : Verb -> Complement = \love ->
|
||||
complAdjective (adj2adjPhrase (regAdjective (love.s ! PPart))) ;
|
||||
complAdjective (regAdjective (love.s ! PPart)) ;
|
||||
|
||||
-- Transitive verbs can also be used reflexively.
|
||||
-- But to formalize this we must make verb phrases depend on a person parameter.
|
||||
@@ -570,13 +579,14 @@ oper
|
||||
TransVerb -> NounPhrase -> AdjPhrase -> Complement = \gor,dig,sur ->
|
||||
mkComp
|
||||
gor
|
||||
(\\_ => gor.s1 ++ gor.s3 ++ dig.s ! AccP ++ sur.s ! AAdj) ;
|
||||
(\\_ => gor.s1 ++ gor.s3 ++ dig.s ! AccP ++ sur.s ! noAPAgr) ;
|
||||
---- should be agr a; make mkComp more general
|
||||
|
||||
complAdjVerb :
|
||||
Verb -> AdjPhrase -> Complement = \seut,sur ->
|
||||
mkComp
|
||||
seut
|
||||
(\\n => sur.s ! AAdj ++ seut.s1) ;
|
||||
(\\n => sur.s ! noAPAgr ++ seut.s1) ;
|
||||
|
||||
|
||||
--2 Adverbs
|
||||
@@ -917,23 +927,26 @@ oper
|
||||
(simma.s ! VIInfinit ! a)
|
||||
) ;
|
||||
|
||||
complVerbAdj : Adjective -> VerbPhrase -> Complement = \grei, simma ->
|
||||
(\\a =>
|
||||
complVerbAdj : Adjective -> VerbPhrase -> AdjPhrase = \grei, simma ->
|
||||
{s = \\a =>
|
||||
grei.s ! AAdj ++ simma.s1 ++
|
||||
"to" ++
|
||||
simma.s ! VIInfinit ! a) ;
|
||||
simma.s ! VIInfinit ! a ;
|
||||
p = False
|
||||
} ;
|
||||
|
||||
complVerbAdj2 :
|
||||
Bool -> AdjCompl -> NounPhrase -> VerbPhrase -> Complement =
|
||||
Bool -> AdjCompl -> NounPhrase -> VerbPhrase -> AdjPhrase =
|
||||
\obj,grei,dig,simma ->
|
||||
(\\a =>
|
||||
{s = \\a =>
|
||||
grei.s ! AAdj ++
|
||||
grei.s2 ++ dig.s ! AccP ++
|
||||
simma.s1 ++ "to" ++
|
||||
if_then_Str obj
|
||||
(simma.s ! VIInfinit ! dig.a)
|
||||
(simma.s ! VIInfinit ! a)
|
||||
) ;
|
||||
(simma.s ! VIInfinit ! a) ;
|
||||
p = False
|
||||
} ;
|
||||
|
||||
|
||||
--2 Sentences missing noun phrases
|
||||
@@ -1323,20 +1336,20 @@ oper
|
||||
-- The structure is the same as for sentences. The result is a prefix adjective
|
||||
-- if and only if all elements are prefix.
|
||||
|
||||
ListAdjPhrase : Type = {s1,s2 : AForm => Str ; p : Bool} ;
|
||||
ListAdjPhrase : Type = {s1,s2 : Agr => Str ; p : Bool} ;
|
||||
|
||||
twoAdjPhrase : (_,_ : AdjPhrase) -> ListAdjPhrase = \x,y ->
|
||||
CO.twoTable AForm x y ** {p = andB x.p y.p} ;
|
||||
CO.twoTable Agr x y ** {p = andB x.p y.p} ;
|
||||
|
||||
consAdjPhrase : ListAdjPhrase -> AdjPhrase -> ListAdjPhrase = \xs,x ->
|
||||
CO.consTable AForm CO.comma xs x ** {p = andB xs.p x.p} ;
|
||||
CO.consTable Agr CO.comma xs x ** {p = andB xs.p x.p} ;
|
||||
|
||||
conjunctAdjPhrase : Conjunction -> ListAdjPhrase -> AdjPhrase = \c,xs ->
|
||||
CO.conjunctTable AForm c xs ** {p = xs.p} ;
|
||||
CO.conjunctTable Agr c xs ** {p = xs.p} ;
|
||||
|
||||
conjunctDistrAdjPhrase : ConjunctionDistr -> ListAdjPhrase -> AdjPhrase =
|
||||
\c,xs ->
|
||||
CO.conjunctDistrTable AForm c xs ** {p = xs.p} ;
|
||||
CO.conjunctDistrTable Agr c xs ** {p = xs.p} ;
|
||||
|
||||
|
||||
--3 Coordinating noun phrases
|
||||
|
||||
@@ -38,15 +38,11 @@ concrete VerbphraseEng of Verbphrase = CategoriesEng **
|
||||
ComplV2S v x y = predClauseGroup v (complDitransSentVerb v x y) ;
|
||||
ComplV2Q v x y = predClauseGroup v (complDitransQuestVerb v x y) ;
|
||||
|
||||
PredAP v = predClauseBeGroup (complAdjective v) ;
|
||||
PredSuperl a = predClauseBeGroup (complAdjective (superlAdjPhrase a)) ;
|
||||
PredAP v = predClauseBeGroup v.s ;
|
||||
PredCN v = predClauseBeGroup (complCommNoun v) ;
|
||||
PredNP v = predClauseBeGroup (complNounPhrase v) ;
|
||||
PredAdv v = predClauseBeGroup (complAdverb v) ;
|
||||
|
||||
PredAV v x = predClauseBeGroup (complVerbAdj v x) ;
|
||||
PredObjA2V v x y = predClauseBeGroup (complVerbAdj2 True v x y) ;
|
||||
|
||||
PredProgVP = progressiveVerbPhrase ;
|
||||
|
||||
---- SPredProgVP = progressiveClause ;
|
||||
|
||||
Reference in New Issue
Block a user