forked from GitHub/gf-rgl
inspected Combinators and marked todos
This commit is contained in:
@@ -38,20 +38,21 @@ incomplete resource Constructors = open Grammar in {
|
|||||||
|
|
||||||
mkText : overload {
|
mkText : overload {
|
||||||
mkText : Text ; -- [empty text]
|
mkText : Text ; -- [empty text]
|
||||||
|
mkText : Phr -> Text -> Text ; -- John walks. ...
|
||||||
mkText : Phr -> Text ; -- John walks.
|
mkText : Phr -> Text ; -- John walks.
|
||||||
mkText : Utt -> Text ; -- John walks.
|
mkText : Utt -> Text ; -- John walks.
|
||||||
mkText : S -> Text ; -- John walks.
|
mkText : S -> Text ; -- John walks.
|
||||||
mkText : Cl -> Text ; -- John walks.
|
mkText : Cl -> Text ; -- John walks.
|
||||||
mkText : QS -> Text ; -- Does John walk?
|
mkText : QS -> Text ; -- Does John walk?
|
||||||
mkText : Imp -> Text ; -- Walk!
|
mkText : Imp -> Text ; -- Walk!
|
||||||
mkText : Pol -> Imp -> Text ; -- Don't walk!
|
mkText : Pol -> Imp -> Text -- Don't walk!
|
||||||
mkText : Phr -> Text -> Text -- John walks. ...
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkPhr : overload {
|
mkPhr : overload {
|
||||||
mkPhr : PConj -> Utt -> Voc -> Phr; -- But go home my friend
|
mkPhr : PConj -> Utt -> Voc -> Phr ; -- But go home my friend
|
||||||
mkPhr : Utt -> Phr ; -- Go home
|
mkPhr : Utt -> Phr ; -- Go home
|
||||||
mkPhr : S -> Phr -- I go home
|
mkPhr : S -> Phr ; -- I go home
|
||||||
|
mkPhr : Cl -> Phr -- I go home
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkUtt : overload {
|
mkUtt : overload {
|
||||||
@@ -141,10 +142,10 @@ incomplete resource Constructors = open Grammar in {
|
|||||||
mkNP : Predet -> NP -> NP ; -- all the men
|
mkNP : Predet -> NP -> NP ; -- all the men
|
||||||
mkNP : NP -> V2 -> NP ; -- the number squared
|
mkNP : NP -> V2 -> NP ; -- the number squared
|
||||||
mkNP : NP -> Adv -> NP ; -- Paris at midnight
|
mkNP : NP -> Adv -> NP ; -- Paris at midnight
|
||||||
mkNP : Conj -> NP -> NP -> NP ; -- John and Mary walk
|
mkNP : Conj -> NP -> NP -> NP ; -- John and Mary
|
||||||
mkNP : DConj -> NP -> NP -> NP ; -- both John and Mary walk
|
mkNP : DConj -> NP -> NP -> NP ; -- both John and Mary
|
||||||
mkNP : Conj -> ListNP -> NP ; -- John, Mary, and Bill walk
|
mkNP : Conj -> ListNP -> NP ; -- John, Mary, and Bill
|
||||||
mkNP : DConj -> ListNP -> NP -- both John, Mary, and Bill walk
|
mkNP : DConj -> ListNP -> NP -- both John, Mary, and Bill
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
104
resource-1.0/api/todoConstructors.txt
Normal file
104
resource-1.0/api/todoConstructors.txt
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
-- Text
|
||||||
|
TQuestMark : Phr -> Text -> Text ; -- Are you OK? ...
|
||||||
|
TExclMark : Phr -> Text -> Text ; -- John walks! ...
|
||||||
|
|
||||||
|
-- Utt
|
||||||
|
UttImpPl : Pol -> Imp -> Utt; -- (don't) help yourselves
|
||||||
|
UttImpPol : Pol -> Imp -> Utt ; -- (don't) help (polite)
|
||||||
|
ImpPl1 : VP -> Utt ; -- let's go
|
||||||
|
|
||||||
|
-- Cl
|
||||||
|
GenericCl : VP -> Cl ; -- one sleeps
|
||||||
|
|
||||||
|
|
||||||
|
-- VP
|
||||||
|
ReflV2 : V2 -> VP ; -- use itself
|
||||||
|
PassV2 : V2 -> VP ; -- be used
|
||||||
|
ProgrVP : VP -> VP ; -- be sleeping
|
||||||
|
|
||||||
|
|
||||||
|
-- Verb: coercions
|
||||||
|
UseVQ : VQ -> V2 ; -- ask (a question)
|
||||||
|
UseVS : VS -> V2 ; -- know (a secret)
|
||||||
|
|
||||||
|
-- how to arrange and extend these
|
||||||
|
def_Det : Det ; -- the (man)
|
||||||
|
indef_Det : Det ; -- a (man)
|
||||||
|
mass_Det : Det ; -- (water)
|
||||||
|
|
||||||
|
-- Num
|
||||||
|
NumNumeral : Numeral -> Num ; -- fifty-one
|
||||||
|
AdNum : AdN -> Num -> Num ; -- almost 51
|
||||||
|
|
||||||
|
-- Ord
|
||||||
|
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
||||||
|
|
||||||
|
-- Adjective: strange rule, not covered
|
||||||
|
UseA2 : A2 -> A ; -- divisible
|
||||||
|
|
||||||
|
-- CAdv (in Adverb)
|
||||||
|
AdnCAdv : CAdv -> AdN ; -- more (than five)
|
||||||
|
|
||||||
|
-- QCl
|
||||||
|
QuestIComp : IComp -> NP -> QCl ; -- where is John
|
||||||
|
|
||||||
|
-- mkIAdv
|
||||||
|
PrepIP : Prep -> IP -> IAdv ; -- with whom
|
||||||
|
|
||||||
|
-- mkIComp
|
||||||
|
CompIAdv : IAdv -> IComp ; -- where
|
||||||
|
|
||||||
|
-- ListX = ListAdv, ListAP, ListNP, ListS
|
||||||
|
BaseX
|
||||||
|
ConsX
|
||||||
|
|
||||||
|
-- RS, QS: all special cases found in S?
|
||||||
|
|
||||||
|
-- Pol, Tense, Ant
|
||||||
|
PPos, PNeg : Pol ; -- I sleep/don't sleep
|
||||||
|
TPres : Tense ;
|
||||||
|
ASimul : Ant ;
|
||||||
|
TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent
|
||||||
|
AAnter : Ant ; -- I have slept --# notpresent
|
||||||
|
|
||||||
|
|
||||||
|
------------------------------------------
|
||||||
|
--- strange cats:
|
||||||
|
|
||||||
|
SC
|
||||||
|
mkCN : CN -> SC -> CN ; -- fact that John smokes, question if he does
|
||||||
|
mkCN : N -> SC -> CN ; -- fact that John smokes, question if he does
|
||||||
|
mkAP : AP -> SC -> AP ; -- great that she won; uncertain if she did
|
||||||
|
|
||||||
|
Slash
|
||||||
|
mkQCl : IP -> Slash -> QCl ; -- who does John love
|
||||||
|
mkRCl : RP -> Slash -> RCl -- whom John loves
|
||||||
|
mkSlash : Slash -> Adv -> Slash ; -- (whom) he sees tomorrow
|
||||||
|
|
||||||
|
VP?
|
||||||
|
-- appears in 9 places, of which 2 are recursive
|
||||||
|
|
||||||
|
-- Comp: already eliminated
|
||||||
|
|
||||||
|
--------------------------------------------
|
||||||
|
--- granted special cases
|
||||||
|
|
||||||
|
Text - Phr - Utt
|
||||||
|
|
||||||
|
S - Cl -- Tense Ant Pol
|
||||||
|
QS - QCl
|
||||||
|
RS - RCl
|
||||||
|
|
||||||
|
VP - V | V2 NP | V3 NP NP ...
|
||||||
|
|
||||||
|
NP - PN | Pron
|
||||||
|
|
||||||
|
CN - N
|
||||||
|
|
||||||
|
AP - A
|
||||||
|
|
||||||
|
Det - Num | Int | Digit
|
||||||
|
|
||||||
|
Num - Numeral | Digit | Int
|
||||||
|
|
||||||
|
ListX - X X
|
||||||
@@ -115,15 +115,7 @@ oper
|
|||||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||||
|
|
||||||
|
|
||||||
--3 Relational common noun phrases
|
|
||||||
--
|
|
||||||
-- In some cases, you may want to make a complex $CN$ into a
|
|
||||||
-- relational noun (e.g. "the old town hall of").
|
|
||||||
|
|
||||||
cnN2 : CN -> Prep -> N2 ;
|
|
||||||
cnN3 : CN -> Prep -> Prep -> N3 ;
|
|
||||||
|
|
||||||
--
|
|
||||||
--3 Proper names and noun phrases
|
--3 Proper names and noun phrases
|
||||||
--
|
--
|
||||||
-- Proper names, with a regular genitive, are formed as follows
|
-- Proper names, with a regular genitive, are formed as follows
|
||||||
@@ -346,6 +338,16 @@ oper
|
|||||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||||
regN2 n = mkN2 (regN n) (mkPrep "of") ;
|
regN2 n = mkN2 (regN n) (mkPrep "of") ;
|
||||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||||
|
|
||||||
|
--3 Relational common noun phrases
|
||||||
|
--
|
||||||
|
-- In some cases, you may want to make a complex $CN$ into a
|
||||||
|
-- relational noun (e.g. "the old town hall of").
|
||||||
|
|
||||||
|
cnN2 : CN -> Prep -> N2 ;
|
||||||
|
cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||||
|
|
||||||
|
-- This is obsolete.
|
||||||
cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||||
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user