forked from GitHub/gf-core
continued restructuring of resources
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
abstract Basic = Shallow ** {
|
||||
abstract Basic = Categories ** {
|
||||
fun
|
||||
airplane_N : N ;
|
||||
answer_V2S : V2S ;
|
||||
@@ -12,8 +12,7 @@ abstract Basic = Shallow ** {
|
||||
beautiful_ADeg : ADeg ;
|
||||
become_VA : VA ;
|
||||
beer_N : N ;
|
||||
beg_VV : VV ;
|
||||
be_V : V ;
|
||||
beg_V2V : V2V ;
|
||||
big_ADeg : ADeg ;
|
||||
bike_N : N ;
|
||||
bird_N : N ;
|
||||
@@ -58,6 +57,7 @@ abstract Basic = Shallow ** {
|
||||
dog_N : N ;
|
||||
door_N : N ;
|
||||
drink_V2 : V2 ;
|
||||
easy_A2V : A2V ;
|
||||
eat_V2 : V2 ;
|
||||
enemy_N : N ;
|
||||
factory_N : N ;
|
||||
@@ -70,6 +70,7 @@ abstract Basic = Shallow ** {
|
||||
fridge_N : N ;
|
||||
friend_N : N ;
|
||||
fruit_N : N ;
|
||||
fun_AV : AV ;
|
||||
garden_N : N ;
|
||||
girl_N : N ;
|
||||
glove_N : N ;
|
||||
@@ -105,6 +106,7 @@ abstract Basic = Shallow ** {
|
||||
love_N : N ;
|
||||
love_V2 : V2 ;
|
||||
man_N : N ;
|
||||
married_A2 : A2 ;
|
||||
meat_N : N ;
|
||||
milk_N : N ;
|
||||
moon_N : N ;
|
||||
@@ -117,6 +119,7 @@ abstract Basic = Shallow ** {
|
||||
oil_N : N ;
|
||||
old_ADeg : ADeg ;
|
||||
open_V2 : V2 ;
|
||||
paint_V2A : V2A ;
|
||||
paper_N : N ;
|
||||
peace_N : N ;
|
||||
pen_N : N ;
|
||||
@@ -125,8 +128,10 @@ abstract Basic = Shallow ** {
|
||||
play_V2 : V2 ;
|
||||
policeman_N : N ;
|
||||
priest_N : N ;
|
||||
probable_AS : AS ;
|
||||
queen_N : N ;
|
||||
radio_N : N ;
|
||||
rain_V0 : V0 ;
|
||||
read_V2 : V2 ;
|
||||
red_ADeg : ADeg ;
|
||||
religion_N : N ;
|
||||
@@ -164,9 +169,10 @@ abstract Basic = Shallow ** {
|
||||
student_N : N ;
|
||||
stupid_ADeg : ADeg ;
|
||||
sun_N : N ;
|
||||
switch8off_V : V ;
|
||||
switch8on_V : V ;
|
||||
switch8off_V2 : V2 ;
|
||||
switch8on_V2 : V2 ;
|
||||
table_N : N ;
|
||||
talk_V3 : V3 ;
|
||||
teacher_N : N ;
|
||||
teach_V2 : V2 ;
|
||||
television_N : N ;
|
||||
@@ -191,6 +197,7 @@ abstract Basic = Shallow ** {
|
||||
wine_N : N ;
|
||||
win_V2 : V2 ;
|
||||
woman_N : N ;
|
||||
wonder_VQ : VQ ;
|
||||
wood_N : N ;
|
||||
write_V2 : V2 ;
|
||||
yellow_ADeg : ADeg ;
|
||||
|
||||
72
lib/resource/abstract/Clause.gf
Normal file
72
lib/resource/abstract/Clause.gf
Normal file
@@ -0,0 +1,72 @@
|
||||
--!
|
||||
--1 Rules for predication forming clauses
|
||||
--
|
||||
-- This module treats predications in a shallow way, without right-branching
|
||||
-- $VP$ structures, which have the disadvantage of duplicating rules but the
|
||||
-- advantage of fast parsing due to elimination of discontinuous constituents.
|
||||
--
|
||||
-- The principal way of forming sentences ($S$) is by combining a noun phrase
|
||||
-- with a verb and its complements.
|
||||
|
||||
abstract Clause = Categories ** {
|
||||
|
||||
fun
|
||||
SPredV : NP -> V -> Cl ; -- "John walks"
|
||||
SPredPassV : NP -> V -> Cl ; -- "John is seen"
|
||||
SPredV2 : NP -> V2 -> NP -> Cl ; -- "John sees Mary"
|
||||
SPredReflV2 : NP -> V2 -> Cl ; -- "John loves himself"
|
||||
SPredVS : NP -> VS -> S -> Cl ; -- "John says that Mary runs"
|
||||
SPredVV : NP -> VV -> VPI -> Cl ; -- "John must walk"
|
||||
SPredVQ : NP -> VQ -> QS -> Cl ; -- "John asks who will come"
|
||||
SPredVA : NP -> VA -> AP -> Cl ; -- "John looks ill"
|
||||
SPredV2A : NP -> V2A -> NP ->AP ->Cl ; -- "John paints the house red"
|
||||
SPredSubjV2V : NP -> V2V -> NP ->VPI ->Cl ; -- "John promises Mary to leave"
|
||||
SPredObjV2V : NP -> V2V -> NP -> VPI -> Cl ; -- "John asks me to come"
|
||||
SPredV2S : NP -> V2S -> NP -> S -> Cl ; -- "John told me that it is good"
|
||||
SPredV2Q : NP -> V2Q -> NP -> QS -> Cl ; -- "John asked me if it is good"
|
||||
|
||||
SPredAP : NP -> AP -> Cl ; -- "John is old"
|
||||
SPredSuperl : NP -> ADeg -> Cl ; -- "John is the oldest"
|
||||
SPredCN : NP -> CN -> Cl ; -- "John is a man"
|
||||
SPredNP : NP -> NP -> Cl ; -- "John is Bill"
|
||||
SPredPP : NP -> PP -> Cl ; -- "John is in France"
|
||||
SPredAV : NP -> AV ->VPI ->Cl ; -- "John is eager to leave"
|
||||
SPredObjA2V : NP -> A2V -> NP ->VPI ->Cl ; -- "John is easy for us to convince"
|
||||
|
||||
QPredV : IP -> V -> QCl ; -- "who walks"
|
||||
QPredPassV : IP -> V -> QCl ; -- "who is seen"
|
||||
QPredV2 : IP -> V2 -> NP -> QCl ; -- "who sees Mary"
|
||||
QPredReflV2 : IP -> V2 -> QCl ; -- "who loves himself"
|
||||
QPredVS : IP -> VS -> S -> QCl ; -- "who says that Mary runs"
|
||||
QPredVV : IP -> VV -> VPI -> QCl ; -- "who must walk"
|
||||
QPredVQ : IP -> VQ -> QS -> QCl ; -- "who asks who will come"
|
||||
QPredVA : IP -> VA -> AP -> QCl ; -- "who looks ill"
|
||||
QPredV2A : IP -> V2A -> NP ->AP ->QCl ; -- "who paints the house red"
|
||||
QPredSubjV2V : IP -> V2V -> NP ->VPI ->QCl ; -- "who promises Mary to leave"
|
||||
QPredObjV2V : IP -> V2V -> NP -> VPI -> QCl ; -- "who asks me to come"
|
||||
QPredV2S : IP -> V2S -> NP -> S -> QCl ; -- "who told me that it is good"
|
||||
QPredV2Q : IP -> V2Q -> NP -> QS -> QCl ; -- "who asked me if it is good"
|
||||
|
||||
QPredAP : IP -> AP -> QCl ; -- "who is old"
|
||||
QPredSuperl : IP -> ADeg -> QCl ; -- "who is the oldest"
|
||||
QPredCN : IP -> CN -> QCl ; -- "who is a man"
|
||||
QPredNP : IP -> NP -> QCl ; -- "who is Bill"
|
||||
QPredPP : IP -> PP -> QCl ; -- "who is in France"
|
||||
QPredAV : IP -> AV ->VPI ->QCl ; -- "who is eager to leave"
|
||||
QPredObjA2V : IP -> A2V -> NP ->VPI ->QCl ; -- "who is easy for us to convince"
|
||||
|
||||
|
||||
{-
|
||||
-- These rules *use* verb phrases.
|
||||
|
||||
PredVP : NP -> VP -> Cl ; -- "John walks"
|
||||
RelVP : RP -> VP -> RCl ; -- "who walks", "who doesn't walk"
|
||||
IntVP : IP -> VP -> QCl ; -- "who walks"
|
||||
|
||||
PosVP, NegVP : Ant -> VP -> VPI ; -- to eat, not to eat
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
-}
|
||||
|
||||
} ;
|
||||
23
lib/resource/abstract/Country.gf
Normal file
23
lib/resource/abstract/Country.gf
Normal file
@@ -0,0 +1,23 @@
|
||||
abstract Country = {
|
||||
|
||||
cat
|
||||
Country ; Nationality ; Language ;
|
||||
fun
|
||||
Denmark,
|
||||
England,
|
||||
Finland,
|
||||
France,
|
||||
Germany,
|
||||
Italy,
|
||||
Norway,
|
||||
Russia,
|
||||
Spain,
|
||||
Sweden
|
||||
: Country ;
|
||||
Danish,
|
||||
English
|
||||
: Nationality ;
|
||||
DanishLang,
|
||||
EnglishLang
|
||||
: Language ;
|
||||
} ;
|
||||
@@ -54,43 +54,17 @@ fun
|
||||
SuperlNP : ADeg -> CN -> NP ; -- "the oldest man"
|
||||
|
||||
|
||||
|
||||
--!
|
||||
--3 Verbs and verb phrases
|
||||
--
|
||||
-- The principal way of forming sentences ($S$) is by combining a noun phrase
|
||||
-- with a verb phrase (the $PredVP$ rule below). In addition to this, verb
|
||||
-- phrases have uses in relative clauses and questions. Verb phrases already
|
||||
-- have (or have not) a negation, but they are formed from verbal groups
|
||||
-- ($VG$), which have both positive and negative forms.
|
||||
|
||||
UseV : V -> VP ; -- "walks"
|
||||
UsePassV : V -> VP ; -- "is seen"
|
||||
ComplV2 : V2 -> NP -> VP ; -- "sees Mary"
|
||||
ComplReflV2 : V2 -> VP ; -- "loves himself"
|
||||
ComplVS : VS -> S -> VP ; -- "says that Mary runs"
|
||||
ComplVV : VV -> VPI -> VP ; -- "must walk"
|
||||
ComplVQ : VQ -> QS -> VP ; -- "asks who will come"
|
||||
ComplVA : VA -> AP -> VP ; -- "looks ill"
|
||||
ComplV2A : V2A -> NP -> AP -> VP ; -- "paints the house red"
|
||||
ComplSubjV2V : V2V -> NP -> VPI -> VP ; -- "promises Mary to leave"
|
||||
ComplObjV2V : V2V -> NP -> VPI -> VP ; -- "asked him to go"
|
||||
ComplV2S : V2S -> NP -> S -> VP ; -- "told me that you came"
|
||||
ComplV2Q : V2Q -> NP -> QS -> VP ; -- "asks me if you come"
|
||||
|
||||
PredAP : AP -> VP ; -- "is old"
|
||||
PredSuperl : ADeg -> VP ; -- "is the oldest"
|
||||
PredCN : CN -> VP ; -- "is a man"
|
||||
PredNP : NP -> VP ; -- "is Bill"
|
||||
PredPP : PP -> VP ; -- "is in France"
|
||||
PredAV : AV -> VPI -> VP ; -- "is eager to leave"
|
||||
PredObjA2V : A2V -> NP -> VPI -> VP ; -- "is easy for us to convince"
|
||||
-- The main uses of verbs and verb phrases have been moved to the
|
||||
-- module $Verbphrase$ (deep $VP$ nesting) and its alternative,
|
||||
-- $Clause$ (shallow many-place predication structure).
|
||||
|
||||
PredAS : AS -> S -> Cl ; -- "it is good that he comes"
|
||||
PredV0 : V0 -> Cl ; -- "it is raining"
|
||||
|
||||
-- These rules *use* verb phrases:
|
||||
-- $PredVP$, $IntVP$, $RelVP$.
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 : V2 -> V ; -- "loves"
|
||||
@@ -108,10 +82,6 @@ fun
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
PosVP, NegVP : Ant -> VP -> VPI ;
|
||||
|
||||
ProgVG : VP -> VP ; -- he is eating
|
||||
|
||||
AdjPart : V -> A ; -- forgotten
|
||||
|
||||
UseCl : TP -> Cl -> S ;
|
||||
@@ -138,7 +108,6 @@ fun
|
||||
AdvPP : PP -> Adv ; -- "in London", "after the war"
|
||||
PrepNP : Prep -> NP -> PP ; -- "in London", "after the war"
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||
AdvCN : CN -> PP -> CN ; -- "house in London"
|
||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||
|
||||
@@ -146,13 +115,10 @@ fun
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
PredVP : NP -> VP -> Cl ; -- "John walks"
|
||||
|
||||
SlashV2 : NP -> V2 -> Slash ; -- "John doesn't love"
|
||||
|
||||
IdRP : RP ; -- "which"
|
||||
FunRP : N2 -> RP -> RP ; -- "the successor of which"
|
||||
RelVP : RP -> VP -> RCl ; -- "who walks", "who doesn't walk"
|
||||
RelSlash : RP -> Slash -> RCl ; -- "that I wait for"/"for which I wait"
|
||||
ModRS : CN -> RS -> CN ; -- "man who walks"
|
||||
RelCl : Cl -> RCl ; -- "such that it is even"
|
||||
@@ -167,12 +133,9 @@ fun
|
||||
NounIPOne, NounIPMany : CN -> IP ; -- "which car", "which cars"
|
||||
|
||||
QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||
IntVP : IP -> VP -> QCl ; -- "who walks"
|
||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||
QuestAdv : IAdv -> Cl -> QCl ; -- "why do you walk"
|
||||
|
||||
PosImperVP, NegImperVP : VP -> Imp ; -- "(don't) be a man"
|
||||
|
||||
----rename these ??
|
||||
IndicPhrase : S -> Phr ; -- "I walk."
|
||||
QuestPhrase : QS -> Phr ; -- "Do I walk?"
|
||||
@@ -219,7 +182,6 @@ fun
|
||||
SubjS : Subj -> S -> S -> S ; -- "if 2 is odd, 3 is even"
|
||||
SubjImper : Subj -> S -> Imp -> Imp ; -- "if it is hot, use a glove!"
|
||||
SubjQS : Subj -> S -> QS -> QS ; -- "if you are new, who are you?"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
|
||||
--!
|
||||
--2 One-word utterances
|
||||
@@ -231,6 +193,7 @@ fun
|
||||
PhrOneCN, PhrManyCN : CN -> Phr ; -- "A car.", "Cars."
|
||||
PhrIP : IAdv -> Phr ; -- "Who?"
|
||||
PhrIAdv : IAdv -> Phr ; -- "Why?"
|
||||
PhrVPI : VPI -> Phr ; -- "Tända ljus."
|
||||
|
||||
--!
|
||||
--2 Text formation
|
||||
@@ -244,13 +207,13 @@ fun
|
||||
--
|
||||
-- These constructs tend to have language-specific syntactic realizations.
|
||||
|
||||
OneVP : VP -> Cl ; -- "one walks"
|
||||
|
||||
ExistCN : CN -> Cl ; -- "there is a bar"
|
||||
ExistNumCN : Num -> CN -> Cl ; -- "there are (86) bars"
|
||||
|
||||
ExistQCl : CN -> QCl ; -- "is there a bar",
|
||||
ExistNumQCl : Num -> CN -> QCl ; -- "are there (86) bars"
|
||||
--- The type signatures of these ones should be changed from VP to VPI.
|
||||
|
||||
ProgVG : VP -> VP ; -- he is eating
|
||||
PosImperVP, NegImperVP : VP -> Imp ; -- "(don't) be a man"
|
||||
OneVP : VP -> Cl ; -- "one walks"
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,435 +0,0 @@
|
||||
--!
|
||||
--2 Rules
|
||||
--
|
||||
-- This set of rules is minimal, in the sense of defining the simplest combinations
|
||||
-- of categories and not having redundant rules.
|
||||
-- When the resource grammar is used as a library, it will often be useful to
|
||||
-- access it through an intermediate library that defines more rules as
|
||||
-- 'macros' for combinations of the ones below.
|
||||
|
||||
abstract Shallow = {
|
||||
|
||||
--1 Abstract Syntax Categories for Multilingual Resource Grammar
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2004
|
||||
--
|
||||
-- Although concrete syntax differs a lot between different languages,
|
||||
-- many structures can be treated as common, on the level
|
||||
-- of abstraction that GF provides.
|
||||
-- What we will present in the following is a linguistically oriented abstract
|
||||
-- syntax that has been successfully defined for the following languages:
|
||||
--
|
||||
--* $Eng$lish
|
||||
--* $Fin$nish
|
||||
--* $Fre$nch
|
||||
--* $Ger$man
|
||||
--* $Ita$lian
|
||||
--* $Rus$sian
|
||||
--* $Swe$dish
|
||||
--
|
||||
-- The three-letter prefixes are used in file names all over the resource
|
||||
-- grammar library; we refer to them commonly as $X$ below.
|
||||
--!
|
||||
-- The grammar has been applied to define language
|
||||
-- fragments on technical or near-to-technical domains: database queries,
|
||||
-- video recorder dialogue systems, software specifications, and a
|
||||
-- health-related phrase book. Each new application helped to identify some
|
||||
-- missing structures in the resource and suggested some additions, but the
|
||||
-- number of required additions was usually small.
|
||||
--
|
||||
-- To use the resource in applications, you need the following
|
||||
-- $cat$ and $fun$ rules in $oper$ form, completed by taking the
|
||||
-- $lincat$ and $lin$ judgements of a particular language. This is done
|
||||
-- by using, instead of this module, the $reuse$ module which has the name
|
||||
-- $ResourceX$. It is located in the subdirectory
|
||||
-- $lib/resource/lang$ where $lang$ is the full name of the language.
|
||||
|
||||
|
||||
--!
|
||||
--2 Categories
|
||||
--
|
||||
-- The categories of this resource grammar are mostly 'standard' categories
|
||||
-- of linguistics. Their is no claim that they correspond to semantic categories
|
||||
-- definable in type theory: to define such correspondences is the business
|
||||
-- of applications grammars. In general, the correspondence between linguistic
|
||||
-- and semantic categories is many-to-many.
|
||||
--
|
||||
-- Categories that may look special are $A2$, $N2$, and $V2$. They are all
|
||||
-- instances of endowing another category with a complement, which can be either
|
||||
-- a direct object (whose case may vary) or a prepositional phrase. Prepositional
|
||||
-- phrases that are not complements belong to the category
|
||||
-- $Adv$ of adverbs.
|
||||
--
|
||||
-- In each group below, some categories are *lexical* in the sense of only
|
||||
-- containing atomic elements. These elements are not necessarily expressed by
|
||||
-- one word in all languages; the essential thing is that they have no
|
||||
-- constituents. Thus they have no productions in this part of the
|
||||
-- resource grammar. The $ParadigmsX$ grammars provide ways of defining
|
||||
-- lexical elements.
|
||||
--
|
||||
-- Lexical categories are listed before other categories
|
||||
-- in each group and divided by an empty line.
|
||||
|
||||
--!
|
||||
--3 Nouns and noun phrases
|
||||
--
|
||||
|
||||
cat
|
||||
N ; -- simple common noun, e.g. "car"
|
||||
CN ; -- common noun phrase, e.g. "red car", "car that John owns"
|
||||
N2 ; -- function word, e.g. "mother (of)"
|
||||
N3 ; -- two-place function, e.g. "flight (from) (to)"
|
||||
|
||||
PN ; -- proper name, e.g. "John", "New York"
|
||||
NP ; -- noun phrase, e.g. "John", "all cars", "you"
|
||||
Det ; -- determiner, e.g. "every", "all"
|
||||
Num ; -- numeral, e.g. "three", "879"
|
||||
|
||||
--!
|
||||
--3 Adjectives and adjectival phrases
|
||||
--
|
||||
|
||||
A ; -- one-place adjective, e.g. "even"
|
||||
A2 ; -- two-place adjective, e.g. "divisible (by)"
|
||||
ADeg ; -- degree adjective, e.g. "big/bigger/biggest"
|
||||
|
||||
AP ; -- adjective phrase, e.g. "divisible by two", "bigger than John"
|
||||
|
||||
-- The difference between $A$ and $ADeg$ is that the former has no
|
||||
-- comparison forms.
|
||||
|
||||
--!
|
||||
--3 Verbs and verb phrases
|
||||
--
|
||||
|
||||
V ; -- one-place verb, e.g. "walk"
|
||||
V2 ; -- two-place verb, e.g. "love", "wait (for)", "switch on"
|
||||
V3 ; -- three-place verb, e.g. "give", "prefer (stg) (to stg)"
|
||||
VS ; -- sentence-compl. verb, e.g. "say", "prove"
|
||||
VV ; -- verb-compl. verb, e.g. "can", "want"
|
||||
|
||||
VP ; -- verb phrase, e.g. "switch the light on"
|
||||
VPI ; -- infinitive verb phrase e.g. "switch the light on", "not have run"
|
||||
|
||||
--!
|
||||
--3 Adverbs and prepositions/cases
|
||||
--
|
||||
|
||||
Adv ; -- sentence adverb e.g. "now", "in the house"
|
||||
AdV ; -- verb adverb e.g. "always"
|
||||
AdA ; -- ad-adjective e.g. "very"
|
||||
AdC ; -- conjoining adverb e.g. "therefore", "otherwise"
|
||||
PP ; -- prepositional phrase e.g. "in London"
|
||||
Prep ; -- pre/postposition, case e.g. "after", Adessive
|
||||
|
||||
--!
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
S ; -- sentence (fixed tense) e.g. "John walks", "John walked"
|
||||
Cl ; -- clause (variable tense) e.g. "John walks"/"John walked"
|
||||
Slash ; -- sentence without NP, e.g. "John waits for (...)"
|
||||
RP ; -- relative pronoun, e.g. "which", "the mother of whom"
|
||||
RCl ; -- relative clause, e.g. "who walks", "that I wait for"
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
IP ; -- interrogative pronoun, e.g. "who", "whose mother", "which yellow car"
|
||||
IAdv ; -- interrogative adverb., e.g. "when", "why"
|
||||
QCl ; -- question, e.g. "who walks"
|
||||
Imp ; -- imperative, e.g. "walk!"
|
||||
|
||||
--!
|
||||
--3 Coordination and subordination
|
||||
--
|
||||
|
||||
Conj ; -- conjunction, e.g. "and"
|
||||
ConjD ; -- distributed conj. e.g. "both - and"
|
||||
Subj ; -- subjunction, e.g. "if", "when"
|
||||
|
||||
ListS ; -- list of sentences
|
||||
ListAP ; -- list of adjectival phrases
|
||||
ListNP ; -- list of noun phrases
|
||||
|
||||
--!
|
||||
--3 Complete utterances
|
||||
--
|
||||
-- This group has no lexical categories.
|
||||
|
||||
Phr ; -- full phrase, e.g. "John walks.","Who walks?", "Wait for me!"
|
||||
Text ; -- sequence of phrases e.g. "One is odd. Therefore, two is even."
|
||||
|
||||
---- next
|
||||
|
||||
V2A ; -- paint the house red
|
||||
V2V ; -- promise John to come / ask John to come
|
||||
V2S ; -- tell John that it is raining
|
||||
VQ ; -- ask who comes
|
||||
V2Q ; -- ask John who comes
|
||||
VA ; -- look yellow
|
||||
|
||||
V0 ; -- (it) rains
|
||||
|
||||
AS ; -- (it is) important that he comes
|
||||
A2S ; -- (it is) important for me that he comes
|
||||
AV ; -- difficult to play
|
||||
A2V ; -- difficult for him to play
|
||||
|
||||
-- NB: it is difficult to play the sonata
|
||||
-- vs. it (the sonata) is difficult to play
|
||||
|
||||
--- also: John is easy (for you) to please vs. John is eager to please
|
||||
|
||||
QS ; -- question with fixed tense and polarity
|
||||
RS ; -- relative clause with fixed tense and polarity
|
||||
|
||||
TP ; -- tense x polarity selector
|
||||
Tense ; -- (abstract) tense
|
||||
Ant ; -- (abstract) anteriority
|
||||
|
||||
|
||||
--!
|
||||
--3 Nouns and noun phrases
|
||||
--
|
||||
|
||||
fun
|
||||
UseN : N -> CN ; -- "car"
|
||||
UsePN : PN -> NP ; -- "John"
|
||||
|
||||
---- SymbPN : String -> PN ; -- "x"
|
||||
---- SymbCN : CN -> String -> CN ; -- "number x"
|
||||
---- IntCN : CN -> Int -> CN ; -- "number 53"
|
||||
|
||||
IndefOneNP : CN -> NP ; -- "a car", "cars"
|
||||
IndefNumNP : Num -> CN -> NP ; -- "houses", "86 houses"
|
||||
DefOneNP : CN -> NP ; -- "the car"
|
||||
DefNumNP : Num -> CN -> NP ; -- "the cars", "the 86 cars"
|
||||
|
||||
DetNP : Det -> CN -> NP ; -- "every car"
|
||||
MassNP : CN -> NP ; -- "wine"
|
||||
|
||||
AppN2 : N2 -> NP -> CN ; -- "successor of zero"
|
||||
AppN3 : N3 -> NP -> N2 ; -- "flight from Paris"
|
||||
UseN2 : N2 -> CN ; -- "successor"
|
||||
|
||||
ModAP : AP -> CN -> CN ; -- "red car"
|
||||
CNthatS : CN -> S -> CN ; -- "idea that the Earth is flat"
|
||||
|
||||
ModGenOne : NP -> CN -> NP ; -- "John's car"
|
||||
ModGenNum : Num -> NP -> CN -> NP ; -- "John's cars", "John's 86 cars"
|
||||
|
||||
---- UseInt : Int -> Num ; -- "32" --- assumes i > 1
|
||||
NoNum : Num ; -- no numeral modifier
|
||||
|
||||
--!
|
||||
--3 Adjectives and adjectival phrases
|
||||
--
|
||||
|
||||
UseA : A -> AP ; -- "red"
|
||||
ComplA2 : A2 -> NP -> AP ; -- "divisible by two"
|
||||
|
||||
PositADeg : ADeg -> AP ; -- "old"
|
||||
ComparADeg : ADeg -> NP -> AP ; -- "older than John"
|
||||
SuperlNP : ADeg -> CN -> NP ; -- "the oldest man"
|
||||
|
||||
|
||||
--!
|
||||
--3 Verbs and verb phrases
|
||||
--
|
||||
-- The principal way of forming sentences ($S$) is by combining a noun phrase
|
||||
-- with a verb phrase (the $PredVP$ rule below). In addition to this, verb
|
||||
-- phrases have uses in relative clauses and questions. Verb phrases already
|
||||
-- have (or have not) a negation, but they are formed from verbal groups
|
||||
-- ($VG$), which have both positive and negative forms.
|
||||
|
||||
PredV : NP -> V -> Cl ; -- "John walks"
|
||||
PredPassV : NP -> V -> Cl ; -- "John is seen"
|
||||
PredV2 : NP -> V2 -> NP -> Cl ; -- "John sees Mary"
|
||||
PredReflV2 : NP -> V2 -> Cl ; -- "John loves himself"
|
||||
PredVS : NP -> VS -> S -> Cl ; -- "John says that Mary runs"
|
||||
PredVV : NP -> VV -> VPI -> Cl ; -- "John must walk"
|
||||
PredVQ : NP -> VQ -> QS -> Cl ; -- "John asks who will come"
|
||||
PredVA : NP -> VA -> AP -> Cl ; -- "John looks ill"
|
||||
PredV2A : NP -> V2A -> NP ->AP ->Cl ; -- "John paints the house red"
|
||||
PredSubjV2V : NP -> V2V -> NP ->VPI ->Cl ; -- "John promises Mary to leave"
|
||||
|
||||
PredAP : NP -> AP -> Cl ; -- "John is old"
|
||||
PredSuperl : NP -> ADeg -> Cl ; -- "John is the oldest"
|
||||
PredCN : NP -> CN -> Cl ; -- "John is a man"
|
||||
PredNP : NP -> NP -> Cl ; -- "John is Bill"
|
||||
PredPP : NP -> PP -> Cl ; -- "John is in France"
|
||||
PredAV : NP -> AV ->VPI ->Cl ; -- "John is eager to leave"
|
||||
PredObjA2V : NP -> A2V -> NP ->VPI ->Cl ; -- "John is easy for us to convince"
|
||||
|
||||
PredObjV2V : NP -> V2V -> NP -> VPI -> Cl ; -- "John asks me to come"
|
||||
PredV2S : NP -> V2S -> NP -> S -> Cl ; -- "John told me that it is good"
|
||||
PredV2Q : NP -> V2Q -> NP -> QS -> Cl ; -- "John asked me if it is good"
|
||||
|
||||
PredAS : AS -> S -> Cl ; -- "it is good that he comes"
|
||||
PredV0 : V0 -> Cl ; -- "it is raining"
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 : V2 -> V ; -- "loves"
|
||||
ComplV3 : V3 -> NP -> V2 ; -- "prefers wine (to beer)"
|
||||
|
||||
ComplA2S : A2S -> NP -> AS ; -- "good for John"
|
||||
|
||||
TransVV2 : VV -> V2 -> V2 ; -- (which song do you) want to play
|
||||
|
||||
UseV2V : V2V -> VV ;
|
||||
UseV2S : V2S -> VS ;
|
||||
UseV2Q : V2Q -> VQ ;
|
||||
UseA2S : A2S -> AS ;
|
||||
UseA2V : A2V -> AV ;
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
--- PosVP, NegVP : Ant -> VP -> VPI ;
|
||||
|
||||
ProgVG : VP -> VP ; -- he is eating
|
||||
|
||||
AdjPart : V -> A ; -- forgotten
|
||||
|
||||
UseCl : TP -> Cl -> S ;
|
||||
UseRCl : TP -> RCl -> RS ;
|
||||
UseQCl : TP -> QCl -> QS ;
|
||||
|
||||
PosTP : Tense -> Ant -> TP ;
|
||||
NegTP : Tense -> Ant -> TP ;
|
||||
|
||||
TPresent : Tense ;
|
||||
TPast : Tense ;
|
||||
TFuture : Tense ;
|
||||
TConditional : Tense ;
|
||||
|
||||
ASimul : Ant ;
|
||||
AAnter : Ant ;
|
||||
|
||||
--!
|
||||
--3 Adverbs
|
||||
--
|
||||
-- Here is how complex adverbs can be formed and used.
|
||||
|
||||
AdjAdv : AP -> Adv ; -- "freely", "more consciously than you"
|
||||
AdvPP : PP -> Adv ; -- "in London", "after the war"
|
||||
PrepNP : Prep -> NP -> PP ; -- "in London", "after the war"
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks", "walks in the park"
|
||||
AdvCN : CN -> PP -> CN ; -- "house in London"
|
||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||
|
||||
--!
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
SlashV2 : NP -> V2 -> Slash ; -- "John doesn't love"
|
||||
|
||||
IdRP : RP ; -- "which"
|
||||
FunRP : N2 -> RP -> RP ; -- "the successor of which"
|
||||
RelVP : RP -> VP -> RCl ; -- "who walks", "who doesn't walk"
|
||||
RelSlash : RP -> Slash -> RCl ; -- "that I wait for"/"for which I wait"
|
||||
ModRS : CN -> RS -> CN ; -- "man who walks"
|
||||
RelCl : Cl -> RCl ; -- "such that it is even"
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
|
||||
WhoOne, WhoMany : IP ; -- "who (is)", "who (are)"
|
||||
WhatOne, WhatMany : IP ; -- "what (is)", "what (are)"
|
||||
FunIP : N2 -> IP -> IP ; -- "the mother of whom"
|
||||
NounIPOne, NounIPMany : CN -> IP ; -- "which car", "which cars"
|
||||
|
||||
QuestVP : NP -> VP -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||
IntVP : IP -> VP -> QCl ; -- "who walks"
|
||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||
QuestAdv : IAdv -> NP -> VP -> QCl ; -- "why do you walk"
|
||||
|
||||
PosImperVP, NegImperVP : VP -> Imp ; -- "(don't) be a man"
|
||||
|
||||
----rename these ??
|
||||
IndicPhrase : S -> Phr ; -- "I walk."
|
||||
QuestPhrase : QS -> Phr ; -- "Do I walk?"
|
||||
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
||||
|
||||
AdvCl : Cl -> Adv -> Cl ; -- "Therefore, 2 is prime."
|
||||
AdvPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
||||
|
||||
--!
|
||||
--3 Coordination
|
||||
--
|
||||
-- We consider "n"-ary coordination, with "n" > 1. To this end, we have introduced
|
||||
-- a *list category* $ListX$ for each category $X$ whose expressions we want to
|
||||
-- conjoin. Each list category has two constructors, the base case being $TwoX$.
|
||||
|
||||
-- We have not defined coordination of all possible categories here,
|
||||
-- since it can be tricky in many languages. For instance, $VP$ coordination
|
||||
-- is linguistically problematic in German because $VP$ is a discontinuous
|
||||
-- category.
|
||||
|
||||
ConjS : Conj -> ListS -> S ; -- "John walks and Mary runs"
|
||||
ConjAP : Conj -> ListAP -> AP ; -- "even and prime"
|
||||
ConjNP : Conj -> ListNP -> NP ; -- "John or Mary"
|
||||
|
||||
ConjDS : ConjD -> ListS -> S ; -- "either John walks or Mary runs"
|
||||
ConjDAP : ConjD -> ListAP -> AP ; -- "both even and prime"
|
||||
ConjDNP : ConjD -> ListNP -> NP ; -- "either John or Mary"
|
||||
|
||||
TwoS : S -> S -> ListS ;
|
||||
ConsS : ListS -> S -> ListS ;
|
||||
|
||||
TwoAP : AP -> AP -> ListAP ;
|
||||
ConsAP : ListAP -> AP -> ListAP ;
|
||||
|
||||
TwoNP : NP -> NP -> ListNP ;
|
||||
ConsNP : ListNP -> NP -> ListNP ;
|
||||
|
||||
--!
|
||||
--3 Subordination
|
||||
--
|
||||
-- Subjunctions are different from conjunctions, but form
|
||||
-- a uniform category among themselves.
|
||||
|
||||
SubjS : Subj -> S -> S -> S ; -- "if 2 is odd, 3 is even"
|
||||
SubjImper : Subj -> S -> Imp -> Imp ; -- "if it is hot, use a glove!"
|
||||
SubjQS : Subj -> S -> QS -> QS ; -- "if you are new, who are you?"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
|
||||
--!
|
||||
--2 One-word utterances
|
||||
--
|
||||
-- These are, more generally, *one-phrase utterances*. The list below
|
||||
-- is very incomplete.
|
||||
|
||||
PhrNP : NP -> Phr ; -- "Some man.", "John."
|
||||
PhrOneCN, PhrManyCN : CN -> Phr ; -- "A car.", "Cars."
|
||||
PhrIP : IAdv -> Phr ; -- "Who?"
|
||||
PhrIAdv : IAdv -> Phr ; -- "Why?"
|
||||
|
||||
--!
|
||||
--2 Text formation
|
||||
--
|
||||
-- A text is a sequence of phrases. It is defined like a non-empty list.
|
||||
|
||||
OnePhr : Phr -> Text ;
|
||||
ConsPhr : Phr -> Text -> Text ;
|
||||
|
||||
--2 Special constructs.
|
||||
--
|
||||
-- These constructs tend to have language-specific syntactic realizations.
|
||||
|
||||
OneVP : VP -> Cl ; -- "one walks"
|
||||
|
||||
ExistCN : CN -> Cl ; -- "there is a bar"
|
||||
ExistNumCN : Num -> CN -> Cl ; -- "there are (86) bars"
|
||||
|
||||
ExistQCl : CN -> QCl ; -- "is there a bar",
|
||||
ExistNumQCl : Num -> CN -> QCl ; -- "are there (86) bars"
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
incomplete concrete ShallowI of Shallow = open Resource in {
|
||||
|
||||
lincat
|
||||
N = N ;
|
||||
CN = CN ;
|
||||
N2 = N2 ;
|
||||
N3 = N3 ;
|
||||
PN = PN ;
|
||||
NP = NP ;
|
||||
Det = Det ;
|
||||
Num = Num ;
|
||||
A = A ;
|
||||
A2 = A2 ;
|
||||
ADeg = ADeg ;
|
||||
AP = AP ;
|
||||
V = V ;
|
||||
V2 = V2 ;
|
||||
V3 = V3 ;
|
||||
VS = VS ;
|
||||
VV = VV ;
|
||||
VP = VP ;
|
||||
VPI = VPI ;
|
||||
Adv = Adv ;
|
||||
AdV = AdV ;
|
||||
AdA = AdA ;
|
||||
AdC = AdC ;
|
||||
PP = PP ;
|
||||
Prep = Prep ;
|
||||
S = S ;
|
||||
Cl = Cl ;
|
||||
Slash = Slash ;
|
||||
RP = RP ;
|
||||
RCl = RCl ;
|
||||
IP = IP ;
|
||||
IAdv = IAdv ;
|
||||
QCl = QCl ;
|
||||
Imp = Imp ;
|
||||
Conj = Conj ;
|
||||
ConjD = ConjD ;
|
||||
Subj = Subj ;
|
||||
ListS = ListS ;
|
||||
ListAP = ListAP ;
|
||||
ListNP = ListNP ;
|
||||
Phr = Phr ;
|
||||
Text = Text ;
|
||||
V2A = V2A ;
|
||||
V2V = V2V ;
|
||||
V2S = V2S ;
|
||||
VQ = VQ ;
|
||||
V2Q = V2Q ;
|
||||
VA = VA ;
|
||||
V0 = V0 ;
|
||||
AS = AS ;
|
||||
A2S = A2S ;
|
||||
AV = AV ;
|
||||
A2V = A2V ;
|
||||
QS = QS ;
|
||||
RS = RS ;
|
||||
TP = TP ;
|
||||
Tense = Tense ;
|
||||
Ant = Ant ;
|
||||
|
||||
lin
|
||||
UseN = UseN ;
|
||||
UsePN = UsePN ;
|
||||
---- SymbPN = SymbPN ;
|
||||
---- SymbCN = SymbCN ;
|
||||
---- IntCN = IntCN ;
|
||||
IndefOneNP = IndefOneNP ;
|
||||
IndefNumNP = IndefNumNP ;
|
||||
DefOneNP = DefOneNP ;
|
||||
DefNumNP = DefNumNP ;
|
||||
DetNP = DetNP ;
|
||||
MassNP = MassNP ;
|
||||
AppN2 = AppN2 ;
|
||||
AppN3 = AppN3 ;
|
||||
UseN2 = UseN2 ;
|
||||
ModAP = ModAP ;
|
||||
CNthatS = CNthatS ;
|
||||
ModGenOne = ModGenOne ;
|
||||
ModGenNum = ModGenNum ;
|
||||
---- UseInt = UseInt ;
|
||||
NoNum = NoNum ;
|
||||
UseA = UseA ;
|
||||
ComplA2 = ComplA2 ;
|
||||
PositADeg = PositADeg ;
|
||||
ComparADeg = ComparADeg ;
|
||||
SuperlNP = SuperlNP ;
|
||||
|
||||
--- this is the fragment that differs from Rules
|
||||
|
||||
PredV np v = PredVP np (UseV v) ;
|
||||
PredPassV np v = PredVP np (UsePassV v) ;
|
||||
PredV2 np v x = PredVP np (ComplV2 v x) ;
|
||||
PredReflV2 np v = PredVP np (ComplReflV2 v) ;
|
||||
PredVS np v x = PredVP np (ComplVS v x) ;
|
||||
PredVV np v x = PredVP np (ComplVV v x) ;
|
||||
PredVQ np v x = PredVP np (ComplVQ v x) ;
|
||||
PredVA np v x = PredVP np (ComplVA v x) ;
|
||||
PredV2A np v x y = PredVP np (ComplV2A v x y) ;
|
||||
PredSubjV2V np v x y = PredVP np (ComplSubjV2V v x y) ;
|
||||
PredObjV2V np v x y = PredVP np (ComplObjV2V v x y) ;
|
||||
PredV2S np v x y = PredVP np (ComplV2S v x y) ;
|
||||
PredV2Q np v x y = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
PredAP np v = PredVP np (PredAP v) ;
|
||||
PredSuperl np v = PredVP np (PredSuperl v) ;
|
||||
PredCN np v = PredVP np (PredCN v) ;
|
||||
PredNP np v = PredVP np (PredNP v) ;
|
||||
PredPP np v = PredVP np (PredPP v) ;
|
||||
PredAV np v x = PredVP np (PredAV v x) ;
|
||||
PredObjA2V np v x y = PredVP np (PredObjA2V v x y) ;
|
||||
|
||||
--
|
||||
|
||||
PredAS = PredAS ;
|
||||
PredV0 = PredV0 ;
|
||||
UseV2 = UseV2 ;
|
||||
ComplV3 = ComplV3 ;
|
||||
ComplA2S = ComplA2S ;
|
||||
TransVV2 = TransVV2 ;
|
||||
UseV2V = UseV2V ;
|
||||
UseV2S = UseV2S ;
|
||||
UseV2Q = UseV2Q ;
|
||||
UseA2S = UseA2S ;
|
||||
UseA2V = UseA2V ;
|
||||
ProgVG = ProgVG ;
|
||||
AdjPart = AdjPart ;
|
||||
UseCl = UseCl ;
|
||||
UseRCl = UseRCl ;
|
||||
UseQCl = UseQCl ;
|
||||
PosTP = PosTP ;
|
||||
NegTP = NegTP ;
|
||||
TPresent = TPresent ;
|
||||
TPast = TPast ;
|
||||
TFuture = TFuture ;
|
||||
TConditional = TConditional ;
|
||||
ASimul = ASimul ;
|
||||
AAnter = AAnter ;
|
||||
AdjAdv = AdjAdv ;
|
||||
AdvPP = AdvPP ;
|
||||
PrepNP = PrepNP ;
|
||||
AdvVP = AdvVP ;
|
||||
AdvCN = AdvCN ;
|
||||
AdvAP = AdvAP ;
|
||||
SlashV2 = SlashV2 ;
|
||||
IdRP = IdRP ;
|
||||
FunRP = FunRP ;
|
||||
RelVP = RelVP ;
|
||||
RelSlash = RelSlash ;
|
||||
ModRS = ModRS ;
|
||||
RelCl = RelCl ;
|
||||
FunIP = FunIP ;
|
||||
QuestVP = QuestVP ;
|
||||
IntVP = IntVP ;
|
||||
IntSlash = IntSlash ;
|
||||
QuestAdv = QuestAdv ;
|
||||
IndicPhrase = IndicPhrase ;
|
||||
QuestPhrase = QuestPhrase ;
|
||||
AdvCl = AdvCl ;
|
||||
AdvPhr = AdvPhr ;
|
||||
ConjS = ConjS ;
|
||||
ConjAP = ConjAP ;
|
||||
ConjNP = ConjNP ;
|
||||
ConjDS = ConjDS ;
|
||||
ConjDAP = ConjDAP ;
|
||||
ConjDNP = ConjDNP ;
|
||||
TwoS = TwoS ;
|
||||
ConsS = ConsS ;
|
||||
TwoAP = TwoAP ;
|
||||
ConsAP = ConsAP ;
|
||||
TwoNP = TwoNP ;
|
||||
ConsNP = ConsNP ;
|
||||
SubjS = SubjS ;
|
||||
SubjImper = SubjImper ;
|
||||
SubjQS = SubjQS ;
|
||||
SubjVP = SubjVP ;
|
||||
PhrNP = PhrNP ;
|
||||
PhrIP = PhrIP ;
|
||||
PhrIAdv = PhrIAdv ;
|
||||
OnePhr = OnePhr ;
|
||||
ConsPhr = ConsPhr ;
|
||||
OneVP = OneVP ;
|
||||
ExistCN = ExistCN ;
|
||||
ExistNumCN = ExistNumCN ;
|
||||
ExistQCl = ExistQCl ;
|
||||
ExistNumQCl = ExistNumQCl ;
|
||||
WhatMany = WhatMany ;
|
||||
WhatOne = WhatOne ;
|
||||
WhoMany = WhoMany ;
|
||||
WhoOne = WhoOne ;
|
||||
PosImperVP = PosImperVP ;
|
||||
NegImperVP = NegImperVP ;
|
||||
PhrOneCN = PhrOneCN ;
|
||||
PhrManyCN = PhrManyCN ;
|
||||
ImperOne = ImperOne ;
|
||||
ImperMany = ImperMany ;
|
||||
NounIPOne = NounIPOne ;
|
||||
NounIPMany = NounIPMany ;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
abstract TestResource = Rules, Structural ** {
|
||||
abstract TestResource = Rules, Clause, Structural ** {
|
||||
|
||||
-- a random sample of lexicon to test resource grammar with
|
||||
|
||||
|
||||
3
lib/resource/abstract/Time.gf
Normal file
3
lib/resource/abstract/Time.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
abstract Time = {
|
||||
|
||||
} ;
|
||||
52
lib/resource/abstract/Verbphrase.gf
Normal file
52
lib/resource/abstract/Verbphrase.gf
Normal file
@@ -0,0 +1,52 @@
|
||||
--!
|
||||
--1 Rules for verbs and verb phrases
|
||||
--
|
||||
-- This module treats predications by means of deep right-branching
|
||||
-- $VP$ structures, which have the advantage of conciseness but the
|
||||
-- disadvantage of slow parsing due to discontinuous constituents.
|
||||
--
|
||||
-- The principal way of forming sentences ($S$) is by combining a noun phrase
|
||||
-- with a verb phrase (the $PredVP$ rule below). In addition to this, verb
|
||||
-- phrases have uses in relative clauses and questions. Verb phrases already
|
||||
-- have (or have not) a negation, but they are formed from verbal groups
|
||||
-- ($VG$), which have both positive and negative forms.
|
||||
|
||||
abstract Verbphrase = Categories ** {
|
||||
|
||||
-- These rules produce verb phrases.
|
||||
|
||||
fun
|
||||
UseV : V -> VP ; -- "walks"
|
||||
UsePassV : V -> VP ; -- "is seen"
|
||||
ComplV2 : V2 -> NP -> VP ; -- "sees Mary"
|
||||
ComplReflV2 : V2 -> VP ; -- "loves himself"
|
||||
ComplVS : VS -> S -> VP ; -- "says that Mary runs"
|
||||
ComplVV : VV -> VPI -> VP ; -- "must walk"
|
||||
ComplVQ : VQ -> QS -> VP ; -- "asks who will come"
|
||||
ComplVA : VA -> AP -> VP ; -- "looks ill"
|
||||
ComplV2A : V2A -> NP -> AP -> VP ; -- "paints the house red"
|
||||
ComplSubjV2V : V2V -> NP -> VPI -> VP ; -- "promises Mary to leave"
|
||||
ComplObjV2V : V2V -> NP -> VPI -> VP ; -- "asked him to go"
|
||||
ComplV2S : V2S -> NP -> S -> VP ; -- "told me that you came"
|
||||
ComplV2Q : V2Q -> NP -> QS -> VP ; -- "asks me if you come"
|
||||
|
||||
PredAP : AP -> VP ; -- "is old"
|
||||
PredSuperl : ADeg -> VP ; -- "is the oldest"
|
||||
PredCN : CN -> VP ; -- "is a man"
|
||||
PredNP : NP -> VP ; -- "is Bill"
|
||||
PredPP : PP -> VP ; -- "is in France"
|
||||
PredAV : AV -> VPI -> VP ; -- "is eager to leave"
|
||||
PredObjA2V : A2V -> NP -> VPI -> VP ; -- "is easy for us to convince"
|
||||
|
||||
-- These rules *use* verb phrases.
|
||||
|
||||
PredVP : NP -> VP -> Cl ; -- "John walks"
|
||||
RelVP : RP -> VP -> RCl ; -- "who walks", "who doesn't walk"
|
||||
IntVP : IP -> VP -> QCl ; -- "who walks"
|
||||
|
||||
PosVP, NegVP : Ant -> VP -> VPI ; -- to eat, not to eat
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
|
||||
}
|
||||
@@ -1,24 +1,23 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete BasicEng of Basic = ShallowEng ** open NewParadigmsEng in {
|
||||
concrete BasicEng of Basic = CategoriesEng ** open NewParadigmsEng in {
|
||||
|
||||
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
||||
|
||||
lin
|
||||
airplane_N = regN "airplane" ;
|
||||
--- answer_V2S = mkV2S (regV "answer") ;
|
||||
answer_V2S = mkV2S (regV "answer") "to" ;
|
||||
apartment_N = regN "apartment" ;
|
||||
apple_N = regN "apple" ;
|
||||
art_N = regN "art" ;
|
||||
---- ask_V2Q = mkV2Q (regV "ask") ;
|
||||
ask_V2Q = mkV2Q (regV "ask") [] ;
|
||||
baby_N = regN "baby" ;
|
||||
bad_ADeg = regADeg "bad" ;
|
||||
bank_N = regN "bank" ;
|
||||
beautiful_ADeg = regADeg "beautiful" ;
|
||||
---- become_VA = mkVA (regV "become") ;
|
||||
become_VA = mkVA (irregV "become" "became" "become") ;
|
||||
beer_N = regN "beer" ;
|
||||
---- beg_VV = mkVV (regV "beg") ;
|
||||
---- be_V = (regV "be") ;
|
||||
beg_V2V = mkV2V (regDuplV "beg") [] "to" ;
|
||||
big_ADeg = regADeg "big" ;
|
||||
bike_N = regN "bike" ;
|
||||
bird_N = regN "bird" ;
|
||||
@@ -30,12 +29,12 @@ lin
|
||||
boss_N = regN "boss" ;
|
||||
boy_N = regN "boy" ;
|
||||
bread_N = regN "bread" ;
|
||||
break_V2 = dirV2 (regV "break") ;
|
||||
break_V2 = dirV2 (irregV "break" "broke" "broken") ;
|
||||
broad_ADeg = regADeg "broad" ;
|
||||
brother_N = regN "brother" ;
|
||||
brown_ADeg = regADeg "brown" ;
|
||||
butter_N = regN "butter" ;
|
||||
buy_V2 = dirV2 (regV "buy") ;
|
||||
buy_V2 = dirV2 (irregV "buy" "bought" "bought") ;
|
||||
camera_N = regN "camera" ;
|
||||
cap_N = regN "cap" ;
|
||||
car_N = regN "car" ;
|
||||
@@ -44,7 +43,7 @@ lin
|
||||
ceiling_N = regN "ceiling" ;
|
||||
chair_N = regN "chair" ;
|
||||
cheese_N = regN "cheese" ;
|
||||
child_N = regN "child" ;
|
||||
child_N = mk2N "child" "children" ;
|
||||
church_N = regN "church" ;
|
||||
city_N = regN "city" ;
|
||||
clean_ADeg = regADeg "clean" ;
|
||||
@@ -52,7 +51,7 @@ lin
|
||||
close_V2 = dirV2 (regV "close") ;
|
||||
coat_N = regN "coat" ;
|
||||
cold_ADeg = regADeg "cold" ;
|
||||
come_V = (regV "come") ;
|
||||
come_V = (irregV "come" "came" "come") ;
|
||||
computer_N = regN "computer" ;
|
||||
country_N = regN "country" ;
|
||||
cousin_N = regN "cousin" ;
|
||||
@@ -62,33 +61,35 @@ lin
|
||||
doctor_N = regN "doctor" ;
|
||||
dog_N = regN "dog" ;
|
||||
door_N = regN "door" ;
|
||||
drink_V2 = dirV2 (regV "drink") ;
|
||||
eat_V2 = dirV2 (regV "eat") ;
|
||||
drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ;
|
||||
easy_A2V = mkA2V (regA "easy") "for" ;
|
||||
eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ;
|
||||
enemy_N = regN "enemy" ;
|
||||
factory_N = regN "factory" ;
|
||||
father_N = regN "father" ;
|
||||
---- fear_VS = mkVS (regV "fear") ;
|
||||
find_V2 = dirV2 (regV "find") ;
|
||||
fish_N = regN "fish" ;
|
||||
fear_VS = mkVS (regV "fear") ;
|
||||
find_V2 = dirV2 (irregV "find" "found" "found") ;
|
||||
fish_N = mk2N "fish" "fish" ;
|
||||
floor_N = regN "floor" ;
|
||||
forget_V2 = dirV2 (regV "forget") ;
|
||||
forget_V2 = dirV2 (irregV "forget" "forgot" "forgotten") ;
|
||||
fridge_N = regN "fridge" ;
|
||||
friend_N = regN "friend" ;
|
||||
fruit_N = regN "fruit" ;
|
||||
fun_AV = mkAV (regA "fun") ;
|
||||
garden_N = regN "garden" ;
|
||||
girl_N = regN "girl" ;
|
||||
glove_N = regN "glove" ;
|
||||
gold_N = regN "gold" ;
|
||||
good_ADeg = regADeg "good" ;
|
||||
go_V = (regV "go") ;
|
||||
go_V = (mkV "go" "goes" "went" "gone" "going") ;
|
||||
green_ADeg = regADeg "green" ;
|
||||
harbour_N = regN "harbour" ;
|
||||
hate_V2 = dirV2 (regV "hate") ;
|
||||
hat_N = regN "hat" ;
|
||||
have_V2 = dirV2 (regV "have") ;
|
||||
hear_V2 = dirV2 (regV "hear") ;
|
||||
have_V2 = dirV2 (mkV "have" "has" "had" "had" "having") ;
|
||||
hear_V2 = dirV2 (irregV "hear" "heard" "heard") ;
|
||||
hill_N = regN "hill" ;
|
||||
---- hope_VS = mkVS (regV "hope") ;
|
||||
hope_VS = mkVS (regV "hope") ;
|
||||
horse_N = regN "horse" ;
|
||||
hot_ADeg = regADeg "hot" ;
|
||||
house_N = regN "house" ;
|
||||
@@ -96,20 +97,21 @@ lin
|
||||
industry_N = regN "industry" ;
|
||||
iron_N = regN "iron" ;
|
||||
king_N = regN "king" ;
|
||||
know_V2 = dirV2 (regV "know") ;
|
||||
know_V2 = dirV2 (irregV "know" "knew" "known") ;
|
||||
lake_N = regN "lake" ;
|
||||
lamp_N = regN "lamp" ;
|
||||
learn_V2 = dirV2 (regV "learn") ;
|
||||
leather_N = regN "leather" ;
|
||||
leave_V2 = dirV2 (regV "leave") ;
|
||||
leave_V2 = dirV2 (irregV "leave" "left" "left") ;
|
||||
like_V2 = dirV2 (regV "like") ;
|
||||
listen_V2 = dirV2 (regV "listen") ;
|
||||
live_V = (regV "live") ;
|
||||
long_ADeg = regADeg "long" ;
|
||||
lose_V2 = dirV2 (regV "lose") ;
|
||||
lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
||||
love_N = regN "love" ;
|
||||
love_V2 = dirV2 (regV "love") ;
|
||||
man_N = regN "man" ;
|
||||
man_N = mk2N "man" "men" ;
|
||||
married_A2 = mkA2 (regA "married") "to" ;
|
||||
meat_N = regN "meat" ;
|
||||
milk_N = regN "milk" ;
|
||||
moon_N = regN "moon" ;
|
||||
@@ -122,6 +124,7 @@ lin
|
||||
oil_N = regN "oil" ;
|
||||
old_ADeg = regADeg "old" ;
|
||||
open_V2 = dirV2 (regV "open") ;
|
||||
paint_V2A = mkV2A (regV "paint") [] ;
|
||||
paper_N = regN "paper" ;
|
||||
peace_N = regN "peace" ;
|
||||
pen_N = regN "pen" ;
|
||||
@@ -130,9 +133,11 @@ lin
|
||||
play_V2 = dirV2 (regV "play") ;
|
||||
policeman_N = regN "policeman" ;
|
||||
priest_N = regN "priest" ;
|
||||
probable_AS = mkAS (regA "probable") ;
|
||||
queen_N = regN "queen" ;
|
||||
radio_N = regN "radio" ;
|
||||
read_V2 = dirV2 (regV "read") ;
|
||||
rain_V0 = mkV0 (regV "rain") ;
|
||||
read_V2 = dirV2 (irregV "read" "read" "read") ;
|
||||
red_ADeg = regADeg "red" ;
|
||||
religion_N = regN "religion" ;
|
||||
restaurant_N = regN "restaurant" ;
|
||||
@@ -140,16 +145,16 @@ lin
|
||||
rock_N = regN "rock" ;
|
||||
roof_N = regN "roof" ;
|
||||
rubber_N = regN "rubber" ;
|
||||
run_V = (regV "run") ;
|
||||
---- say_VS = mkVS (regV "say") ;
|
||||
run_V = (irregV "run" "ran" "run") ;
|
||||
say_VS = mkVS (irregV "say" "said" "said") ;
|
||||
school_N = regN "school" ;
|
||||
science_N = regN "science" ;
|
||||
sea_N = regN "sea" ;
|
||||
seek_V2 = dirV2 (regV "seek") ;
|
||||
see_V2 = dirV2 (regV "see") ;
|
||||
---- sell_V3 = mkV3 (regV "sell") ;
|
||||
---- send_V3 = mkV3 (regV "send") ;
|
||||
sheep_N = regN "sheep" ;
|
||||
seek_V2 = dirV2 (irregV "seek" "sought" "sought") ;
|
||||
see_V2 = dirV2 (irregV "see" "saw" "seen") ;
|
||||
sell_V3 = dirV3 (irregV "sell" "sold" "sold") "to" ;
|
||||
send_V3 = dirV3 (irregV "send" "sent" "sent") "to" ;
|
||||
sheep_N = mk2N "sheep" "sheep" ;
|
||||
ship_N = regN "ship" ;
|
||||
shirt_N = regN "shirt" ;
|
||||
shoe_N = regN "shoe" ;
|
||||
@@ -157,11 +162,11 @@ lin
|
||||
short_ADeg = regADeg "short" ;
|
||||
silver_N = regN "silver" ;
|
||||
sister_N = regN "sister" ;
|
||||
sleep_V = (regV "sleep") ;
|
||||
sleep_V = (irregV "sleep" "slept" "slept") ;
|
||||
small_ADeg = regADeg "small" ;
|
||||
snake_N = regN "snake" ;
|
||||
sock_N = regN "sock" ;
|
||||
speak_V2 = dirV2 (regV "speak") ;
|
||||
speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ;
|
||||
star_N = regN "star" ;
|
||||
steel_N = regN "steel" ;
|
||||
stone_N = regN "stone" ;
|
||||
@@ -169,20 +174,21 @@ lin
|
||||
student_N = regN "student" ;
|
||||
stupid_ADeg = regADeg "stupid" ;
|
||||
sun_N = regN "sun" ;
|
||||
switch8off_V = (regV "switch8off") ;
|
||||
switch8on_V = (regV "switch8on") ;
|
||||
switch8off_V2 = dirV2 (partV (regV "switch") "off") ;
|
||||
switch8on_V2 = dirV2 (partV (regV "switch") "on") ;
|
||||
table_N = regN "table" ;
|
||||
talk_V3 = mkV3 (regV "talk") "to" "about" ;
|
||||
teacher_N = regN "teacher" ;
|
||||
teach_V2 = dirV2 (regV "teach") ;
|
||||
teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
|
||||
television_N = regN "television" ;
|
||||
thick_ADeg = regADeg "thick" ;
|
||||
thin_ADeg = regADeg "thin" ;
|
||||
train_N = regN "train" ;
|
||||
travel_V = (regV "travel") ;
|
||||
travel_V = (regDuplV "travel") ;
|
||||
tree_N = regN "tree" ;
|
||||
trousers_N = regN "trousers" ;
|
||||
ugly_ADeg = regADeg "ugly" ;
|
||||
understand_V2 = dirV2 (regV "understand") ;
|
||||
understand_V2 = dirV2 (irregV "understand" "understood" "understood") ;
|
||||
university_N = regN "university" ;
|
||||
village_N = regN "village" ;
|
||||
wait_V2 = dirV2 (regV "wait") ;
|
||||
@@ -194,10 +200,11 @@ lin
|
||||
white_ADeg = regADeg "white" ;
|
||||
window_N = regN "window" ;
|
||||
wine_N = regN "wine" ;
|
||||
win_V2 = dirV2 (regV "win") ;
|
||||
woman_N = regN "woman" ;
|
||||
win_V2 = dirV2 (irregV "win" "won" "won") ;
|
||||
woman_N = mk2N "woman" "women" ;
|
||||
wonder_VQ = mkVQ (regV "wonder") ;
|
||||
wood_N = regN "wood" ;
|
||||
write_V2 = dirV2 (regV "write") ;
|
||||
write_V2 = dirV2 (irregV "write" "wrote" "written") ;
|
||||
yellow_ADeg = regADeg "yellow" ;
|
||||
young_ADeg = regADeg "young" ;
|
||||
} ;
|
||||
|
||||
71
lib/resource/english/ClauseEng.gf
Normal file
71
lib/resource/english/ClauseEng.gf
Normal file
@@ -0,0 +1,71 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete ClauseEng of Clause = CategoriesEng **
|
||||
open Prelude, SyntaxEng in {
|
||||
|
||||
lin
|
||||
SPredV np v = predVerbGroupClause np (predVerb v) ;
|
||||
SPredPassV np v = predVerbGroupClause np (passVerb v) ;
|
||||
SPredV2 np v x = predVerbGroupClause np (complTransVerb v x) ;
|
||||
SPredReflV2 np v = predVerbGroupClause np (reflTransVerb v) ;
|
||||
SPredVS np v x = predVerbGroupClause np (complSentVerb v x) ;
|
||||
SPredVV np v x = predVerbGroupClause np (complVerbVerb v x) ;
|
||||
SPredVQ np v x = predVerbGroupClause np (complQuestVerb v x) ;
|
||||
SPredVA np v x = predVerbGroupClause np (complAdjVerb v x) ;
|
||||
SPredV2A np v x y = predVerbGroupClause np (complDitransAdjVerb v x y) ;
|
||||
SPredSubjV2V np v x y = predVerbGroupClause np (complDitransVerbVerb
|
||||
False v x y) ;
|
||||
SPredObjV2V np v x y = predVerbGroupClause np (complDitransVerbVerb
|
||||
True v x y) ;
|
||||
SPredV2S np v x y = predVerbGroupClause np (complDitransSentVerb v x y) ;
|
||||
SPredV2Q np v x y = predVerbGroupClause np (complDitransQuestVerb v x y) ;
|
||||
|
||||
SPredAP np v = predVerbGroupClause np (predAdjective v) ;
|
||||
SPredSuperl np a = predVerbGroupClause np (predAdjective (superlAdjPhrase a)) ;
|
||||
SPredCN np v = predVerbGroupClause np (predCommNoun v) ;
|
||||
SPredNP np v = predVerbGroupClause np (predNounPhrase v) ;
|
||||
SPredPP np v = predVerbGroupClause np (predAdverb v) ;
|
||||
SPredAV np v x = predVerbGroupClause np (complVerbAdj v x) ;
|
||||
SPredObjA2V np v x y = predVerbGroupClause np (complVerbAdj2 True v x y) ;
|
||||
|
||||
|
||||
QPredV np v = intVerbPhrase np (predVerb v) ;
|
||||
QPredPassV np v = intVerbPhrase np (passVerb v) ;
|
||||
QPredV2 np v x = intVerbPhrase np (complTransVerb v x) ;
|
||||
QPredReflV2 np v = intVerbPhrase np (reflTransVerb v) ;
|
||||
QPredVS np v x = intVerbPhrase np (complSentVerb v x) ;
|
||||
QPredVV np v x = intVerbPhrase np (complVerbVerb v x) ;
|
||||
QPredVQ np v x = intVerbPhrase np (complQuestVerb v x) ;
|
||||
QPredVA np v x = intVerbPhrase np (complAdjVerb v x) ;
|
||||
QPredV2A np v x y = intVerbPhrase np (complDitransAdjVerb v x y) ;
|
||||
QPredSubjV2V np v x y = intVerbPhrase np (complDitransVerbVerb
|
||||
False v x y) ;
|
||||
QPredObjV2V np v x y = intVerbPhrase np (complDitransVerbVerb
|
||||
True v x y) ;
|
||||
QPredV2S np v x y = intVerbPhrase np (complDitransSentVerb v x y) ;
|
||||
QPredV2Q np v x y = intVerbPhrase np (complDitransQuestVerb v x y) ;
|
||||
|
||||
QPredAP np v = intVerbPhrase np (predAdjective v) ;
|
||||
QPredSuperl np a = intVerbPhrase np (predAdjective (superlAdjPhrase a)) ;
|
||||
QPredCN np v = intVerbPhrase np (predCommNoun v) ;
|
||||
QPredNP np v = intVerbPhrase np (predNounPhrase v) ;
|
||||
QPredPP np v = intVerbPhrase np (predAdverb v) ;
|
||||
QPredAV np v x = intVerbPhrase np (complVerbAdj v x) ;
|
||||
QPredObjA2V np v x y = intVerbPhrase np (complVerbAdj2 True v x y) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
27
lib/resource/english/CountryEng.gf
Normal file
27
lib/resource/english/CountryEng.gf
Normal file
@@ -0,0 +1,27 @@
|
||||
concrete CountryEng of Country = open ResourceEng, NewParadigmsEng in {
|
||||
|
||||
lincat
|
||||
Country = PN ;
|
||||
Nationality = A ;
|
||||
Language = N ;
|
||||
|
||||
lin
|
||||
Denmark = regPN "Denmark" nonhuman ;
|
||||
England = regPN "England" nonhuman ;
|
||||
Finland = regPN "Finland" nonhuman ;
|
||||
France = regPN "France" nonhuman ;
|
||||
Germany = regPN "Germany" nonhuman ;
|
||||
Italy = regPN "Italy" nonhuman ;
|
||||
Norway = regPN "Norway" nonhuman ;
|
||||
Russia = regPN "Russia" nonhuman ;
|
||||
Spain = regPN "Spain" nonhuman ;
|
||||
Sweden = regPN "Sweden" nonhuman ;
|
||||
|
||||
Danish = regA "Danish" ;
|
||||
English = regA "English" ;
|
||||
|
||||
DanishLang = regN "Danish" ;
|
||||
EnglishLang = regN "English" ;
|
||||
|
||||
|
||||
} ;
|
||||
@@ -73,7 +73,7 @@ oper
|
||||
|
||||
-- In practice the worst case is just: give singular and plural nominative.
|
||||
|
||||
reg2N : (man,men : Str) -> N ;
|
||||
mk2N : (man,men : Str) -> N ;
|
||||
|
||||
-- All nouns created by the previous functions are marked as
|
||||
-- $nonhuman$. If you want a $human$ noun, wrap it with the following
|
||||
@@ -201,7 +201,7 @@ oper
|
||||
|
||||
regV : Str -> V ;
|
||||
|
||||
-- The following variant duplicates the in consonant in the forms like
|
||||
-- The following variant duplicates the last letter in the forms like
|
||||
-- "rip - ripped - ripping".
|
||||
|
||||
regDuplV : Str -> V ;
|
||||
@@ -239,6 +239,26 @@ oper
|
||||
dirV3 : V -> Str -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
-- Verbs and adjectives can take complements such as sentences,
|
||||
-- questions, verb phrases, and adjectives.
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Str -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Str -> Str -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Str -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Str -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Str -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Str -> A2V ;
|
||||
|
||||
|
||||
--2 Definitions of paradigms
|
||||
--
|
||||
@@ -277,9 +297,9 @@ oper
|
||||
}
|
||||
}
|
||||
in
|
||||
reg2N ray rays ;
|
||||
mk2N ray rays ;
|
||||
|
||||
reg2N = \man,men ->
|
||||
mk2N = \man,men ->
|
||||
let mens = case last men of {
|
||||
"s" => men + "'" ;
|
||||
_ => men + "'s"
|
||||
@@ -375,4 +395,19 @@ oper
|
||||
dirV3 v p = mkV3 v [] p ;
|
||||
dirdirV3 v = dirV3 v [] ;
|
||||
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
mkVS v = v ** {lock_VS = <>} ;
|
||||
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
||||
mkVV v = v ** {isAux = False ; lock_VV = <>} ;
|
||||
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_AS = <>} ;
|
||||
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
||||
mkAV v = v ** {lock_AV = <>} ;
|
||||
mkA2V v p = mkA2 v p ** {lock_A2V = <>} ;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -68,28 +68,6 @@ lin
|
||||
|
||||
-- verbs and verb prases
|
||||
|
||||
UseV = predVerb ;
|
||||
UsePassV = passVerb ;
|
||||
ComplV2 = complTransVerb ;
|
||||
ComplReflV2 = reflTransVerb ;
|
||||
ComplVS = complSentVerb ;
|
||||
ComplVV = complVerbVerb ;
|
||||
ComplVQ = complQuestVerb ;
|
||||
ComplVA = complAdjVerb ;
|
||||
ComplV2A = complDitransAdjVerb ;
|
||||
ComplSubjV2V = complDitransVerbVerb False ;
|
||||
ComplObjV2V = complDitransVerbVerb True ;
|
||||
ComplV2S = complDitransSentVerb ;
|
||||
ComplV2Q = complDitransQuestVerb ;
|
||||
|
||||
PredAP = predAdjective ;
|
||||
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
||||
PredCN = predCommNoun ;
|
||||
PredNP = predNounPhrase ;
|
||||
PredPP = predAdverb ;
|
||||
PredAV = complVerbAdj ;
|
||||
PredObjA2V = complVerbAdj2 True ;
|
||||
|
||||
PredAS = predAdjSent ;
|
||||
PredV0 rain = predVerbGroupClause (pronNounPhrase pronIt) (predVerb rain) ;
|
||||
|
||||
@@ -111,9 +89,6 @@ lin
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
ProgVG = progressiveVerbPhrase ;
|
||||
|
||||
UseCl tp cl = {s = tp.s ++ cl.s ! Dir ! tp.b ! VFinite tp.t tp.a} ;
|
||||
@@ -136,21 +111,16 @@ lin
|
||||
AdjAdv a = ss (a.s ! AAdv) ;
|
||||
AdvPP p = p ;
|
||||
PrepNP p = prepPhrase p.s ; ---
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
AdvCN = advCommNounPhrase ;
|
||||
AdvAP = advAdjPhrase ;
|
||||
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
|
||||
SlashV2 = slashTransVerbCl ;
|
||||
|
||||
IdRP = identRelPron ;
|
||||
FunRP = funRelPron ;
|
||||
RelVP = relVerbPhrase ;
|
||||
RelSlash = relSlash ;
|
||||
ModRS = modRelClause ;
|
||||
RelCl = relSuch ;
|
||||
@@ -169,7 +139,6 @@ lin
|
||||
NounIPMany = nounIntPron plural ;
|
||||
|
||||
QuestCl = questClause ;
|
||||
IntVP = intVerbPhrase ;
|
||||
IntSlash = intSlash ;
|
||||
QuestAdv = questAdverbial ;
|
||||
|
||||
@@ -207,13 +176,13 @@ lin
|
||||
SubjS = subjunctSentence ;
|
||||
SubjImper = subjunctImperative ;
|
||||
SubjQS = subjunctQuestion ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
|
||||
PhrNP = useNounPhrase ;
|
||||
PhrOneCN = useCommonNounPhrase singular ;
|
||||
PhrManyCN = useCommonNounPhrase plural ;
|
||||
PhrIP ip = ip ;
|
||||
PhrIAdv ia = ia ;
|
||||
PhrVPI = verbUtterance ;
|
||||
|
||||
OnePhr p = p ;
|
||||
ConsPhr = cc2 ;
|
||||
@@ -234,15 +203,4 @@ lin
|
||||
(complTransVerb (mkTransVerbDir verbBe)
|
||||
(indefNounPhraseNum plural nu A)) ;
|
||||
|
||||
ExistQCl A = questVerbPhrase
|
||||
(nameNounPhrase (nameReg "there" Neutr))
|
||||
(complTransVerb (mkTransVerbDir verbBe)
|
||||
(indefNounPhrase singular A)) ;
|
||||
ExistNumQCl nu A =
|
||||
questVerbPhrase
|
||||
(nameNounPhrasePl (nameReg "there" Neutr))
|
||||
(complTransVerb (mkTransVerbDir verbBe)
|
||||
(indefNounPhraseNum plural nu A)) ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete ShallowEng of Shallow = ShallowI with (Resource = ResourceEng) ;
|
||||
|
||||
@@ -1059,6 +1059,13 @@ oper
|
||||
imperUtterance : Number -> Imperative -> Utterance = \n,I ->
|
||||
ss (I.s ! n ++ "!") ;
|
||||
|
||||
-- --- Here the agreement feature should really be given in context:
|
||||
-- "What do you want to do? - Wash myself."
|
||||
|
||||
verbUtterance : VerbPhrase -> Utterance = \vp ->
|
||||
ss (vp.s1 ++ vp.s ! ASgP1) ;
|
||||
|
||||
|
||||
--2 Sentence adverbs
|
||||
--
|
||||
-- Sentence adverbs is the largest class and open for
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete TestResourceEng of TestResource = RulesEng, StructuralEng **
|
||||
concrete TestResourceEng of TestResource = RulesEng, ClauseEng, StructuralEng **
|
||||
open Prelude, SyntaxEng, ParadigmsEng in {
|
||||
|
||||
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
||||
|
||||
3
lib/resource/english/TimeEng.gf
Normal file
3
lib/resource/english/TimeEng.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
concrete TimeEng of Time = {
|
||||
|
||||
} ;
|
||||
61
lib/resource/english/VerbphraseEng.gf
Normal file
61
lib/resource/english/VerbphraseEng.gf
Normal file
@@ -0,0 +1,61 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
concrete VerbphraseEng of Verbphrase = CategoriesEng **
|
||||
open Prelude, SyntaxEng in {
|
||||
|
||||
lin
|
||||
UseV = predVerb ;
|
||||
UsePassV = passVerb ;
|
||||
ComplV2 = complTransVerb ;
|
||||
ComplReflV2 = reflTransVerb ;
|
||||
ComplVS = complSentVerb ;
|
||||
ComplVV = complVerbVerb ;
|
||||
ComplVQ = complQuestVerb ;
|
||||
ComplVA = complAdjVerb ;
|
||||
ComplV2A = complDitransAdjVerb ;
|
||||
ComplSubjV2V = complDitransVerbVerb False ;
|
||||
ComplObjV2V = complDitransVerbVerb True ;
|
||||
ComplV2S = complDitransSentVerb ;
|
||||
ComplV2Q = complDitransQuestVerb ;
|
||||
|
||||
PredAP = predAdjective ;
|
||||
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
||||
PredCN = predCommNoun ;
|
||||
PredNP = predNounPhrase ;
|
||||
PredPP = predAdverb ;
|
||||
PredAV = complVerbAdj ;
|
||||
PredObjA2V = complVerbAdj2 True ;
|
||||
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
RelVP = relVerbPhrase ;
|
||||
IntVP = intVerbPhrase ;
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
|
||||
|
||||
}
|
||||
71
lib/resource/scandinavian/ClauseScand.gf
Normal file
71
lib/resource/scandinavian/ClauseScand.gf
Normal file
@@ -0,0 +1,71 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete ClauseScand of Clause = CategoriesScand **
|
||||
open Prelude, SyntaxScand in {
|
||||
|
||||
lin
|
||||
SPredV np v = predVerbGroupClause np (predVerb v) ;
|
||||
SPredPassV np v = predVerbGroupClause np (passVerb v) ;
|
||||
SPredV2 np v x = predVerbGroupClause np (complTransVerb v x) ;
|
||||
SPredReflV2 np v = predVerbGroupClause np (reflTransVerb v) ;
|
||||
SPredVS np v x = predVerbGroupClause np (complSentVerb v x) ;
|
||||
SPredVV np v x = predVerbGroupClause np (complVerbVerb v x) ;
|
||||
SPredVQ np v x = predVerbGroupClause np (complQuestVerb v x) ;
|
||||
SPredVA np v x = predVerbGroupClause np (complAdjVerb v x) ;
|
||||
SPredV2A np v x y = predVerbGroupClause np (complDitransAdjVerb v x y) ;
|
||||
SPredSubjV2V np v x y = predVerbGroupClause np (complDitransVerbVerb
|
||||
False v x y) ;
|
||||
SPredObjV2V np v x y = predVerbGroupClause np (complDitransVerbVerb
|
||||
True v x y) ;
|
||||
SPredV2S np v x y = predVerbGroupClause np (complDitransSentVerb v x y) ;
|
||||
SPredV2Q np v x y = predVerbGroupClause np (complDitransQuestVerb v x y) ;
|
||||
|
||||
SPredAP np v = predVerbGroupClause np (predAdjective v) ;
|
||||
SPredSuperl np a = predVerbGroupClause np (predAdjective (superlAdjPhrase a)) ;
|
||||
SPredCN np v = predVerbGroupClause np (predCommNoun v) ;
|
||||
SPredNP np v = predVerbGroupClause np (predNounPhrase v) ;
|
||||
SPredPP np v = predVerbGroupClause np (predAdverb v) ;
|
||||
SPredAV np v x = predVerbGroupClause np (complVerbAdj v x) ;
|
||||
SPredObjA2V np v x y = predVerbGroupClause np (complVerbAdj2 True v x y) ;
|
||||
|
||||
|
||||
QPredV np v = intVerbPhrase np (predVerb v) ;
|
||||
QPredPassV np v = intVerbPhrase np (passVerb v) ;
|
||||
QPredV2 np v x = intVerbPhrase np (complTransVerb v x) ;
|
||||
QPredReflV2 np v = intVerbPhrase np (reflTransVerb v) ;
|
||||
QPredVS np v x = intVerbPhrase np (complSentVerb v x) ;
|
||||
QPredVV np v x = intVerbPhrase np (complVerbVerb v x) ;
|
||||
QPredVQ np v x = intVerbPhrase np (complQuestVerb v x) ;
|
||||
QPredVA np v x = intVerbPhrase np (complAdjVerb v x) ;
|
||||
QPredV2A np v x y = intVerbPhrase np (complDitransAdjVerb v x y) ;
|
||||
QPredSubjV2V np v x y = intVerbPhrase np (complDitransVerbVerb
|
||||
False v x y) ;
|
||||
QPredObjV2V np v x y = intVerbPhrase np (complDitransVerbVerb
|
||||
True v x y) ;
|
||||
QPredV2S np v x y = intVerbPhrase np (complDitransSentVerb v x y) ;
|
||||
QPredV2Q np v x y = intVerbPhrase np (complDitransQuestVerb v x y) ;
|
||||
|
||||
QPredAP np v = intVerbPhrase np (predAdjective v) ;
|
||||
QPredSuperl np a = intVerbPhrase np (predAdjective (superlAdjPhrase a)) ;
|
||||
QPredCN np v = intVerbPhrase np (predCommNoun v) ;
|
||||
QPredNP np v = intVerbPhrase np (predNounPhrase v) ;
|
||||
QPredPP np v = intVerbPhrase np (predAdverb v) ;
|
||||
QPredAV np v x = intVerbPhrase np (complVerbAdj v x) ;
|
||||
QPredObjA2V np v x y = intVerbPhrase np (complVerbAdj2 True v x y) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
@@ -49,28 +49,6 @@ lin
|
||||
|
||||
-- verbs and verb phrases
|
||||
|
||||
UseV = predVerb ;
|
||||
UsePassV = passVerb ;
|
||||
ComplV2 = complTransVerb ;
|
||||
ComplReflV2 = reflTransVerb ;
|
||||
ComplVS = complSentVerb ;
|
||||
ComplVV = complVerbVerb ;
|
||||
ComplVQ = complQuestVerb ;
|
||||
ComplVA = complAdjVerb ;
|
||||
ComplV2A = complDitransAdjVerb ;
|
||||
ComplSubjV2V = complDitransVerbVerb False ;
|
||||
ComplObjV2V = complDitransVerbVerb True ;
|
||||
ComplV2S = complDitransSentVerb ;
|
||||
ComplV2Q = complDitransQuestVerb ;
|
||||
|
||||
PredAP = predAdjective ;
|
||||
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
||||
PredCN = predCommNoun ;
|
||||
PredNP = predNounPhrase ;
|
||||
PredPP = predAdverb ;
|
||||
PredAV = complVerbAdj ;
|
||||
PredObjA2V = complVerbAdj2 True ;
|
||||
|
||||
PredAS = predAdjSent ;
|
||||
PredV0 = predVerb0 ;
|
||||
|
||||
@@ -92,9 +70,6 @@ lin
|
||||
|
||||
-- Formation of infinitival phrases.
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
ProgVG = progressiveVerbPhrase ;
|
||||
|
||||
UseCl tp cl = {s = \\o => tp.s ++ cl.s ! tp.b ! ClFinite tp.t tp.a o} ;
|
||||
@@ -119,21 +94,17 @@ lin
|
||||
AdvPP p = p ;
|
||||
PrepNP p = prepPhrase p.s ; ---
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
AdvCN = advCommNounPhrase ;
|
||||
AdvAP = advAdjPhrase ;
|
||||
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
|
||||
SlashV2 = slashTransVerb ;
|
||||
OneVP = predVerbGroupClause npMan ;
|
||||
|
||||
IdRP = identRelPron ;
|
||||
FunRP = funRelPron ;
|
||||
RelVP = relVerbGroup ;
|
||||
RelSlash = relSlash ;
|
||||
ModRS = modRelClause ;
|
||||
RelCl = relSuch ;
|
||||
@@ -152,7 +123,6 @@ lin
|
||||
NounIPMany = nounIntPron plural ;
|
||||
|
||||
QuestCl = questClause ;
|
||||
IntVP = intVerbPhrase ;
|
||||
IntSlash = intSlash ;
|
||||
QuestAdv = questAdverbial ;
|
||||
|
||||
@@ -190,13 +160,13 @@ lin
|
||||
SubjS = subjunctSentence ;
|
||||
SubjImper = subjunctImperative ;
|
||||
SubjQS = subjunctQuestion ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
|
||||
PhrNP = useNounPhrase ;
|
||||
PhrOneCN = useCommonNounPhrase singular ;
|
||||
PhrManyCN = useCommonNounPhrase plural ;
|
||||
PhrIP ip = ip ;
|
||||
PhrIAdv ia = ia ;
|
||||
PhrVPI = verbUtterance ;
|
||||
|
||||
OnePhr p = p ;
|
||||
ConsPhr = cc2 ;
|
||||
@@ -213,12 +183,5 @@ lin
|
||||
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||
(indefNounPhraseNum plural nu A)) ;
|
||||
|
||||
ExistQCl A = questVerbPhrase npDet
|
||||
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||
(indefNounPhrase singular A)) ;
|
||||
ExistNumQCl nu A = questVerbPhrase npDet
|
||||
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||
(indefNounPhraseNum plural nu A)) ;
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
@@ -1367,6 +1367,12 @@ oper
|
||||
|
||||
defaultSentence : Sentence -> Utterance = \x -> ss (x.s ! Main) ;
|
||||
|
||||
-- --- Here the agreement feature should really be given in context:
|
||||
-- "What do you want to do? - Wash myself."
|
||||
|
||||
verbUtterance : VerbPhrase -> Utterance = \vp ->
|
||||
ss (vp.s ++ vp.s2 ++ vp.s3 ! utrum ! Sg ! P1) ;
|
||||
|
||||
----------- changes when parametrizing 20/1/2005
|
||||
|
||||
---- moved from Morphology
|
||||
|
||||
63
lib/resource/scandinavian/VerbphraseScand.gf
Normal file
63
lib/resource/scandinavian/VerbphraseScand.gf
Normal file
@@ -0,0 +1,63 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete VerbphraseScand of Verbphrase = CategoriesScand **
|
||||
open Prelude, SyntaxScand in {
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
concrete VerbphraseEng of Verbphrase = CategoriesEng **
|
||||
open Prelude, SyntaxEng in {
|
||||
|
||||
lin
|
||||
UseV = predVerb ;
|
||||
UsePassV = passVerb ;
|
||||
ComplV2 = complTransVerb ;
|
||||
ComplReflV2 = reflTransVerb ;
|
||||
ComplVS = complSentVerb ;
|
||||
ComplVV = complVerbVerb ;
|
||||
ComplVQ = complQuestVerb ;
|
||||
ComplVA = complAdjVerb ;
|
||||
ComplV2A = complDitransAdjVerb ;
|
||||
ComplSubjV2V = complDitransVerbVerb False ;
|
||||
ComplObjV2V = complDitransVerbVerb True ;
|
||||
ComplV2S = complDitransSentVerb ;
|
||||
ComplV2Q = complDitransQuestVerb ;
|
||||
|
||||
PredAP = predAdjective ;
|
||||
PredSuperl a = predAdjective (superlAdjPhrase a) ;
|
||||
PredCN = predCommNoun ;
|
||||
PredNP = predNounPhrase ;
|
||||
PredPP = predAdverb ;
|
||||
PredAV = complVerbAdj ;
|
||||
PredObjA2V = complVerbAdj2 True ;
|
||||
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
RelVP = relVerbPhrase ;
|
||||
IntVP = intVerbPhrase ;
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
|
||||
}
|
||||
3
lib/resource/swedish/ClauseSwe.gf
Normal file
3
lib/resource/swedish/ClauseSwe.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete ClauseSwe of Clause = ClauseScand with (SyntaxScand=SyntaxSwe) ;
|
||||
@@ -1,6 +1,10 @@
|
||||
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||
|
||||
concrete TestResourceSwe of TestResource = RulesSwe, StructuralSwe **
|
||||
concrete TestResourceSwe of TestResource =
|
||||
-- RulesSwe,
|
||||
ClauseSwe,
|
||||
StructuralSwe
|
||||
**
|
||||
open Prelude, MorphoSwe, SyntaxSwe in {
|
||||
|
||||
flags startcat=Phr ; lexer=text ; unlexer=text ;
|
||||
|
||||
Reference in New Issue
Block a user