mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-29 12:48:54 -06:00
resource = resource-1.0
This commit is contained in:
223
lib/resource-0.9/abstract/Basic.gf
Normal file
223
lib/resource-0.9/abstract/Basic.gf
Normal file
@@ -0,0 +1,223 @@
|
||||
abstract Basic = Categories ** {
|
||||
fun
|
||||
airplane_N : N ;
|
||||
answer_V2S : V2S ;
|
||||
apartment_N : N ;
|
||||
apple_N : N ;
|
||||
art_N : N ;
|
||||
ask_V2Q : V2Q ;
|
||||
baby_N : N ;
|
||||
bad_ADeg : ADeg ;
|
||||
bank_N : N ;
|
||||
beautiful_ADeg : ADeg ;
|
||||
become_VA : VA ;
|
||||
beer_N : N ;
|
||||
beg_V2V : V2V ;
|
||||
big_ADeg : ADeg ;
|
||||
bike_N : N ;
|
||||
bird_N : N ;
|
||||
black_ADeg : ADeg ;
|
||||
blue_ADeg : ADeg ;
|
||||
boat_N : N ;
|
||||
book_N : N ;
|
||||
boot_N : N ;
|
||||
boss_N : N ;
|
||||
boy_N : N ;
|
||||
bread_N : N ;
|
||||
break_V2 : V2 ;
|
||||
broad_ADeg : ADeg ;
|
||||
brother_N2 : N2 ;
|
||||
brown_ADeg : ADeg ;
|
||||
butter_N : N ;
|
||||
buy_V2 : V2 ;
|
||||
camera_N : N ;
|
||||
cap_N : N ;
|
||||
car_N : N ;
|
||||
carpet_N : N ;
|
||||
cat_N : N ;
|
||||
ceiling_N : N ;
|
||||
chair_N : N ;
|
||||
cheese_N : N ;
|
||||
child_N : N ;
|
||||
church_N : N ;
|
||||
city_N : N ;
|
||||
clean_ADeg : ADeg ;
|
||||
clever_ADeg : ADeg ;
|
||||
close_V2 : V2 ;
|
||||
coat_N : N ;
|
||||
cold_ADeg : ADeg ;
|
||||
come_V : V ;
|
||||
computer_N : N ;
|
||||
country_N : N ;
|
||||
cousin_N : N ;
|
||||
cow_N : N ;
|
||||
die_V : V ;
|
||||
dirty_ADeg : ADeg ;
|
||||
distance_N3 : N3 ;
|
||||
doctor_N : N ;
|
||||
dog_N : N ;
|
||||
door_N : N ;
|
||||
drink_V2 : V2 ;
|
||||
easy_A2V : A2V ;
|
||||
eat_V2 : V2 ;
|
||||
enemy_N : N ;
|
||||
empty_ADeg : ADeg ;
|
||||
factory_N : N ;
|
||||
father_N2 : N2 ;
|
||||
fear_VS : VS ;
|
||||
find_V2 : V2 ;
|
||||
fish_N : N ;
|
||||
floor_N : N ;
|
||||
forget_V2 : V2 ;
|
||||
fridge_N : N ;
|
||||
friend_N : N ;
|
||||
fruit_N : N ;
|
||||
fun_AV : AV ;
|
||||
garden_N : N ;
|
||||
girl_N : N ;
|
||||
glove_N : N ;
|
||||
gold_N : N ;
|
||||
good_ADeg : ADeg ;
|
||||
go_V : V ;
|
||||
green_ADeg : ADeg ;
|
||||
harbour_N : N ;
|
||||
hate_V2 : V2 ;
|
||||
hat_N : N ;
|
||||
have_V2 : V2 ;
|
||||
hear_V2 : V2 ;
|
||||
hill_N : N ;
|
||||
hope_VS : VS ;
|
||||
horse_N : N ;
|
||||
hot_ADeg : ADeg ;
|
||||
house_N : N ;
|
||||
important_ADeg : ADeg ;
|
||||
industry_N : N ;
|
||||
iron_N : N ;
|
||||
king_N : N ;
|
||||
know_V2 : V2 ;
|
||||
lake_N : N ;
|
||||
lamp_N : N ;
|
||||
learn_V2 : V2 ;
|
||||
leather_N : N ;
|
||||
leave_V2 : V2 ;
|
||||
like_V2 : V2 ;
|
||||
listen_V2 : V2 ;
|
||||
live_V : V ;
|
||||
long_ADeg : ADeg ;
|
||||
lose_V2 : V2 ;
|
||||
love_N : N ;
|
||||
love_V2 : V2 ;
|
||||
man_N : N ;
|
||||
married_A2 : A2 ;
|
||||
meat_N : N ;
|
||||
milk_N : N ;
|
||||
moon_N : N ;
|
||||
mother_N2 : N2 ;
|
||||
mountain_N : N ;
|
||||
music_N : N ;
|
||||
narrow_ADeg : ADeg ;
|
||||
new_ADeg : ADeg ;
|
||||
newspaper_N : N ;
|
||||
oil_N : N ;
|
||||
old_ADeg : ADeg ;
|
||||
open_V2 : V2 ;
|
||||
paint_V2A : V2A ;
|
||||
paper_N : N ;
|
||||
peace_N : N ;
|
||||
pen_N : N ;
|
||||
planet_N : N ;
|
||||
plastic_N : N ;
|
||||
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 ;
|
||||
restaurant_N : N ;
|
||||
river_N : N ;
|
||||
rock_N : N ;
|
||||
roof_N : N ;
|
||||
rubber_N : N ;
|
||||
run_V : V ;
|
||||
say_VS : VS ;
|
||||
school_N : N ;
|
||||
science_N : N ;
|
||||
sea_N : N ;
|
||||
seek_V2 : V2 ;
|
||||
see_V2 : V2 ;
|
||||
sell_V3 : V3 ;
|
||||
send_V3 : V3 ;
|
||||
sheep_N : N ;
|
||||
ship_N : N ;
|
||||
shirt_N : N ;
|
||||
shoe_N : N ;
|
||||
shop_N : N ;
|
||||
short_ADeg : ADeg ;
|
||||
silver_N : N ;
|
||||
sister_N : N ;
|
||||
sleep_V : V ;
|
||||
small_ADeg : ADeg ;
|
||||
snake_N : N ;
|
||||
sock_N : N ;
|
||||
speak_V2 : V2 ;
|
||||
star_N : N ;
|
||||
steel_N : N ;
|
||||
stone_N : N ;
|
||||
stove_N : N ;
|
||||
student_N : N ;
|
||||
stupid_ADeg : ADeg ;
|
||||
sun_N : N ;
|
||||
switch8off_V2 : V2 ;
|
||||
switch8on_V2 : V2 ;
|
||||
table_N : N ;
|
||||
talk_V3 : V3 ;
|
||||
teacher_N : N ;
|
||||
teach_V2 : V2 ;
|
||||
television_N : N ;
|
||||
thick_ADeg : ADeg ;
|
||||
thin_ADeg : ADeg ;
|
||||
train_N : N ;
|
||||
travel_V : V ;
|
||||
tree_N : N ;
|
||||
---- trousers_N : N ;
|
||||
ugly_ADeg : ADeg ;
|
||||
understand_V2 : V2 ;
|
||||
university_N : N ;
|
||||
village_N : N ;
|
||||
wait_V2 : V2 ;
|
||||
walk_V : V ;
|
||||
warm_ADeg : ADeg ;
|
||||
war_N : N ;
|
||||
watch_V2 : V2 ;
|
||||
water_N : N ;
|
||||
white_ADeg : ADeg ;
|
||||
window_N : N ;
|
||||
wine_N : N ;
|
||||
win_V2 : V2 ;
|
||||
woman_N : N ;
|
||||
wonder_VQ : VQ ;
|
||||
wood_N : N ;
|
||||
write_V2 : V2 ;
|
||||
yellow_ADeg : ADeg ;
|
||||
young_ADeg : ADeg ;
|
||||
|
||||
do_V2 : V2 ;
|
||||
now_Adv : Adv ;
|
||||
already_Adv : Adv ;
|
||||
song_N : N ;
|
||||
add_V3 : V3 ;
|
||||
number_N : N ;
|
||||
put_V2 : V2 ;
|
||||
stop_V : V ;
|
||||
jump_V : V ;
|
||||
here_Adv : Adv ;
|
||||
here7to_Adv : Adv ;
|
||||
here7from_Adv : Adv ;
|
||||
there_Adv : Adv ;
|
||||
there7to_Adv : Adv ;
|
||||
there7from_Adv : Adv ;
|
||||
}
|
||||
190
lib/resource-0.9/abstract/Categories.gf
Normal file
190
lib/resource-0.9/abstract/Categories.gf
Normal file
@@ -0,0 +1,190 @@
|
||||
--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.
|
||||
|
||||
|
||||
abstract Categories = PredefAbs ** {
|
||||
--!
|
||||
--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", "many"
|
||||
NDet ; -- det that admits a num, e.g. "all (the 5)"
|
||||
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"
|
||||
VCl ; -- same (variable ant.) e.g. "walk"/"have walked"
|
||||
|
||||
--!
|
||||
--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 car"
|
||||
IDet ; -- interrog. determiner, e.g. "which", "how many"
|
||||
IAdv ; -- interrogative adverb., e.g. "when", "why"
|
||||
QCl ; -- question, e.g. "who walks"
|
||||
QS ; -- question w. fixed tense
|
||||
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
|
||||
ListAdv ;-- list of adverbs
|
||||
|
||||
--!
|
||||
--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
|
||||
|
||||
|
||||
RS ; -- relative clause with fixed tense and polarity
|
||||
|
||||
TP ; -- tense x polarity selector
|
||||
Tense ; -- (abstract) tense
|
||||
Ant ; -- (abstract) anteriority
|
||||
Pol ; -- polarity (positive or negative)
|
||||
|
||||
}
|
||||
145
lib/resource-0.9/abstract/Clause.gf
Normal file
145
lib/resource-0.9/abstract/Clause.gf
Normal file
@@ -0,0 +1,145 @@
|
||||
--!
|
||||
--1 Rules for predication forming clauses
|
||||
--
|
||||
-- This module treats predications in a shallow way, without right-branching
|
||||
-- $VP$ structures. This has the disadvantage of duplicating rules but the
|
||||
-- advantage of fast parsing due to elimination of discontinuous
|
||||
-- constituents. Also the canonical GF structures (in $.gfc$) files
|
||||
-- get smaller, because much more pruning of case alternatives can
|
||||
-- be performed at compile time.
|
||||
--
|
||||
-- Each of the rules below has the following structure:
|
||||
--
|
||||
-- "Subject -> Verb -> Complements -> Clause"
|
||||
--
|
||||
-- What complements are needed depends on the type of the verb.
|
||||
-- For instance, $V$ takes no complement, $V2$ takes one $NP$
|
||||
-- complement, $VS$ takes an $S$ complement, etc. There is an elegant
|
||||
-- way of expressing this using dependent types:
|
||||
--
|
||||
-- (v : VType) -> Subj -> Verb v -> Compl v -> Clause
|
||||
--
|
||||
-- Since there are 12 verb types in our category system, using this
|
||||
-- rule would be economical. The effect is amplified by another
|
||||
-- distinction that the rules make: there are separate sets of
|
||||
-- rules just differing in what type the subject and
|
||||
-- the resulting clause have. There are four different types:
|
||||
--
|
||||
--* $SPred$ (declarative clause, from $NP$ to $Cl$),
|
||||
--* $QPred$ (interrogative clause, from $IP$ to $QCl$),
|
||||
--* $RPred$ (relative clause, from $RP$ to $RCl$),
|
||||
--* $IPred$ (infinitive clause, from no subject to $VCl$).
|
||||
--
|
||||
-- The ultimate dependent type formalization of all the 4x12 rules is
|
||||
--
|
||||
-- (n : NType) -> (v : VType) -> Subj n -> Verb v -> Compl v -> Clause n
|
||||
--
|
||||
-- In the following, however, an expanded set of rules with no
|
||||
-- dependent types is shown.
|
||||
|
||||
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"
|
||||
SPredV3 : NP -> V3 -> NP -> NP -> Cl ; -- "John tells Mary everything"
|
||||
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"
|
||||
SPredCN : NP -> CN -> Cl ; -- "John is a man"
|
||||
SPredNP : NP -> NP -> Cl ; -- "John is Bill"
|
||||
SPredAdv : NP -> Adv -> Cl ; -- "John is in France"
|
||||
|
||||
SPredProgVP : NP -> VPI -> Cl ; -- "he is eating"
|
||||
|
||||
QPredV : IP -> V -> QCl ; -- "who walks"
|
||||
QPredPassV : IP -> V -> QCl ; -- "who is seen"
|
||||
QPredV2 : IP -> V2 -> NP -> QCl ; -- "who sees Mary"
|
||||
QPredV3 : IP -> V3 -> NP -> NP -> QCl ; -- "who gives Mary food"
|
||||
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"
|
||||
QPredCN : IP -> CN -> QCl ; -- "who is a man"
|
||||
QPredNP : IP -> NP -> QCl ; -- "who is Bill"
|
||||
QPredAdv : IP -> Adv -> QCl ; -- "who is in France"
|
||||
|
||||
QPredProgVP : IP -> VPI -> QCl ; -- "who is eating"
|
||||
|
||||
RPredV : RP -> V -> RCl ; -- "who walks"
|
||||
RPredPassV : RP -> V -> RCl ; -- "who is seen"
|
||||
RPredV2 : RP -> V2 -> NP -> RCl ; -- "who sees Mary"
|
||||
RPredV3 : RP -> V3 -> NP -> NP -> RCl ; -- "who gives Mary food"
|
||||
RPredReflV2 : RP -> V2 -> RCl ; -- "who loves himself"
|
||||
RPredVS : RP -> VS -> S -> RCl ; -- "who says that Mary runs"
|
||||
RPredVV : RP -> VV -> VPI -> RCl ; -- "who must walk"
|
||||
RPredVQ : RP -> VQ -> QS -> RCl ; -- "who asks who will come"
|
||||
RPredVA : RP -> VA -> AP -> RCl ; -- "who looks ill"
|
||||
RPredV2A : RP -> V2A -> NP -> AP -> RCl ; -- "who paints the house red"
|
||||
RPredSubjV2V : RP -> V2V -> NP -> VPI -> RCl ; -- "who promises Mary to leave"
|
||||
RPredObjV2V : RP -> V2V -> NP -> VPI -> RCl ; -- "who asks me to come"
|
||||
RPredV2S : RP -> V2S -> NP -> S -> RCl ; -- "who told me that it is good"
|
||||
RPredV2Q : RP -> V2Q -> NP -> QS -> RCl ; -- "who asked me if it is good"
|
||||
|
||||
RPredAP : RP -> AP -> RCl ; -- "who is old"
|
||||
RPredCN : RP -> CN -> RCl ; -- "who is a man"
|
||||
RPredNP : RP -> NP -> RCl ; -- "who is Bill"
|
||||
RPredAdv : RP -> Adv -> RCl ; -- "who is in France"
|
||||
|
||||
RPredProgVP : RP -> VPI -> RCl ; -- "who is eating"
|
||||
|
||||
IPredV : V -> VCl ; -- "walk"
|
||||
IPredPassV : V -> VCl ; -- "be seen"
|
||||
IPredV2 : V2 -> NP -> VCl ; -- "see Mary"
|
||||
IPredV3 : V3 -> NP -> NP -> VCl ; -- "give Mary food"
|
||||
IPredReflV2 : V2 -> VCl ; -- "love himself"
|
||||
IPredVS : VS -> S -> VCl ; -- "say that Mary runs"
|
||||
IPredVV : VV -> VPI -> VCl ; -- "want to walk"
|
||||
IPredVQ : VQ -> QS -> VCl ; -- "ask who will come"
|
||||
IPredVA : VA -> AP -> VCl ; -- "look ill"
|
||||
IPredV2A : V2A -> NP -> AP -> VCl ; -- "paint the house red"
|
||||
IPredSubjV2V : V2V -> NP -> VPI -> VCl ; -- "promise Mary to leave"
|
||||
IPredObjV2V : V2V -> NP -> VPI -> VCl ; -- "ask me to come"
|
||||
IPredV2S : V2S -> NP -> S -> VCl ; -- "tell me that it is good"
|
||||
IPredV2Q : V2Q -> NP -> QS -> VCl ; -- "ask me if it is good"
|
||||
|
||||
IPredAP : AP -> VCl ; -- "be old"
|
||||
IPredCN : CN -> VCl ; -- "be a man"
|
||||
IPredNP : NP -> VCl ; -- "be Bill"
|
||||
IPredAdv : Adv -> VCl ; -- "be in France"
|
||||
|
||||
IPredProgVP : VPI -> VCl ; -- "be eating"
|
||||
|
||||
|
||||
{-
|
||||
-- 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"
|
||||
-}
|
||||
|
||||
} ;
|
||||
111
lib/resource-0.9/abstract/ClauseI.gf
Normal file
111
lib/resource-0.9/abstract/ClauseI.gf
Normal file
@@ -0,0 +1,111 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete ClauseI of Clause = open Rules, Verbphrase in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
SPredV np v = PredVP np (UseV v) ;
|
||||
SPredPassV np v = PredVP np (UsePassV v) ;
|
||||
SPredV2 np v x = PredVP np (ComplV2 v x) ;
|
||||
SPredV3 np v x y = PredVP np (ComplV3 v x y) ;
|
||||
SPredReflV2 np v = PredVP np (ComplReflV2 v) ;
|
||||
SPredVS np v x = PredVP np (ComplVS v x) ;
|
||||
SPredVV np v x = PredVP np (ComplVV v x) ;
|
||||
SPredVQ np v x = PredVP np (ComplVQ v x) ;
|
||||
SPredVA np v x = PredVP np (ComplVA v x) ;
|
||||
SPredV2A np v x y = PredVP np (ComplV2A v x y) ;
|
||||
SPredSubjV2V np v x y = PredVP np (ComplSubjV2V v x y) ;
|
||||
SPredObjV2V np v x y = PredVP np (ComplObjV2V v x y) ;
|
||||
SPredV2S np v x y = PredVP np (ComplV2S v x y) ;
|
||||
SPredV2Q np v x y = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
SPredAP np v = PredVP np (PredAP v) ;
|
||||
SPredCN np v = PredVP np (PredCN v) ;
|
||||
SPredNP np v = PredVP np (PredNP v) ;
|
||||
SPredAdv np v = PredVP np (PredAdv v) ;
|
||||
|
||||
SPredProgVP np vp = PredVP np (PredProgVP vp) ;
|
||||
|
||||
QPredV np v = IntVP np (UseV v) ;
|
||||
QPredPassV np v = IntVP np (UsePassV v) ;
|
||||
QPredV2 np v x = IntVP np (ComplV2 v x) ;
|
||||
QPredV3 np v x y = IntVP np (ComplV3 v x y) ;
|
||||
QPredReflV2 np v = IntVP np (ComplReflV2 v) ;
|
||||
QPredVS np v x = IntVP np (ComplVS v x) ;
|
||||
QPredVV np v x = IntVP np (ComplVV v x) ;
|
||||
QPredVQ np v x = IntVP np (ComplVQ v x) ;
|
||||
QPredVA np v x = IntVP np (ComplVA v x) ;
|
||||
QPredV2A np v x y = IntVP np (ComplV2A v x y) ;
|
||||
QPredSubjV2V np v x y = IntVP np (ComplSubjV2V v x y) ;
|
||||
QPredObjV2V np v x y = IntVP np (ComplObjV2V v x y) ;
|
||||
QPredV2S np v x y = IntVP np (ComplV2S v x y) ;
|
||||
QPredV2Q np v x y = IntVP np (ComplV2Q v x y) ;
|
||||
|
||||
QPredAP np v = IntVP np (PredAP v) ;
|
||||
QPredCN np v = IntVP np (PredCN v) ;
|
||||
QPredNP np v = IntVP np (PredNP v) ;
|
||||
QPredAdv np v = IntVP np (PredAdv v) ;
|
||||
|
||||
QPredProgVP np vp = IntVP np (PredProgVP vp) ;
|
||||
|
||||
RPredV np v = RelVP np (UseV v) ;
|
||||
RPredPassV np v = RelVP np (UsePassV v) ;
|
||||
RPredV2 np v x = RelVP np (ComplV2 v x) ;
|
||||
RPredV3 np v x y = RelVP np (ComplV3 v x y) ;
|
||||
RPredReflV2 np v = RelVP np (ComplReflV2 v) ;
|
||||
RPredVS np v x = RelVP np (ComplVS v x) ;
|
||||
RPredVV np v x = RelVP np (ComplVV v x) ;
|
||||
RPredVQ np v x = RelVP np (ComplVQ v x) ;
|
||||
RPredVA np v x = RelVP np (ComplVA v x) ;
|
||||
RPredV2A np v x y = RelVP np (ComplV2A v x y) ;
|
||||
RPredSubjV2V np v x y = RelVP np (ComplSubjV2V v x y) ;
|
||||
RPredObjV2V np v x y = RelVP np (ComplObjV2V v x y) ;
|
||||
RPredV2S np v x y = RelVP np (ComplV2S v x y) ;
|
||||
RPredV2Q np v x y = RelVP np (ComplV2Q v x y) ;
|
||||
|
||||
RPredAP np v = RelVP np (PredAP v) ;
|
||||
RPredCN np v = RelVP np (PredCN v) ;
|
||||
RPredNP np v = RelVP np (PredNP v) ;
|
||||
RPredAdv np v = RelVP np (PredAdv v) ;
|
||||
|
||||
RPredProgVP np vp = RelVP np (PredProgVP vp) ;
|
||||
|
||||
IPredV v = UseVP (UseV v) ;
|
||||
IPredV2 v x = UseVP (ComplV2 v x) ;
|
||||
IPredPassV v = UseVP (UsePassV v) ;
|
||||
IPredV3 v x y = UseVP (ComplV3 v x y) ;
|
||||
IPredReflV2 v = UseVP (ComplReflV2 v) ;
|
||||
IPredVS v x = UseVP (ComplVS v x) ;
|
||||
IPredVV v x = UseVP (ComplVV v x) ;
|
||||
IPredVQ v x = UseVP (ComplVQ v x) ;
|
||||
IPredVA v x = UseVP (ComplVA v x) ;
|
||||
IPredV2A v x y = UseVP (ComplV2A v x y) ;
|
||||
IPredSubjV2V v x y = UseVP (ComplSubjV2V v x y) ;
|
||||
IPredObjV2V v x y = UseVP (ComplObjV2V v x y) ;
|
||||
IPredV2S v x y = UseVP (ComplV2S v x y) ;
|
||||
IPredV2Q v x y = UseVP (ComplV2Q v x y) ;
|
||||
|
||||
IPredAP v = UseVP (PredAP v) ;
|
||||
IPredCN v = UseVP (PredCN v) ;
|
||||
IPredNP v = UseVP (PredNP v) ;
|
||||
IPredAdv v = UseVP (PredAdv v) ;
|
||||
|
||||
IPredProgVP vp = UseVP (PredProgVP vp) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
113
lib/resource-0.9/abstract/ClausePredI.gf
Normal file
113
lib/resource-0.9/abstract/ClausePredI.gf
Normal file
@@ -0,0 +1,113 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete ClausePredI of Clause = open Predic in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
|
||||
SPredV np v = SPredVerb Vt_ np (UseV1 v) ComplNil ;
|
||||
SPredV2 np v x = SPredVerb (Vt CtN) np (UseV2 v) (ComplNP x) ;
|
||||
---- SPredV3 np v x y = SPredVerb (VtN CtN) np (UseV3 v) (ComplAdd (Vt CtN) x (ComplNP y)) ;
|
||||
---- SPredVS np v x = SPredVerb (Vt CtS) np (UseVS v) (ComplS x) ;
|
||||
|
||||
-- SPredPassV np v = PredVP np (UsePassV v) ;
|
||||
-- SPredReflV2 np v = PredVP np (ComplReflV2 v) ;
|
||||
{-
|
||||
SPredVV np v x = PredVP np (ComplVV v x) ;
|
||||
SPredVQ np v x = PredVP np (ComplVQ v x) ;
|
||||
SPredVA np v x = PredVP np (ComplVA v x) ;
|
||||
SPredV2A np v x y = PredVP np (ComplV2A v x y) ;
|
||||
SPredSubjV2V np v x y = PredVP np (ComplSubjV2V v x y) ;
|
||||
SPredObjV2V np v x y = PredVP np (ComplObjV2V v x y) ;
|
||||
SPredV2S np v x y = PredVP np (ComplV2S v x y) ;
|
||||
SPredV2Q np v x y = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
SPredAP np v = PredVP np (PredAP v) ;
|
||||
SPredCN np v = PredVP np (PredCN v) ;
|
||||
SPredNP np v = PredVP np (PredNP v) ;
|
||||
SPredAdv np v = PredVP np (PredAdv v) ;
|
||||
|
||||
SPredProgVP np vp = PredVP np (PredProgVP vp) ;
|
||||
|
||||
QPredV np v = IntVP np (UseV v) ;
|
||||
QPredPassV np v = IntVP np (UsePassV v) ;
|
||||
QPredV2 np v x = IntVP np (ComplV2 v x) ;
|
||||
QPredV3 np v x y = IntVP np (ComplV3 v x y) ;
|
||||
QPredReflV2 np v = IntVP np (ComplReflV2 v) ;
|
||||
QPredVS np v x = IntVP np (ComplVS v x) ;
|
||||
QPredVV np v x = IntVP np (ComplVV v x) ;
|
||||
QPredVQ np v x = IntVP np (ComplVQ v x) ;
|
||||
QPredVA np v x = IntVP np (ComplVA v x) ;
|
||||
QPredV2A np v x y = IntVP np (ComplV2A v x y) ;
|
||||
QPredSubjV2V np v x y = IntVP np (ComplSubjV2V v x y) ;
|
||||
QPredObjV2V np v x y = IntVP np (ComplObjV2V v x y) ;
|
||||
QPredV2S np v x y = IntVP np (ComplV2S v x y) ;
|
||||
QPredV2Q np v x y = IntVP np (ComplV2Q v x y) ;
|
||||
|
||||
QPredAP np v = IntVP np (PredAP v) ;
|
||||
QPredCN np v = IntVP np (PredCN v) ;
|
||||
QPredNP np v = IntVP np (PredNP v) ;
|
||||
QPredAdv np v = IntVP np (PredAdv v) ;
|
||||
|
||||
QPredProgVP np vp = IntVP np (PredProgVP vp) ;
|
||||
|
||||
RPredV np v = RelVP np (UseV v) ;
|
||||
RPredPassV np v = RelVP np (UsePassV v) ;
|
||||
RPredV2 np v x = RelVP np (ComplV2 v x) ;
|
||||
RPredV3 np v x y = RelVP np (ComplV3 v x y) ;
|
||||
RPredReflV2 np v = RelVP np (ComplReflV2 v) ;
|
||||
RPredVS np v x = RelVP np (ComplVS v x) ;
|
||||
RPredVV np v x = RelVP np (ComplVV v x) ;
|
||||
RPredVQ np v x = RelVP np (ComplVQ v x) ;
|
||||
RPredVA np v x = RelVP np (ComplVA v x) ;
|
||||
RPredV2A np v x y = RelVP np (ComplV2A v x y) ;
|
||||
RPredSubjV2V np v x y = RelVP np (ComplSubjV2V v x y) ;
|
||||
RPredObjV2V np v x y = RelVP np (ComplObjV2V v x y) ;
|
||||
RPredV2S np v x y = RelVP np (ComplV2S v x y) ;
|
||||
RPredV2Q np v x y = RelVP np (ComplV2Q v x y) ;
|
||||
|
||||
RPredAP np v = RelVP np (PredAP v) ;
|
||||
RPredCN np v = RelVP np (PredCN v) ;
|
||||
RPredNP np v = RelVP np (PredNP v) ;
|
||||
RPredAdv np v = RelVP np (PredAdv v) ;
|
||||
|
||||
RPredProgVP np vp = RelVP np (PredProgVP vp) ;
|
||||
|
||||
IPredV v = UseVP (UseV v) ;
|
||||
IPredV2 v x = UseVP (ComplV2 v x) ;
|
||||
IPredPassV v = UseVP (UsePassV v) ;
|
||||
IPredV3 v x y = UseVP (ComplV3 v x y) ;
|
||||
IPredReflV2 v = UseVP (ComplReflV2 v) ;
|
||||
IPredVS v x = UseVP (ComplVS v x) ;
|
||||
IPredVV v x = UseVP (ComplVV v x) ;
|
||||
IPredVQ v x = UseVP (ComplVQ v x) ;
|
||||
IPredVA v x = UseVP (ComplVA v x) ;
|
||||
IPredV2A v x y = UseVP (ComplV2A v x y) ;
|
||||
IPredSubjV2V v x y = UseVP (ComplSubjV2V v x y) ;
|
||||
IPredObjV2V v x y = UseVP (ComplObjV2V v x y) ;
|
||||
IPredV2S v x y = UseVP (ComplV2S v x y) ;
|
||||
IPredV2Q v x y = UseVP (ComplV2Q v x y) ;
|
||||
|
||||
IPredAP v = UseVP (PredAP v) ;
|
||||
IPredCN v = UseVP (PredCN v) ;
|
||||
IPredNP v = UseVP (PredNP v) ;
|
||||
IPredAdv v = UseVP (PredAdv v) ;
|
||||
|
||||
IPredProgVP vp = UseVP (PredProgVP vp) ;
|
||||
-}
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
IntVP = intVerbPhrase ;
|
||||
RelVP = relVerbPhrase ;
|
||||
|
||||
|
||||
PosVP tp = predVerbGroup True tp.a ;
|
||||
NegVP tp = predVerbGroup False tp.a ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
114
lib/resource-0.9/abstract/ClauseVP.gf
Normal file
114
lib/resource-0.9/abstract/ClauseVP.gf
Normal file
@@ -0,0 +1,114 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
abstract ClauseVP = Rules, Clause, Verbphrase ** {
|
||||
|
||||
fun
|
||||
trCl : Cl -> Cl ;
|
||||
trQCl : QCl -> QCl ;
|
||||
trRCl : RCl -> RCl ;
|
||||
trVCl : VCl -> VCl ;
|
||||
|
||||
def
|
||||
trCl (SPredV np v) = PredVP np (UseV v) ;
|
||||
trCl (SPredPassV np v) = PredVP np (UsePassV v) ;
|
||||
trCl (SPredV2 np v x) = PredVP np (ComplV2 v x) ;
|
||||
trCl (SPredV3 np v x y) = PredVP np (ComplV3 v x y) ;
|
||||
trCl (SPredReflV2 np v) = PredVP np (ComplReflV2 v) ;
|
||||
trCl (SPredVS np v x) = PredVP np (ComplVS v x) ;
|
||||
trCl (SPredVV np v x) = PredVP np (ComplVV v x) ;
|
||||
trCl (SPredVQ np v x) = PredVP np (ComplVQ v x) ;
|
||||
trCl (SPredVA np v x) = PredVP np (ComplVA v x) ;
|
||||
trCl (SPredV2A np v x y) = PredVP np (ComplV2A v x y) ;
|
||||
trCl (SPredSubjV2V np v x y) = PredVP np (ComplSubjV2V v x y) ;
|
||||
trCl (SPredObjV2V np v x y) = PredVP np (ComplObjV2V v x y) ;
|
||||
trCl (SPredV2S np v x y) = PredVP np (ComplV2S v x y) ;
|
||||
trCl (SPredV2Q np v x y) = PredVP np (ComplV2Q v x y) ;
|
||||
|
||||
trCl (SPredAP np v) = PredVP np (PredAP v) ;
|
||||
trCl (SPredCN np v) = PredVP np (PredCN v) ;
|
||||
trCl (SPredNP np v) = PredVP np (PredNP v) ;
|
||||
trCl (SPredAdv np v) = PredVP np (PredAdv v) ;
|
||||
|
||||
trCl (SPredProgVP np vp) = PredVP np (PredProgVP vp) ;
|
||||
|
||||
trQCl (QPredV np v) = IntVP np (UseV v) ;
|
||||
trQCl (QPredPassV np v) = IntVP np (UsePassV v) ;
|
||||
trQCl (QPredV2 np v x) = IntVP np (ComplV2 v x) ;
|
||||
trQCl (QPredV3 np v x y) = IntVP np (ComplV3 v x y) ;
|
||||
trQCl (QPredReflV2 np v) = IntVP np (ComplReflV2 v) ;
|
||||
trQCl (QPredVS np v x) = IntVP np (ComplVS v x) ;
|
||||
trQCl (QPredVV np v x) = IntVP np (ComplVV v x) ;
|
||||
trQCl (QPredVQ np v x) = IntVP np (ComplVQ v x) ;
|
||||
trQCl (QPredVA np v x) = IntVP np (ComplVA v x) ;
|
||||
trQCl (QPredV2A np v x y) = IntVP np (ComplV2A v x y) ;
|
||||
trQCl (QPredSubjV2V np v x y) = IntVP np (ComplSubjV2V v x y) ;
|
||||
trQCl (QPredObjV2V np v x y) = IntVP np (ComplObjV2V v x y) ;
|
||||
trQCl (QPredV2S np v x y) = IntVP np (ComplV2S v x y) ;
|
||||
trQCl (QPredV2Q np v x y) = IntVP np (ComplV2Q v x y) ;
|
||||
|
||||
trQCl (QPredAP np v) = IntVP np (PredAP v) ;
|
||||
trQCl (QPredCN np v) = IntVP np (PredCN v) ;
|
||||
trQCl (QPredNP np v) = IntVP np (PredNP v) ;
|
||||
trQCl (QPredAdv np v) = IntVP np (PredAdv v) ;
|
||||
|
||||
trQCl (QPredProgVP np vp) = IntVP np (PredProgVP vp) ;
|
||||
|
||||
trRCl (RPredV np v) = RelVP np (UseV v) ;
|
||||
trRCl (RPredPassV np v) = RelVP np (UsePassV v) ;
|
||||
trRCl (RPredV2 np v x) = RelVP np (ComplV2 v x) ;
|
||||
trRCl (RPredV3 np v x y) = RelVP np (ComplV3 v x y) ;
|
||||
trRCl (RPredReflV2 np v) = RelVP np (ComplReflV2 v) ;
|
||||
trRCl (RPredVS np v x) = RelVP np (ComplVS v x) ;
|
||||
trRCl (RPredVV np v x) = RelVP np (ComplVV v x) ;
|
||||
trRCl (RPredVQ np v x) = RelVP np (ComplVQ v x) ;
|
||||
trRCl (RPredVA np v x) = RelVP np (ComplVA v x) ;
|
||||
trRCl (RPredV2A np v x y) = RelVP np (ComplV2A v x y) ;
|
||||
trRCl (RPredSubjV2V np v x y) = RelVP np (ComplSubjV2V v x y) ;
|
||||
trRCl (RPredObjV2V np v x y) = RelVP np (ComplObjV2V v x y) ;
|
||||
trRCl (RPredV2S np v x y) = RelVP np (ComplV2S v x y) ;
|
||||
trRCl (RPredV2Q np v x y) = RelVP np (ComplV2Q v x y) ;
|
||||
|
||||
trRCl (RPredAP np v) = RelVP np (PredAP v) ;
|
||||
trRCl (RPredCN np v) = RelVP np (PredCN v) ;
|
||||
trRCl (RPredNP np v) = RelVP np (PredNP v) ;
|
||||
trRCl (RPredAdv np v) = RelVP np (PredAdv v) ;
|
||||
|
||||
trRCl (RPredProgVP np vp) = RelVP np (PredProgVP vp) ;
|
||||
|
||||
trVCl (IPredV v) = UseVP (UseV v) ;
|
||||
trVCl (IPredV2 v x) = UseVP (ComplV2 v x) ;
|
||||
trVCl (IPredPassV v) = UseVP (UsePassV v) ;
|
||||
trVCl (IPredV3 v x y) = UseVP (ComplV3 v x y) ;
|
||||
trVCl (IPredReflV2 v) = UseVP (ComplReflV2 v) ;
|
||||
trVCl (IPredVS v x) = UseVP (ComplVS v x) ;
|
||||
trVCl (IPredVV v x) = UseVP (ComplVV v x) ;
|
||||
trVCl (IPredVQ v x) = UseVP (ComplVQ v x) ;
|
||||
trVCl (IPredVA v x) = UseVP (ComplVA v x) ;
|
||||
trVCl (IPredV2A v x y) = UseVP (ComplV2A v x y) ;
|
||||
trVCl (IPredSubjV2V v x y) = UseVP (ComplSubjV2V v x y) ;
|
||||
trVCl (IPredObjV2V v x y) = UseVP (ComplObjV2V v x y) ;
|
||||
trVCl (IPredV2S v x y) = UseVP (ComplV2S v x y) ;
|
||||
trVCl (IPredV2Q v x y) = UseVP (ComplV2Q v x y) ;
|
||||
|
||||
trVCl (IPredAP v) = UseVP (PredAP v) ;
|
||||
trVCl (IPredCN v) = UseVP (PredCN v) ;
|
||||
trVCl (IPredNP v) = UseVP (PredNP v) ;
|
||||
trVCl (IPredAdv v) = UseVP (PredAdv v) ;
|
||||
|
||||
trVCl (IPredProgVP vp) = UseVP (PredProgVP vp) ;
|
||||
|
||||
{-
|
||||
-- Use VPs
|
||||
|
||||
trRCl (IntVP) = intVerbPhrase ;
|
||||
trRCl (RelVP) = relVerbPhrase ;
|
||||
|
||||
|
||||
trRCl (PosVP tp) = predVerbGroup True tp.a ;
|
||||
trRCl (NegVP tp) = predVerbGroup False tp.a ;
|
||||
|
||||
trRCl (AdvVP) = adVerbPhrase ;
|
||||
trRCl (SubjVP) = subjunctVerbPhrase ;
|
||||
-}
|
||||
|
||||
}
|
||||
23
lib/resource-0.9/abstract/Country.gf
Normal file
23
lib/resource-0.9/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 ;
|
||||
} ;
|
||||
56
lib/resource-0.9/abstract/DemRes.gf
Normal file
56
lib/resource-0.9/abstract/DemRes.gf
Normal file
@@ -0,0 +1,56 @@
|
||||
interface DemRes = open Prelude, Resource in {
|
||||
|
||||
oper
|
||||
Pointing = {s5 : Str} ;
|
||||
|
||||
noPointing : Pointing = {s5 = []} ;
|
||||
|
||||
mkDemS : Cl -> DemAdverb -> Pointing -> MultiSentence = \cl,adv,p ->
|
||||
{s = table {
|
||||
MInd b => msS (UseCl (polar b) (AdvCl cl adv)) ;
|
||||
MQuest b => msQS (UseQCl (polar b) (QuestCl (AdvCl cl adv)))
|
||||
} ;
|
||||
s5 = p.s5 ++ adv.s5
|
||||
} ;
|
||||
|
||||
polar : Bool -> TP = \b -> case b of {
|
||||
True => PosTP TPresent ASimul ;
|
||||
False => NegTP TPresent ASimul
|
||||
} ;
|
||||
|
||||
mkDemQ : QCl -> DemAdverb -> Pointing -> MultiQuestion = \cl,adv,p ->
|
||||
{s = \\b => msQS (UseQCl (polar b) cl) ++ adv.s ; --- (AdvQCl cl adv)) ;
|
||||
s5 = p.s5 ++ adv.s5
|
||||
} ;
|
||||
mkDemImp : VCl -> DemAdverb -> Pointing -> MultiImperative = \cl,adv,p ->
|
||||
{s = table {
|
||||
True => msImp (PosImpVP cl) ++ adv.s ;
|
||||
False => msImp (NegImpVP cl) ++ adv.s
|
||||
} ;
|
||||
s5 = p.s5 ++ adv.s5
|
||||
} ;
|
||||
|
||||
msS : S -> Str ;
|
||||
msQS : QS -> Str ;
|
||||
msImp : Imp -> Str ;
|
||||
|
||||
concatDem : (x,y : Pointing) -> Pointing = \x,y -> {
|
||||
s5 = x.s5 ++ y.s5
|
||||
} ;
|
||||
|
||||
mkDemType : Type -> Type = \t -> t ** Pointing ;
|
||||
|
||||
MultiSentence : Type = mkDemType {s : MSForm => Str} ;
|
||||
MultiQuestion : Type = mkDemType {s : Bool => Str} ;
|
||||
MultiImperative : Type = mkDemType {s : Bool => Str} ;
|
||||
|
||||
Demonstrative : Type = mkDemType NP ;
|
||||
DemAdverb : Type = mkDemType Adv ;
|
||||
|
||||
mkDAdv : Adv -> Pointing -> DemAdverb = \a,p ->
|
||||
a ** p ** {lock_Adv = a.lock_Adv} ;
|
||||
|
||||
param
|
||||
MSForm = MInd Bool | MQuest Bool ;
|
||||
|
||||
}
|
||||
44
lib/resource-0.9/abstract/Demonstrative.gf
Normal file
44
lib/resource-0.9/abstract/Demonstrative.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
abstract Demonstrative = Categories ** {
|
||||
|
||||
cat
|
||||
MS ; -- multimodal sentence or question
|
||||
MQS ; -- multimodal wh question
|
||||
MImp ; -- multimodal imperative
|
||||
DNP ; -- demonstrative noun phrase
|
||||
DAdv ; -- demonstrative adverbial
|
||||
[DAdv] ; -- list of demonstrative adverbials
|
||||
Point ; -- pointing gesture
|
||||
|
||||
fun
|
||||
MkPoint : String -> Point ;
|
||||
|
||||
DemV : V -> DNP -> [DAdv] -> MS ; -- this flies (here)
|
||||
DemV2 : V2 -> DNP -> DNP -> [DAdv] -> MS ; -- this takes that
|
||||
ModDemV : VV -> V -> DNP -> [DAdv] -> MS ; -- this wants to fly
|
||||
ModDemV2 : VV -> V2 -> DNP -> DNP -> [DAdv] -> MS ; -- this wants to take that
|
||||
|
||||
ImpDemV : V -> [DAdv] -> MImp ; -- fly (here)
|
||||
ImpDemV2 : V2 -> DNP -> [DAdv] -> MImp ; -- take that
|
||||
|
||||
QDemV : V -> IP -> [DAdv] -> MQS ; -- who flies (here)
|
||||
QDemV2 : V2 -> IP -> DNP -> [DAdv] -> MQS ; -- who takes that
|
||||
QDemSlashV2 : V2 -> DNP -> IP -> [DAdv] -> MQS ; -- whom does that take
|
||||
QModDemV : VV -> V -> IP -> [DAdv] -> MQS ; -- who wants to fly (here)
|
||||
QModDemV2 : VV -> V2 -> IP -> DNP -> [DAdv] -> MQS ; -- who wants to take that
|
||||
QModDemSlashV2 : VV -> V2 -> DNP -> IP -> [DAdv] -> MQS ; -- whom does that want to take
|
||||
|
||||
this_DNP : Point -> DNP ; -- this
|
||||
that_DNP : Point -> DNP ; -- that
|
||||
thisDet_DNP : Point -> CN -> DNP ; -- this car
|
||||
thatDet_DNP : Point -> CN -> DNP ; -- that car
|
||||
|
||||
here_DAdv : Point -> DAdv ; -- here
|
||||
here7from_DAdv : Point -> DAdv ; -- from here
|
||||
here7to_DAdv : Point -> DAdv ; -- to here
|
||||
|
||||
PrepDNP : Prep -> DNP -> DAdv ;
|
||||
|
||||
-- to test
|
||||
|
||||
point1, point2 : Point ;
|
||||
}
|
||||
62
lib/resource-0.9/abstract/DemonstrativeI.gf
Normal file
62
lib/resource-0.9/abstract/DemonstrativeI.gf
Normal file
@@ -0,0 +1,62 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
incomplete concrete DemonstrativeI of Demonstrative =
|
||||
open Prelude, Resource, Basic, DemRes in {
|
||||
|
||||
lincat
|
||||
MS = MultiSentence ;
|
||||
MQS = MultiQuestion ;
|
||||
MImp = MultiImperative ;
|
||||
DNP = Demonstrative ;
|
||||
DAdv = DemAdverb ;
|
||||
[DAdv] = DemAdverb ;
|
||||
Point = Pointing ;
|
||||
|
||||
lin
|
||||
MkPoint s = {s5 = s.s} ;
|
||||
|
||||
DemV verb dem adv =
|
||||
mkDemS (SPredV dem verb) adv dem ;
|
||||
DemV2 verb su ob adv =
|
||||
mkDemS (SPredV2 su verb ob) adv (concatDem su ob) ;
|
||||
ModDemV vv verb dem adv =
|
||||
mkDemS (SPredVV dem vv (UseVCl PPos ASimul (IPredV verb))) adv dem ;
|
||||
ModDemV2 vv verb su ob adv =
|
||||
mkDemS (SPredVV su vv (UseVCl PPos ASimul (IPredV2 verb ob))) adv (concatDem su ob) ;
|
||||
|
||||
ImpDemV verb adv =
|
||||
mkDemImp (IPredV verb) adv noPointing ;
|
||||
ImpDemV2 verb ob adv =
|
||||
mkDemImp (IPredV2 verb ob) adv ob ;
|
||||
|
||||
QDemV verb ip adv =
|
||||
mkDemQ (QPredV ip verb) adv noPointing ;
|
||||
QDemV2 verb ip ob adv =
|
||||
mkDemQ (QPredV2 ip verb ob) adv ob ;
|
||||
QDemSlashV2 verb su ip adv =
|
||||
mkDemQ (IntSlash ip (SlashV2 su verb)) adv su ;
|
||||
QModDemV vv verb ip adv =
|
||||
mkDemQ (QPredVV ip vv (UseVCl PPos ASimul (IPredV verb))) adv noPointing ;
|
||||
QModDemV2 vv verb ip ob adv =
|
||||
mkDemQ (QPredVV ip vv (UseVCl PPos ASimul (IPredV2 verb ob))) adv ob ;
|
||||
QModDemSlashV2 vv verb su ip adv =
|
||||
mkDemQ (IntSlash ip (SlashVV2 su vv verb)) adv su ;
|
||||
|
||||
this_DNP p = this_NP ** p ;
|
||||
that_DNP p = that_NP ** p ;
|
||||
thisDet_DNP p cn = DetNP this_Det cn ** p ;
|
||||
thatDet_DNP p cn = DetNP that_Det cn ** p ;
|
||||
|
||||
here_DAdv p = mkDAdv here_Adv p ;
|
||||
here7from_DAdv p = mkDAdv here7from_Adv p ;
|
||||
here7to_DAdv p = mkDAdv here7to_Adv p ;
|
||||
|
||||
BaseDAdv = {s,s5 = [] ; lock_Adv = <>} ;
|
||||
ConsDAdv a as = {s = a.s ++ as.s ; s5 = a.s5 ++ as.s5 ; lock_Adv = <>} ;
|
||||
|
||||
PrepDNP p np = mkDAdv (AdvPP (PrepNP p np)) np ;
|
||||
|
||||
point1 = {s5 = "p1"} ;
|
||||
point2 = {s5 = "p2"} ;
|
||||
|
||||
}
|
||||
31
lib/resource-0.9/abstract/Lang.gf
Normal file
31
lib/resource-0.9/abstract/Lang.gf
Normal file
@@ -0,0 +1,31 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Lang =
|
||||
Rules,
|
||||
Clause,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Country,
|
||||
Math
|
||||
|
||||
** {
|
||||
|
||||
flags startcat=Phr ;
|
||||
|
||||
fun
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
NWeekday : Weekday -> N ;
|
||||
PNWeekday : Weekday -> PN ;
|
||||
|
||||
-- Mount $Country$.
|
||||
|
||||
PNCountry : Country -> PN ;
|
||||
ANationality : Nationality -> A ;
|
||||
NLanguage : Language -> N ;
|
||||
|
||||
}
|
||||
13
lib/resource-0.9/abstract/LangVP.gf
Normal file
13
lib/resource-0.9/abstract/LangVP.gf
Normal file
@@ -0,0 +1,13 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
-- alternative API that is able to return VP's by parsing with Cl
|
||||
-- constructors and then computing. AR 14/11/2005
|
||||
--
|
||||
-- to import: 'i -noparse=vp.gfnoparse LangVPEng'
|
||||
-- to use: 'p -cat=Cl "I see her" | wt -c trCl'
|
||||
|
||||
abstract LangVP =
|
||||
Lang,
|
||||
Verbphrase,
|
||||
ClauseVP ** {
|
||||
} ;
|
||||
53
lib/resource-0.9/abstract/Math.gf
Normal file
53
lib/resource-0.9/abstract/Math.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
|
||||
|
||||
abstract Math = Categories ** {
|
||||
|
||||
--3 Noun phrases with symbols
|
||||
|
||||
fun
|
||||
SymbPN : String -> PN ; -- "x"
|
||||
IntPN : Int -> PN ; -- "27"
|
||||
IntNP : CN -> Int -> NP ; -- "level 53"
|
||||
|
||||
IndefSymbNumNP : Num -> CN -> SymbList -> NP ; -- "(2) numbers x and y"
|
||||
DefSymbNumNP : Num -> CN -> SymbList -> NP ; -- "the (2) numbers x and y"
|
||||
NDetSymbNP : NDet -> Num -> CN -> SymbList -> NP ; -- "some (3) points x, y and z"
|
||||
|
||||
--3 Symbol lists
|
||||
|
||||
-- A symbol list has at least two elements. The last two are separated
|
||||
-- by a conjunction ("and" in English), the others by commas.
|
||||
-- This produces "x, y and z", in English.
|
||||
|
||||
cat
|
||||
SymbList ;
|
||||
|
||||
fun
|
||||
SymbTwo : String -> String -> SymbList ;
|
||||
SymbMore : String -> SymbList -> SymbList ;
|
||||
|
||||
--3 Special forms of expression
|
||||
|
||||
-- This expression form is typical of mathematical texts.
|
||||
-- It is realized with different constructs in different languages, typically
|
||||
-- some kind of 3rd person imperative of the verb "be".
|
||||
|
||||
LetImp : NP -> NP -> Imp ; -- let x be a number
|
||||
|
||||
-- This rule is slightly overgenerating: "there exists every number x".
|
||||
-- The problem seems to be of semantic nature. By this we avoid having many rules.
|
||||
|
||||
ExistNP : NP -> Cl ; -- there exist (2) number(s) x and y
|
||||
|
||||
--3 Rules moved from $Rules$.
|
||||
|
||||
-- This rule is powerful but overgenerating.
|
||||
|
||||
SymbCN : CN -> String -> CN ; -- "number x"
|
||||
|
||||
-- This rule is simply wrong, and will be deprecated: the correct
|
||||
-- value type is $NP$.
|
||||
|
||||
IntCN : CN -> Int -> CN ; -- "level 53"
|
||||
|
||||
}
|
||||
43
lib/resource-0.9/abstract/Minimal.gf
Normal file
43
lib/resource-0.9/abstract/Minimal.gf
Normal file
@@ -0,0 +1,43 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Minimal = Categories ** {
|
||||
|
||||
-- a minimum sample of lexicon to test resource grammar with
|
||||
|
||||
fun
|
||||
-- nouns: count and mass, relational
|
||||
man_N : N ;
|
||||
wine_N : N ;
|
||||
mother_N2 : N2 ;
|
||||
distance_N3 : N3 ;
|
||||
|
||||
-- proper names
|
||||
john_PN : PN ;
|
||||
|
||||
-- adjectives: with and without degree
|
||||
blue_ADeg : ADeg ;
|
||||
american_A : A ;
|
||||
|
||||
-- adjectives: noun phase, sentence, and verb complements
|
||||
married_A2 : A2 ;
|
||||
probable_AS : AS ;
|
||||
important_A2S : A2S ;
|
||||
easy_A2V : A2V ;
|
||||
|
||||
-- adverbs
|
||||
now_Adv : Adv ;
|
||||
|
||||
-- verbs
|
||||
walk_V : V ;
|
||||
love_V2 : V2 ;
|
||||
give_V3 : V3 ;
|
||||
believe_VS : VS ;
|
||||
try_VV : VV ;
|
||||
wonder_VQ : VQ ;
|
||||
become_VA : VA ;
|
||||
paint_V2A : V2A ;
|
||||
promise_V2V : V2V ;
|
||||
ask_V2Q : V2Q ;
|
||||
tell_V2S : V2S ;
|
||||
rain_V0 : V0 ;
|
||||
} ;
|
||||
30
lib/resource-0.9/abstract/Multimodal.gf
Normal file
30
lib/resource-0.9/abstract/Multimodal.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Multimodal =
|
||||
Rules,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Demonstrative
|
||||
|
||||
** {
|
||||
|
||||
flags startcat=Phr ;
|
||||
|
||||
fun
|
||||
|
||||
-- Interface to $Demonstrative$.
|
||||
|
||||
DemNP : NP -> DNP ;
|
||||
DemAdv : Adv -> DAdv ;
|
||||
SentMS : Pol -> MS -> Phr ;
|
||||
QuestMS : Pol -> MS -> Phr ;
|
||||
QuestMQS : Pol -> MQS -> Phr ;
|
||||
ImpMImp : Pol -> MImp -> Phr ;
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
|
||||
}
|
||||
16
lib/resource-0.9/abstract/MultimodalI.gf
Normal file
16
lib/resource-0.9/abstract/MultimodalI.gf
Normal file
@@ -0,0 +1,16 @@
|
||||
incomplete concrete MultimodalI of Multimodal =
|
||||
open Prelude, Resource, Basic, Lang, DemRes in {
|
||||
|
||||
lin
|
||||
DemNP np = np ** {s5 = [] ; lock_NP = <>} ;
|
||||
DemAdv adv = mkDAdv (adv ** {lock_Adv = <>}) {s5 = []} ;
|
||||
SentMS p ms = {s = p.s ++ ms.s ! MInd (p.p) ++ ";" ++ ms.s5} ;
|
||||
QuestMS p ms = {s = p.s ++ ms.s ! MQuest (p.p) ++ ";" ++ ms.s5} ;
|
||||
QuestMQS p ms = {s = p.s ++ ms.s ! p.p ++ ";" ++ ms.s5} ;
|
||||
ImpMImp p ms = {s = p.s ++ ms.s ! p.p ++ ";" ++ ms.s5} ;
|
||||
|
||||
AdvDate = AdvDate ;
|
||||
AdvTime = AdvTime ;
|
||||
|
||||
}
|
||||
|
||||
34
lib/resource-0.9/abstract/Numerals.gf
Normal file
34
lib/resource-0.9/abstract/Numerals.gf
Normal file
@@ -0,0 +1,34 @@
|
||||
-- numerals from 1 to 999999 in decimal notation
|
||||
|
||||
abstract Numerals = {
|
||||
|
||||
flags startcat=Numeral ;
|
||||
|
||||
cat
|
||||
Numeral ; -- 0..
|
||||
Digit ; -- 2..9
|
||||
Sub10 ; -- 1..9
|
||||
Sub100 ; -- 1..99
|
||||
Sub1000 ; -- 1..999
|
||||
Sub1000000 ; -- 1..999999
|
||||
|
||||
fun
|
||||
num : Sub1000000 -> Numeral ;
|
||||
|
||||
n2, n3, n4, n5, n6, n7, n8, n9 : Digit ;
|
||||
|
||||
pot01 : Sub10 ; -- 1
|
||||
pot0 : Digit -> Sub10 ; -- d * 1
|
||||
pot110 : Sub100 ; -- 10
|
||||
pot111 : Sub100 ; -- 11
|
||||
pot1to19 : Digit -> Sub100 ; -- 10 + d
|
||||
pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9
|
||||
pot1 : Digit -> Sub100 ; -- d * 10
|
||||
pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n
|
||||
pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99
|
||||
pot2 : Sub10 -> Sub1000 ; -- m * 100
|
||||
pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n
|
||||
pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999
|
||||
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||
}
|
||||
44
lib/resource-0.9/abstract/Predic.gf
Normal file
44
lib/resource-0.9/abstract/Predic.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
abstract Predic = Categories ** {
|
||||
|
||||
cat
|
||||
VType ;
|
||||
CType ;
|
||||
Verb VType ;
|
||||
Compl VType ;
|
||||
|
||||
fun
|
||||
Vt_ : VType ;
|
||||
Vt : CType -> VType ;
|
||||
VtN : CType -> VType ;
|
||||
|
||||
CtN, CtS, CtV, CtQ, CtA : CType ;
|
||||
|
||||
SPredVerb : (v : VType) -> NP -> Verb v -> Compl v -> Cl ;
|
||||
|
||||
QPredVerb : (v : VType) -> IP -> Verb v -> Compl v -> QCl ;
|
||||
RPredVerb : (v : VType) -> RP -> Verb v -> Compl v -> RCl ;
|
||||
IPredVerb : (v : VType) -> Verb v -> Compl v -> VCl ;
|
||||
|
||||
Compl_ : Compl Vt_ ;
|
||||
ComplN : NP -> Compl (Vt CtN) ;
|
||||
ComplS : S -> Compl (Vt CtS) ;
|
||||
ComplQ : QS -> Compl (Vt CtQ) ;
|
||||
ComplA : AP -> Compl (Vt CtQ) ;
|
||||
|
||||
ComplAdd : (c : CType) -> NP -> Compl (Vt c) -> Compl (VtN c) ;
|
||||
|
||||
VeV1 : V -> Verb Vt_ ;
|
||||
VeV2 : V2 -> Verb (Vt CtN) ;
|
||||
VeVS : VS -> Verb (Vt CtS) ;
|
||||
VeV3 : V3 -> Verb (VtN CtN) ;
|
||||
VeV2S : V2S -> Verb (VtN CtS) ;
|
||||
VeV2Q : V2Q -> Verb (VtN CtQ) ;
|
||||
---- etc
|
||||
}
|
||||
|
||||
{-
|
||||
MkSlash3 : NG NtS -> VG (VtN CtN) -> CG (Vt CtN) -> Slash ;
|
||||
MkSlash2 : (c : CType) -> NG NtS -> VG (VtN c) -> CG (Vt c) -> Slash ;
|
||||
MkSlash1 : NG NtS -> VG (Vt CtN) -> Slash ;
|
||||
SlashQ : NG NtQ -> Slash -> SG NtQ ;
|
||||
-}
|
||||
3
lib/resource-0.9/abstract/Resource.gf
Normal file
3
lib/resource-0.9/abstract/Resource.gf
Normal file
@@ -0,0 +1,3 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract Resource = Rules, Clause, Structural ** {} ;
|
||||
243
lib/resource-0.9/abstract/Rules.gf
Normal file
243
lib/resource-0.9/abstract/Rules.gf
Normal file
@@ -0,0 +1,243 @@
|
||||
--!
|
||||
--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 Rules = Categories ** {
|
||||
|
||||
--!
|
||||
--3 Nouns and noun phrases
|
||||
--
|
||||
|
||||
fun
|
||||
UseN : N -> CN ; -- "car"
|
||||
UsePN : PN -> NP ; -- "John"
|
||||
|
||||
-- These three rules have been moved to the module $Math$.
|
||||
{-
|
||||
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"
|
||||
NDetNP : NDet -> Num -> CN -> NP ; -- "these (5) cars"
|
||||
NDetNum : NDet -> Num -> NP ; -- "these (5)"
|
||||
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"
|
||||
SuperlADeg : ADeg -> AP ; -- "the oldest"
|
||||
|
||||
ComplAV : AV -> VPI -> AP ; -- "eager to leave"
|
||||
ComplObjA2V : A2V -> NP -> VPI -> AP ; -- "easy for us to convince"
|
||||
|
||||
|
||||
|
||||
--!
|
||||
--3 Verbs and verb phrases
|
||||
--
|
||||
-- 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"
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 : V2 -> V ; -- "loves"
|
||||
|
||||
ComplA2S : A2S -> NP -> AS ; -- "good for John"
|
||||
|
||||
UseV2V : V2V -> VV ;
|
||||
UseV2S : V2S -> VS ;
|
||||
UseV2Q : V2Q -> VQ ;
|
||||
UseA2S : A2S -> AS ;
|
||||
UseA2V : A2V -> AV ;
|
||||
|
||||
-- Formation of tensed phrases.
|
||||
|
||||
AdjPart : V -> A ; -- past participle, e.g. "forgotten"
|
||||
|
||||
UseCl : TP -> Cl -> S ;
|
||||
UseRCl : TP -> RCl -> RS ;
|
||||
UseQCl : TP -> QCl -> QS ;
|
||||
|
||||
UseVCl : Pol -> Ant -> VCl -> VPI ;
|
||||
|
||||
PosTP : Tense -> Ant -> TP ;
|
||||
NegTP : Tense -> Ant -> TP ;
|
||||
|
||||
TPresent : Tense ;
|
||||
TPast : Tense ;
|
||||
TFuture : Tense ;
|
||||
TConditional : Tense ;
|
||||
|
||||
ASimul : Ant ;
|
||||
AAnter : Ant ;
|
||||
|
||||
PPos : Pol ;
|
||||
PNeg : Pol ;
|
||||
|
||||
--!
|
||||
--3 Adverbs
|
||||
--
|
||||
-- Here is how complex adverbs can be formed and used.
|
||||
|
||||
AdjAdv : A -> Adv ; -- "freely"
|
||||
AdvPP : PP -> Adv ; -- "in London", "after the war"
|
||||
PrepNP : Prep -> NP -> PP ; -- "in London", "after the war"
|
||||
|
||||
AdvCN : CN -> Adv -> CN ; -- "house in London"
|
||||
AdvNP : NP -> Adv -> NP ; -- "the house in London"
|
||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||
AdvAdv : AdA -> Adv -> Adv ; -- "very well"
|
||||
|
||||
|
||||
--!
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
SlashV2 : NP -> V2 -> Slash ; -- "(whom) John doesn't love"
|
||||
SlashVV2 : NP -> VV -> V2 -> Slash ; -- "(which song do you) want to play"
|
||||
SlashAdv : Cl -> Prep -> Slash ; -- "(whom) John walks with"
|
||||
|
||||
IdRP : RP ; -- "which"
|
||||
FunRP : N2 -> RP -> RP ; -- "the successor of which"
|
||||
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
|
||||
--
|
||||
|
||||
FunIP : N2 -> IP -> IP ; -- "the mother of whom"
|
||||
IDetCN : IDet -> CN -> IP ; -- "which car", "which cars"
|
||||
|
||||
QuestCl : Cl -> QCl ; -- "does John walk"; "doesn't John walk"
|
||||
IntSlash : IP -> Slash -> QCl ; -- "whom does John see"
|
||||
QuestAdv : IAdv -> Cl -> QCl ; -- "why do you walk"
|
||||
|
||||
PosImpVP, NegImpVP : VCl -> 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 ; -- "John walks in the park"
|
||||
AdvVPI : VPI -> Adv -> VPI ; -- "walk in the park"
|
||||
AdCPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
||||
AdvPhr : Adv -> S -> Phr ; -- "In India, there are tigers."
|
||||
|
||||
--!
|
||||
--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"
|
||||
ConjAdv : Conj -> ListAdv -> Adv ; -- "quickly or slowly"
|
||||
|
||||
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"
|
||||
ConjDAdv : ConjD -> ListAdv -> Adv ; -- "both badly and slowly"
|
||||
|
||||
TwoS : S -> S -> ListS ;
|
||||
ConsS : ListS -> S -> ListS ;
|
||||
|
||||
TwoAP : AP -> AP -> ListAP ;
|
||||
ConsAP : ListAP -> AP -> ListAP ;
|
||||
|
||||
TwoNP : NP -> NP -> ListNP ;
|
||||
ConsNP : ListNP -> NP -> ListNP ;
|
||||
|
||||
TwoAdv : Adv -> Adv -> ListAdv ;
|
||||
ConsAdv : ListAdv -> Adv -> ListAdv ;
|
||||
|
||||
--!
|
||||
--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?"
|
||||
|
||||
-- This rule makes a subordinate clause into a sentence adverb, which
|
||||
-- can be attached to e.g. noun phrases. It might even replace the
|
||||
-- previous subjunction rules.
|
||||
|
||||
AdvSubj : Subj -> S -> Adv ; -- "when he arrives"
|
||||
|
||||
--!
|
||||
--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?"
|
||||
PhrVPI : VPI -> Phr ; -- "Tända ljus."
|
||||
|
||||
--!
|
||||
--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.
|
||||
|
||||
ExistCN : CN -> Cl ; -- "there is a bar"
|
||||
ExistNumCN : Num -> CN -> Cl ; -- "there are (86) bars"
|
||||
|
||||
OneNP : NP ; -- "one (walks)"
|
||||
|
||||
} ;
|
||||
49
lib/resource-0.9/abstract/Sats.gf
Normal file
49
lib/resource-0.9/abstract/Sats.gf
Normal file
@@ -0,0 +1,49 @@
|
||||
--1 Topological structure of Scandinavian sentences.
|
||||
--
|
||||
-- This is an alternative, more 'native' analysis than $Clause$ and
|
||||
-- $Verbphrase$, due to Diderichsen.
|
||||
--
|
||||
-- Sources:
|
||||
-- N. Jörgensen & J. Svensson, "Nusvensk grammatik" (Gleerups, 2001);
|
||||
-- R. Zola Christensen, "Dansk grammatik for svenskere"
|
||||
-- (Studentlitteratur 1999).
|
||||
|
||||
abstract Sats = Categories ** {
|
||||
|
||||
-- Idea: form primarily a $Sats$, which can then be lifted to a $Cl$
|
||||
-- and used elsewhere in grammar.
|
||||
|
||||
cat Sats ;
|
||||
|
||||
fun
|
||||
ClSats : Sats -> Cl ;
|
||||
|
||||
-- There will be $Sats$-forming functions for all subcategorization
|
||||
-- patterns of verbs.
|
||||
|
||||
SatsV : NP -> V -> Sats ;
|
||||
SatsV2 : NP -> V2 -> NP -> Sats ;
|
||||
SatsV3 : NP -> V3 -> NP -> NP -> Sats ;
|
||||
SatsReflV2 : NP -> V2 -> Sats ;
|
||||
SatsVS : NP -> VS -> S -> Sats ;
|
||||
SatsVQ : NP -> VQ -> QS -> Sats ;
|
||||
SatsV2S : NP -> V2S -> NP -> S -> Sats ;
|
||||
SatsV2Q : NP -> V2Q -> NP -> QS -> Sats ;
|
||||
|
||||
SatsAP : NP -> AP -> Sats ;
|
||||
SatsCN : NP -> CN -> Sats ;
|
||||
SatsNP : NP -> NP -> Sats ;
|
||||
SatsAdv : NP -> Adv -> Sats ;
|
||||
|
||||
-- To a $Sats$, you can insert a sentence adverbial ($AdV$, e.g. "ändå") or
|
||||
-- 'TSR' adverbial ($Adv$, e.g. "nu"; the name TSR is from Jörgensen
|
||||
-- and Svensson).
|
||||
|
||||
AdVSats : Sats -> AdV -> Sats ;
|
||||
AdvSats : Sats -> Adv -> Sats ;
|
||||
|
||||
-- We can also insert a verb-complement verb.
|
||||
|
||||
VVSats : Sats -> VV -> Sats ;
|
||||
|
||||
}
|
||||
41
lib/resource-0.9/abstract/Simple.gf
Normal file
41
lib/resource-0.9/abstract/Simple.gf
Normal file
@@ -0,0 +1,41 @@
|
||||
abstract Simple = Categories ** {
|
||||
|
||||
cat
|
||||
|
||||
Sentence ;
|
||||
|
||||
fun
|
||||
|
||||
PAffirm : Sentence -> Phr ;
|
||||
PNegate : Sentence -> Phr ;
|
||||
PQuestion : Sentence -> Phr ;
|
||||
PCommand : Imp -> Phr ;
|
||||
|
||||
SVerb : NP -> V -> Sentence ;
|
||||
STransVerb : NP -> V2 -> NP -> Sentence ;
|
||||
SAdjective : NP -> AP -> Sentence ;
|
||||
SAdverb : NP -> Adv -> Sentence ;
|
||||
|
||||
SModified : Sentence -> Adv -> Sentence ;
|
||||
|
||||
PIntV : IP -> V -> Phr ;
|
||||
PIntSubjV2 : IP -> V2 -> NP -> Phr ;
|
||||
PIntObjV2 : IP -> NP -> V2 -> Phr ;
|
||||
PIntAP : IP -> AP -> Phr ;
|
||||
PIntAdv : IP -> Adv -> Phr ;
|
||||
|
||||
NPDef : CN -> NP ;
|
||||
NPIndef : CN -> NP ;
|
||||
NPGroup : CN -> NP ;
|
||||
NPMass : CN -> NP ;
|
||||
NPName : PN -> NP ;
|
||||
|
||||
NSimple : N -> CN ;
|
||||
NModified : AP -> CN -> CN ;
|
||||
|
||||
ASimple : ADeg -> AP ;
|
||||
AVery : ADeg -> AP ;
|
||||
|
||||
AdvPrep : Prep -> NP -> Adv ;
|
||||
|
||||
}
|
||||
6
lib/resource-0.9/abstract/SimpleAux.gf
Normal file
6
lib/resource-0.9/abstract/SimpleAux.gf
Normal file
@@ -0,0 +1,6 @@
|
||||
resource SimpleAux = {
|
||||
|
||||
param
|
||||
SentenceForm = SAffirm | SNegate | SQuestion ;
|
||||
|
||||
}
|
||||
73
lib/resource-0.9/abstract/SimpleI.gf
Normal file
73
lib/resource-0.9/abstract/SimpleI.gf
Normal file
@@ -0,0 +1,73 @@
|
||||
incomplete concrete SimpleI of Simple =
|
||||
open Predef, Prelude, SimpleAux, Categories, Rules, Structural, Verbphrase in {
|
||||
|
||||
lincat
|
||||
|
||||
Sentence = {s : SentenceForm => Str} ;
|
||||
|
||||
lin
|
||||
PAffirm sent = ss (sent.s ! SAffirm) ** {lock_Phr = <>} ;
|
||||
PNegate sent = ss (sent.s ! SNegate) ** {lock_Phr = <>} ;
|
||||
PQuestion sent = ss (sent.s ! SQuestion) ** {lock_Phr = <>} ;
|
||||
PCommand = ImperOne ;
|
||||
|
||||
SVerb np v = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (UseV v))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (UseV v))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(UseV v))))
|
||||
}
|
||||
} ;
|
||||
|
||||
STransVerb np tv obj = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (ComplV2 tv obj))) ;
|
||||
SNegate => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (ComplV2 tv obj))) ;
|
||||
SQuestion =>
|
||||
toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np (ComplV2 tv obj))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SAdjective np ap = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (PredAP ap))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (PredAP ap))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(PredAP ap))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SAdverb np ap = {s = table {
|
||||
SAffirm => toStr S (UseCl (PosTP TPresent ASimul) (PredVP np (PredAdv ap))) ;
|
||||
SNegate => toStr S (UseCl (NegTP TPresent ASimul) (PredVP np (PredAdv ap))) ;
|
||||
SQuestion => toStr QS (UseQCl (PosTP TPresent ASimul) (QuestCl (PredVP np
|
||||
(PredAdv ap))))
|
||||
}
|
||||
} ;
|
||||
|
||||
SModified s a = {s = \\f => s.s ! f ++ a.s ; lock_S = <>} ; ---
|
||||
|
||||
PIntV ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (UseV v))) ;
|
||||
PIntSubjV2 ip v np =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (ComplV2 v np))) ;
|
||||
PIntObjV2 ip np v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntSlash ip (SlashV2 np v))) ;
|
||||
PIntAP ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (PredAP v))) ;
|
||||
PIntAdv ip v =
|
||||
QuestPhrase (UseQCl (PosTP TPresent ASimul) (IntVP ip (PredAdv v))) ;
|
||||
|
||||
NPDef = DefOneNP ;
|
||||
NPIndef = IndefOneNP ;
|
||||
NPGroup = IndefNumNP NoNum ;
|
||||
NPMass = MassNP ;
|
||||
NPName = UsePN ;
|
||||
|
||||
NSimple = UseN ;
|
||||
NModified = ModAP ;
|
||||
|
||||
ASimple = PositADeg ;
|
||||
AVery a = AdvAP very_Adv (PositADeg a) ;
|
||||
|
||||
AdvPrep p np = AdvPP (PrepNP p np) ;
|
||||
|
||||
}
|
||||
26
lib/resource-0.9/abstract/SimpleLang.gf
Normal file
26
lib/resource-0.9/abstract/SimpleLang.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
--# -path=.:../../prelude
|
||||
|
||||
abstract SimpleLang =
|
||||
Simple,
|
||||
Structural,
|
||||
Basic,
|
||||
Time,
|
||||
Country
|
||||
|
||||
** {
|
||||
fun
|
||||
|
||||
-- Mount $Time$.
|
||||
|
||||
AdvDate : Date -> Adv ;
|
||||
AdvTime : Time -> Adv ;
|
||||
NWeekday : Weekday -> N ;
|
||||
PNWeekday : Weekday -> PN ;
|
||||
|
||||
-- Mount $Country$.
|
||||
|
||||
PNCountry : Country -> PN ;
|
||||
ANationality : Nationality -> A ;
|
||||
NLanguage : Language -> N ;
|
||||
|
||||
}
|
||||
103
lib/resource-0.9/abstract/Structural.gf
Normal file
103
lib/resource-0.9/abstract/Structural.gf
Normal file
@@ -0,0 +1,103 @@
|
||||
--1 GF Resource Grammar API for Structural Words
|
||||
--
|
||||
-- AR 21/11/2003
|
||||
--
|
||||
-- Here we have some words belonging to closed classes and appearing
|
||||
-- in all languages we have considered.
|
||||
-- Sometimes they are not really meaningful, e.g. $we_NP$ in Spanish
|
||||
-- should be replaced by masculine and feminine variants.
|
||||
|
||||
abstract Structural = Categories, Numerals ** {
|
||||
|
||||
fun
|
||||
|
||||
-- First mount the numerals.
|
||||
|
||||
UseNumeral : Numeral-> Num ;
|
||||
|
||||
-- Then an alphabetical list of structural words
|
||||
|
||||
above_Prep : Prep ;
|
||||
after_Prep : Prep ;
|
||||
all8mass_Det : Det ;
|
||||
all_NDet : NDet ;
|
||||
almost_Adv : AdA ;
|
||||
although_Subj : Subj ;
|
||||
and_Conj : Conj ;
|
||||
because_Subj : Subj ;
|
||||
before_Prep : Prep ;
|
||||
behind_Prep : Prep ;
|
||||
between_Prep : Prep ;
|
||||
both_AndConjD : ConjD ;
|
||||
by8agent_Prep : Prep ;
|
||||
by8means_Prep : Prep ;
|
||||
can8know_VV : VV ;
|
||||
can_VV : VV ;
|
||||
during_Prep : Prep ;
|
||||
either8or_ConjD : ConjD ;
|
||||
every_Det : Det ;
|
||||
everybody_NP : NP ;
|
||||
everything_NP : NP ;
|
||||
everywhere_Adv : Adv ;
|
||||
from_Prep : Prep ;
|
||||
he_NP : NP ;
|
||||
how_IAdv : IAdv ;
|
||||
how8many_IDet : IDet ;
|
||||
i_NP : NP ;
|
||||
if_Subj : Subj ;
|
||||
in8front_Prep : Prep ;
|
||||
in_Prep : Prep ;
|
||||
it_NP : NP ;
|
||||
many_Det : Det ;
|
||||
most_Det : Det ;
|
||||
most8many_Det : Det ;
|
||||
much_Det : Det ;
|
||||
must_VV : VV ;
|
||||
no_Phr : Phr ;
|
||||
on_Prep : Prep ;
|
||||
or_Conj : Conj ;
|
||||
otherwise_Adv : AdC ;
|
||||
part_Prep : Prep ;
|
||||
possess_Prep : Prep ;
|
||||
quite_Adv : AdA ;
|
||||
she_NP : NP ;
|
||||
so_Adv : AdA ;
|
||||
some_Det : Det ;
|
||||
some_NDet : NDet ;
|
||||
somebody_NP : NP ;
|
||||
something_NP : NP ;
|
||||
somewhere_Adv : Adv ;
|
||||
that_Det : Det ;
|
||||
that_NP : NP ;
|
||||
therefore_Adv : AdC ;
|
||||
these_NDet : NDet ;
|
||||
they8fem_NP : NP ;
|
||||
they_NP : NP ;
|
||||
this_Det : Det ;
|
||||
this_NP : NP ;
|
||||
those_NDet : NDet ;
|
||||
thou_NP : NP ;
|
||||
through_Prep : Prep ;
|
||||
to_Prep : Prep ;
|
||||
too_Adv : AdA ;
|
||||
under_Prep : Prep ;
|
||||
very_Adv : AdA ;
|
||||
want_VV : VV ;
|
||||
we_NP : NP ;
|
||||
what8many_IP : IP ;
|
||||
what8one_IP : IP ;
|
||||
when_IAdv : IAdv ;
|
||||
when_Subj : Subj ;
|
||||
where_IAdv : IAdv ;
|
||||
which8many_IDet : IDet ;
|
||||
which8one_IDet : IDet ;
|
||||
who8many_IP : IP ;
|
||||
who8one_IP : IP ;
|
||||
why_IAdv : IAdv ;
|
||||
with_Prep : Prep ;
|
||||
without_Prep : Prep ;
|
||||
ye_NP : NP ;
|
||||
yes_Phr : Phr ;
|
||||
you_NP : NP ;
|
||||
|
||||
}
|
||||
243
lib/resource-0.9/abstract/SwadeshLex.gf
Normal file
243
lib/resource-0.9/abstract/SwadeshLex.gf
Normal file
@@ -0,0 +1,243 @@
|
||||
-- Swadesh 207
|
||||
abstract SwadeshLex = Categories ** {
|
||||
fun
|
||||
|
||||
-- Pronouns
|
||||
|
||||
i_NP : NP ;
|
||||
thou_NP : NP ;
|
||||
he_NP : NP ;
|
||||
we_NP : NP ;
|
||||
you_NP : NP ;
|
||||
they_NP : NP ;
|
||||
who8many_IP : IP ; -- only one who in Swadesh 207
|
||||
who8one_IP : IP ;
|
||||
what8many_IP : IP ; -- only one what in Swadesh 207
|
||||
what8one_IP : IP ;
|
||||
|
||||
-- Determiners
|
||||
|
||||
that_Det : Det ;
|
||||
this_Det : Det ;
|
||||
all_NDet : NDet ;
|
||||
many_Det : Det ;
|
||||
some_Det : Det ;
|
||||
few_Det : Det ;
|
||||
other_Det : Det ;
|
||||
|
||||
-- Adverbs
|
||||
|
||||
here_Adv : Adv ;
|
||||
there_Adv : Adv ;
|
||||
where_IAdv : IAdv ;
|
||||
when_IAdv : IAdv ;
|
||||
how_IAdv : IAdv ;
|
||||
|
||||
-- Conjunctions
|
||||
|
||||
and_Conj : Conj ;
|
||||
|
||||
-- Prepositions
|
||||
|
||||
at_Prep : Prep ;
|
||||
in_Prep : Prep ;
|
||||
with_Prep : Prep ;
|
||||
|
||||
-- not -- ?
|
||||
-- if -- ?
|
||||
-- because -- ?
|
||||
|
||||
-- Numerals
|
||||
|
||||
one_Num : Num ;
|
||||
two_Num : Num ;
|
||||
three_Num : Num ;
|
||||
four_Num : Num ;
|
||||
five_Num : Num ;
|
||||
|
||||
-- Adjectives
|
||||
|
||||
bad_ADeg : ADeg ;
|
||||
big_ADeg : ADeg ;
|
||||
black_ADeg : ADeg ;
|
||||
cold_ADeg : ADeg ;
|
||||
correct_ADeg : ADeg ;
|
||||
dirty_ADeg : ADeg ;
|
||||
dry_ADeg : ADeg ;
|
||||
dull_ADeg : ADeg ;
|
||||
far_ADeg : ADeg ;
|
||||
full_ADeg : ADeg ;
|
||||
good_ADeg : ADeg ;
|
||||
green_ADeg : ADeg ;
|
||||
heavy_ADeg : ADeg ;
|
||||
long_ADeg : ADeg ;
|
||||
narrow_ADeg : ADeg ;
|
||||
near_ADeg : ADeg ;
|
||||
new_ADeg : ADeg ;
|
||||
old_ADeg : ADeg ;
|
||||
red_ADeg : ADeg ;
|
||||
rotten_ADeg : ADeg ;
|
||||
round_ADeg : ADeg ;
|
||||
sharp_ADeg : ADeg ;
|
||||
short_ADeg : ADeg ;
|
||||
small_ADeg : ADeg ;
|
||||
smooth_ADeg : ADeg ;
|
||||
straight_ADeg : ADeg ;
|
||||
thick_ADeg : ADeg ;
|
||||
thin_ADeg : ADeg ;
|
||||
warm_ADeg : ADeg ;
|
||||
wet_ADeg : ADeg ;
|
||||
white_ADeg : ADeg ;
|
||||
wide_ADeg : ADeg ;
|
||||
yellow_ADeg : ADeg ;
|
||||
|
||||
left_A : A ;
|
||||
right_A : A ;
|
||||
|
||||
-- Nouns
|
||||
|
||||
animal_N : N ;
|
||||
ashes_N : N ;
|
||||
back_N : N ;
|
||||
bark_N : N ;
|
||||
belly_N : N ;
|
||||
bird_N : N ;
|
||||
blood_N : N ;
|
||||
bone_N : N ;
|
||||
breast_N : N ;
|
||||
child_N : N ;
|
||||
cloud_N : N ;
|
||||
day_N : N ;
|
||||
dog_N : N ;
|
||||
dust_N : N ;
|
||||
ear_N : N ;
|
||||
earth_N : N ;
|
||||
egg_N : N ;
|
||||
eye_N : N ;
|
||||
fat_N : N ;
|
||||
father_N : N ;
|
||||
feather_N : N ;
|
||||
fingernail_N : N ;
|
||||
fire_N : N ;
|
||||
fish_N : N ;
|
||||
flower_N : N ;
|
||||
fog_N : N ;
|
||||
foot_N : N ;
|
||||
forest_N : N ;
|
||||
fruit_N : N ;
|
||||
grass_N : N ;
|
||||
guts_N : N ;
|
||||
hair_N : N ;
|
||||
hand_N : N ;
|
||||
head_N : N ;
|
||||
heart_N : N ;
|
||||
horn_N : N ;
|
||||
husband_N : N ;
|
||||
ice_N : N ;
|
||||
knee_N : N ;
|
||||
lake_N : N ;
|
||||
leaf_N : N ;
|
||||
leg_N : N ;
|
||||
liver_N : N ;
|
||||
louse_N : N ;
|
||||
man_N : N ;
|
||||
meat_N : N ;
|
||||
moon_N : N ;
|
||||
mother_N : N ;
|
||||
mountain_N : N ;
|
||||
mouth_N : N ;
|
||||
name_N : N ;
|
||||
neck_N : N ;
|
||||
night_N : N ;
|
||||
nose_N : N ;
|
||||
person_N : N ;
|
||||
rain_N : N ;
|
||||
river_N : N ;
|
||||
road_N : N ;
|
||||
root_N : N ;
|
||||
rope_N : N ;
|
||||
salt_N : N ;
|
||||
sand_N : N ;
|
||||
sea_N : N ;
|
||||
seed_N : N ;
|
||||
skin_N : N ;
|
||||
sky_N : N ;
|
||||
smoke_N : N ;
|
||||
snake_N : N ;
|
||||
snow_N : N ;
|
||||
star_N : N ;
|
||||
stick_N : N ;
|
||||
stone_N : N ;
|
||||
sun_N : N ;
|
||||
tail_N : N ;
|
||||
tongue_N : N ;
|
||||
tooth_N : N ;
|
||||
tree_N : N ;
|
||||
water_N : N ;
|
||||
wife_N : N ;
|
||||
wind_N : N ;
|
||||
wing_N : N ;
|
||||
woman_N : N ;
|
||||
worm_N : N ;
|
||||
year_N : N ;
|
||||
|
||||
-- Verbs
|
||||
|
||||
bite_V : V ;
|
||||
blow_V : V ;
|
||||
breathe_V : V ;
|
||||
burn_V : V ;
|
||||
come_V : V ;
|
||||
count_V : V ;
|
||||
cut_V : V ;
|
||||
die_V : V ;
|
||||
dig_V : V ;
|
||||
drink_V : V ;
|
||||
eat_V : V ;
|
||||
fall_V : V ;
|
||||
fear_V : V ;
|
||||
fight_V : V ;
|
||||
float_V : V ;
|
||||
flow_V : V ;
|
||||
fly_V : V ;
|
||||
freeze_V : V ;
|
||||
give_V : V ;
|
||||
hear_V : V ;
|
||||
hit_V : V ;
|
||||
hold_V : V ;
|
||||
hunt_V : V ;
|
||||
kill_V : V ;
|
||||
know_V : V ;
|
||||
laugh_V : V ;
|
||||
lie_V : V ;
|
||||
live_V : V ;
|
||||
play_V : V ;
|
||||
pull_V : V ;
|
||||
push_V : V ;
|
||||
rub_V : V ;
|
||||
say_V : V ;
|
||||
scratch_V : V ;
|
||||
see_V : V ;
|
||||
sew_V : V ;
|
||||
sing_V : V ;
|
||||
sit_V : V ;
|
||||
sleep_V : V ;
|
||||
smell_V : V ;
|
||||
spit_V : V ;
|
||||
split_V : V ;
|
||||
squeeze_V : V ;
|
||||
stab_V : V ;
|
||||
stand_V : V ;
|
||||
suck_V : V ;
|
||||
swell_V : V ;
|
||||
swim_V : V ;
|
||||
think_V : V ;
|
||||
throw_V : V ;
|
||||
tie_V : V ;
|
||||
turn_V : V ;
|
||||
vomit_V : V ;
|
||||
walk_V : V ;
|
||||
wash_V : V ;
|
||||
wipe_V : V ;
|
||||
|
||||
}
|
||||
55
lib/resource-0.9/abstract/Time.gf
Normal file
55
lib/resource-0.9/abstract/Time.gf
Normal file
@@ -0,0 +1,55 @@
|
||||
abstract Time = Numerals ** {
|
||||
|
||||
-- Time grammar Abstract syntax. Modified by AR from Karin Cavallin.
|
||||
|
||||
cat
|
||||
|
||||
Date ;
|
||||
Time ;
|
||||
Hour ;
|
||||
Minute ;
|
||||
Weekday ;
|
||||
|
||||
fun
|
||||
|
||||
-- The variants: "two twenty", "twenty past two", "twenty to two"
|
||||
|
||||
DayDate : Weekday -> Date ;
|
||||
DayTimeDate : Weekday -> Time -> Date ;
|
||||
|
||||
FormalTime : Hour -> Minute -> Time ;
|
||||
PastTime : Hour -> Minute -> Time ;
|
||||
ToTime : Hour -> Minute -> Time ;
|
||||
ExactTime : Hour -> Time ;
|
||||
|
||||
-- These range from 1 to 99 and are thus overgenerating.
|
||||
|
||||
NumHour : Sub100 -> Hour ;
|
||||
NumMinute : Sub100 -> Minute ;
|
||||
|
||||
fun
|
||||
monday : Weekday ;
|
||||
tuesday : Weekday ;
|
||||
wednesday : Weekday ;
|
||||
thursday : Weekday ;
|
||||
friday : Weekday ;
|
||||
saturday : Weekday ;
|
||||
sunday : Weekday ;
|
||||
|
||||
{-
|
||||
Add:
|
||||
|
||||
years
|
||||
|
||||
dates: the x:th of y
|
||||
|
||||
relative weeks: next week, last week, in x weeks, x weeks ago
|
||||
|
||||
relative days: today, tomorrow, yesterday, the day before yesterday,
|
||||
the day after tomorrow, in x days, x days ago
|
||||
|
||||
relative time: in x minutes, in x hours
|
||||
|
||||
-}
|
||||
|
||||
} ;
|
||||
54
lib/resource-0.9/abstract/Verbphrase.gf
Normal file
54
lib/resource-0.9/abstract/Verbphrase.gf
Normal file
@@ -0,0 +1,54 @@
|
||||
--!
|
||||
--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 ** {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
-- These rules produce verb phrases.
|
||||
|
||||
fun
|
||||
UseV : V -> VP ; -- "walks"
|
||||
UsePassV : V -> VP ; -- "is seen"
|
||||
ComplV2 : V2 -> NP -> VP ; -- "sees Mary"
|
||||
ComplV3 : V3 -> NP -> NP -> VP ; -- "tells Mary everything"
|
||||
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"
|
||||
PredCN : CN -> VP ; -- "is a man"
|
||||
PredNP : NP -> VP ; -- "is Bill"
|
||||
PredAdv : Adv -> VP ; -- "is in France", "is here"
|
||||
|
||||
PredProgVP : VPI -> VP ; -- "is eating fish"
|
||||
|
||||
-- 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"
|
||||
|
||||
UseVP : VP -> VCl ; -- to eat, not to eat
|
||||
|
||||
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||
SubjVP : VP -> Subj -> S -> VP ; -- "(a man who) sings when he runs"
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user