diff --git a/resource-0.6/shallow/Shallow.gf b/resource-0.6/shallow/Shallow.gf index 630966fd4..c066c060a 100644 --- a/resource-0.6/shallow/Shallow.gf +++ b/resource-0.6/shallow/Shallow.gf @@ -8,6 +8,11 @@ -- It is not primarily aimed to be used through selection from the API, -- but through a parser. -- It can also serve for experiments with shallow (fast?) parsing. +-- +-- S ::= NP Adv* V NP? Adv* +-- | NP Adv* "is" Adj Adv* +-- NP ::= Det CN +-- CN ::= Adj* N abstract Shallow = { cat @@ -21,38 +26,84 @@ abstract Shallow = { N ; Noun ; CN ; - NP ; PN ; + NP ; + Det ; Adv ; Prep ; + Num ; fun - PhrS : S -> Phr ; - PhrQu : Qu -> Phr ; + PhrS : S -> Phr ; + PhrQu : Qu -> Phr ; PhrImp : Imp -> Phr ; - SVerb, SNegVerb : NP -> Verb -> S ; + SVerb, SNegVerb : NP -> Verb -> S ; SVerbPP, SNegVerbPP : NP -> Verb -> Adv -> S ; - STV, SNegTV : NP -> TV -> NP -> S ; - SAdj, SNegAdj : NP -> Adj -> S ; - SAdjPP, SNegAdjPP : NP -> Adj -> Adv -> S ; - SCN, SNegCN : NP -> CN -> S ; - SAdv,SNegAdv : NP -> Adv -> S ; + STV, SNegTV : NP -> TV -> NP -> S ; + SAdj, SNegAdj : NP -> Adj -> S ; + SAdjPP, SNegAdjPP : NP -> Adj -> Adv -> S ; + SCN, SNegCN : NP -> CN -> S ; + SAdv,SNegAdv : NP -> Adv -> S ; - QuVerb, QuNegVerb : NP -> Verb -> Qu ; + QuVerb, QuNegVerb : NP -> Verb -> Qu ; ImpVerb, ImpNegVerb : Verb -> Imp ; - ImpAdj, ImpNegAdj : Adj -> Imp ; - ImpCN, ImpNegCN : CN -> Imp ; - ImpAdv,ImpNegAdv : Adv -> Imp ; + ImpAdj, ImpNegAdj : Adj -> Imp ; + ImpCN, ImpNegCN : CN -> Imp ; + ImpAdv,ImpNegAdv : Adv -> Imp ; - ModNoun : Adj -> Noun -> Noun ; - PrepNP : Prep -> NP -> Adv ; - PrepNoun : CN -> Prep -> NP -> CN ; - CNNoun : Noun -> CN ; - NounN : N -> Noun ; - DefNP, IndefNP, EveryNP, AllNP : CN -> NP ; UsePN : PN -> NP ; + DefNP : CN -> NP ; + IndefNP : CN -> NP ; + DetNP : Det -> CN -> NP ; + + PrepNP : Prep -> NP -> Adv ; + AdvNoun : CN -> Adv -> CN ; + + CNNoun : Noun -> CN ; + NounN : N -> Noun ; + ModNoun : Adj -> Noun -> Noun ; + + NoNum : Num ; + +-- copied from Structural + + EveryDet, WhichDet, AllMassDet, -- every, sg which, sg all + SomeDet, AnyDet, NoDet, -- sg some, any, no + MostDet, MostsDet, ManyDet, MuchDet : Det ; -- sg most, pl most, many, much + ThisDet, ThatDet : Det ; -- this, that + + AllNumDet, WhichNumDet, -- pl all, which (86) + SomeNumDet, AnyNumDet, NoNumDet, -- pl some, any, no + TheseNumDet, ThoseNumDet : Num -> Det ; -- these, those (86) + + ThisNP, ThatNP : NP ; -- this, that + TheseNumNP, ThoseNumNP : Num -> NP ; -- these, those (86) + INP, ThouNP, HeNP, SheNP, ItNP : NP ; -- personal pronouns in singular + WeNumNP, YeNumNP : Num -> NP ; -- these pronouns can take numeral + TheyNP : NP ; YouNP : NP ; -- they, the polite you + + EverybodyNP, SomebodyNP, NobodyNP, -- everybody, somebody, nobody + EverythingNP, SomethingNP, NothingNP : NP ; -- everything, something, nothing + + + InPrep, OnPrep, ToPrep, FromPrep, -- spatial relations + ThroughPrep, AbovePrep, UnderPrep, + InFrontPrep, BehindPrep, BetweenPrep : Prep ; + BeforePrep, DuringPrep, AfterPrep : Prep ; -- temporal relations + WithPrep, WithoutPrep, ByMeansPrep : Prep ; -- some other relations + PossessPrep : Prep ; -- possessive/genitive + PartPrep : Prep ; -- partitive "of" ("bottle of wine") + AgentPrep : Prep ; -- agent "by" in passive constructions + + +--! +--2 Affirmation and negation +-- +-- The negative-positive (French "si", German "doch") is missing. + + PhrYes, PhrNo : Phr ; -- yes, no + - PossessPrep : Prep ; } diff --git a/resource-0.6/shallow/ShallowI.gf b/resource-0.6/shallow/ShallowI.gf index 88ab312d6..eded46819 100644 --- a/resource-0.6/shallow/ShallowI.gf +++ b/resource-0.6/shallow/ShallowI.gf @@ -17,6 +17,7 @@ incomplete concrete ShallowI of Shallow = open (Resource = Resource) in { Adv = Resource.AdV ; Det = Resource.Det ; Prep = Resource.Prep ; + Num = Resource.Num ; lin PhrS = Resource.IndicPhrase ; @@ -63,15 +64,76 @@ incomplete concrete ShallowI of Shallow = open (Resource = Resource) in { ModNoun a n = Resource.ModAdj (Resource.AdjP1 a) n ; PrepNP = Resource.PrepNP ; - PrepNoun f p x = Resource.AdvCN f (Resource.PrepNP p x) ; + AdvNoun f a = Resource.AdvCN f a ; NounN = Resource.UseN ; CNNoun n = n ; - AllNP = Resource.DetNP (Resource.AllNumDet Resource.NoNum) ; - EveryNP = Resource.DetNP Resource.EveryDet ; + DetNP = Resource.DetNP ; DefNP = Resource.DefOneNP ; IndefNP = Resource.IndefOneNP ; UsePN = Resource.UsePN ; - PossessPrep = Resource.PossessPrep ; +-- created in hugs from gf Warning lines by: +-- do {s <- readFile "koe2" ; mapM_ (appendFile "koe3" . (\f -> f ++ " = Resource." ++ f ++ " ;\n") . last . words) (lines s)} + +AfterPrep = Resource.AfterPrep ; +AgentPrep = Resource.AgentPrep ; +AllMassDet = Resource.AllMassDet ; +AllNumDet = Resource.AllNumDet ; +AnyDet = Resource.AnyDet ; +AnyNumDet = Resource.AnyNumDet ; +BeforePrep = Resource.BeforePrep ; +BehindPrep = Resource.BehindPrep ; +BetweenPrep = Resource.BetweenPrep ; +ByMeansPrep = Resource.ByMeansPrep ; +DuringPrep = Resource.DuringPrep ; +EveryDet = Resource.EveryDet ; +EverybodyNP = Resource.EverybodyNP ; +EverythingNP = Resource.EverythingNP ; +FromPrep = Resource.FromPrep ; +HeNP = Resource.HeNP ; +INP = Resource.INP ; +InFrontPrep = Resource.InFrontPrep ; +InPrep = Resource.InPrep ; +ItNP = Resource.ItNP ; +ManyDet = Resource.ManyDet ; +MostDet = Resource.MostDet ; +MostsDet = Resource.MostsDet ; +MuchDet = Resource.MuchDet ; +NoDet = Resource.NoDet ; +NoNum = Resource.NoNum ; +NoNumDet = Resource.NoNumDet ; +NobodyNP = Resource.NobodyNP ; +NothingNP = Resource.NothingNP ; +OnPrep = Resource.OnPrep ; +PartPrep = Resource.PartPrep ; +PhrNo = Resource.PhrNo ; +PhrYes = Resource.PhrYes ; +PossessPrep = Resource.PossessPrep ; +SheNP = Resource.SheNP ; +SomeDet = Resource.SomeDet ; +SomeNumDet = Resource.SomeNumDet ; +SomebodyNP = Resource.SomebodyNP ; +SomethingNP = Resource.SomethingNP ; +ThatDet = Resource.ThatDet ; +ThatNP = Resource.ThatNP ; +TheseNumDet = Resource.TheseNumDet ; +TheseNumNP = Resource.TheseNumNP ; +TheyNP = Resource.TheyNP ; +ThisDet = Resource.ThisDet ; +ThisNP = Resource.ThisNP ; +ThoseNumDet = Resource.ThoseNumDet ; +ThoseNumNP = Resource.ThoseNumNP ; +ThouNP = Resource.ThouNP ; +ThroughPrep = Resource.ThroughPrep ; +ToPrep = Resource.ToPrep ; +UnderPrep = Resource.UnderPrep ; +WeNumNP = Resource.WeNumNP ; +WhichDet = Resource.WhichDet ; +WhichNumDet = Resource.WhichNumDet ; +WithPrep = Resource.WithPrep ; +WithoutPrep = Resource.WithoutPrep ; +YeNumNP = Resource.YeNumNP ; +YouNP = Resource.YouNP ; + }