mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-24 10:22:50 -06:00
interface for shallow parsing + basic lexicon
This commit is contained in:
195
lib/resource/Basic.txt
Normal file
195
lib/resource/Basic.txt
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
airplane_N
|
||||||
|
answer_V2S
|
||||||
|
apartment_N
|
||||||
|
apple_N
|
||||||
|
art_N
|
||||||
|
ask_V2Q
|
||||||
|
baby_N
|
||||||
|
bad_ADeg
|
||||||
|
bank_N
|
||||||
|
beautiful_ADeg
|
||||||
|
become_VA
|
||||||
|
beer_N
|
||||||
|
beg_VV
|
||||||
|
be_V
|
||||||
|
big_ADeg
|
||||||
|
bike_N
|
||||||
|
bird_N
|
||||||
|
black_ADeg
|
||||||
|
blue_ADeg
|
||||||
|
boat_N
|
||||||
|
book_N
|
||||||
|
boot_N
|
||||||
|
boss_N
|
||||||
|
boy_N
|
||||||
|
bread_N
|
||||||
|
break_V2
|
||||||
|
broad_ADeg
|
||||||
|
brother_N
|
||||||
|
brown_ADeg
|
||||||
|
butter_N
|
||||||
|
buy_V2
|
||||||
|
camera_N
|
||||||
|
cap_N
|
||||||
|
car_N
|
||||||
|
carpet_N
|
||||||
|
cat_N
|
||||||
|
ceiling_N
|
||||||
|
chair_N
|
||||||
|
cheese_N
|
||||||
|
child_N
|
||||||
|
church_N
|
||||||
|
city_N
|
||||||
|
clean_ADeg
|
||||||
|
clever_ADeg
|
||||||
|
close_V2
|
||||||
|
coat_N
|
||||||
|
cold_ADeg
|
||||||
|
come_V
|
||||||
|
computer_N
|
||||||
|
country_N
|
||||||
|
cousin_N
|
||||||
|
cow_N
|
||||||
|
die_V
|
||||||
|
dirty_ADeg
|
||||||
|
doctor_N
|
||||||
|
dog_N
|
||||||
|
door_N
|
||||||
|
drink_V2
|
||||||
|
eat_V2
|
||||||
|
enemy_N
|
||||||
|
factory_N
|
||||||
|
father_N
|
||||||
|
fear_VS
|
||||||
|
find_V2
|
||||||
|
fish_N
|
||||||
|
floor_N
|
||||||
|
forget_V2
|
||||||
|
fridge_N
|
||||||
|
friend_N
|
||||||
|
fruit_N
|
||||||
|
garden_N
|
||||||
|
girl_N
|
||||||
|
glove_N
|
||||||
|
gold_N
|
||||||
|
good_ADeg
|
||||||
|
go_V
|
||||||
|
green_ADeg
|
||||||
|
harbour_N
|
||||||
|
hate_V2
|
||||||
|
hat_N
|
||||||
|
have_V2
|
||||||
|
hear_V2
|
||||||
|
hill_N
|
||||||
|
hope_VS
|
||||||
|
horse_N
|
||||||
|
hot_ADeg
|
||||||
|
house_N
|
||||||
|
important_ADeg
|
||||||
|
industry_N
|
||||||
|
iron_N
|
||||||
|
king_N
|
||||||
|
know_V2
|
||||||
|
lake_N
|
||||||
|
lamp_N
|
||||||
|
learn_V2
|
||||||
|
leather_N
|
||||||
|
leave_V2
|
||||||
|
like_V2
|
||||||
|
listen_V2
|
||||||
|
live_V
|
||||||
|
long_ADeg
|
||||||
|
lose_V2
|
||||||
|
love_N
|
||||||
|
love_V2
|
||||||
|
man_N
|
||||||
|
meat_N
|
||||||
|
milk_N
|
||||||
|
moon_N
|
||||||
|
mother_N
|
||||||
|
mountain_N
|
||||||
|
music_N
|
||||||
|
narrow_ADeg
|
||||||
|
new_ADeg
|
||||||
|
newspaper_N
|
||||||
|
oil_N
|
||||||
|
old_ADeg
|
||||||
|
open_V2
|
||||||
|
paper_N
|
||||||
|
peace_N
|
||||||
|
pen_N
|
||||||
|
planet_N
|
||||||
|
plastic_N
|
||||||
|
play_V2
|
||||||
|
policeman_N
|
||||||
|
priest_N
|
||||||
|
queen_N
|
||||||
|
radio_N
|
||||||
|
read_V2
|
||||||
|
red_ADeg
|
||||||
|
religion_N
|
||||||
|
restaurant_N
|
||||||
|
river_N
|
||||||
|
rock_N
|
||||||
|
roof_N
|
||||||
|
rubber_N
|
||||||
|
run_V
|
||||||
|
say_VS
|
||||||
|
school_N
|
||||||
|
science_N
|
||||||
|
sea_N
|
||||||
|
seek_V2
|
||||||
|
see_V2
|
||||||
|
sell_V3
|
||||||
|
send_V3
|
||||||
|
sheep_N
|
||||||
|
ship_N
|
||||||
|
shirt_N
|
||||||
|
shoe_N
|
||||||
|
shop_N
|
||||||
|
short_ADeg
|
||||||
|
silver_N
|
||||||
|
sister_N
|
||||||
|
sleep_V
|
||||||
|
small_ADeg
|
||||||
|
snake_N
|
||||||
|
sock_N
|
||||||
|
speak_V2
|
||||||
|
star_N
|
||||||
|
steel_N
|
||||||
|
stone_N
|
||||||
|
stove_N
|
||||||
|
student_N
|
||||||
|
stupid_ADeg
|
||||||
|
sun_N
|
||||||
|
switch8off_V
|
||||||
|
switch8on_V
|
||||||
|
table_N
|
||||||
|
teacher_N
|
||||||
|
teach_V2
|
||||||
|
television_N
|
||||||
|
thick_ADeg
|
||||||
|
thin_ADeg
|
||||||
|
train_N
|
||||||
|
travel_V
|
||||||
|
tree_N
|
||||||
|
trousers_N
|
||||||
|
ugly_ADeg
|
||||||
|
understand_V2
|
||||||
|
university_N
|
||||||
|
village_N
|
||||||
|
wait_V2
|
||||||
|
walk_V
|
||||||
|
warm_ADeg
|
||||||
|
war_N
|
||||||
|
watch_V2
|
||||||
|
water_N
|
||||||
|
white_ADeg
|
||||||
|
window_N
|
||||||
|
wine_N
|
||||||
|
win_V2
|
||||||
|
woman_N
|
||||||
|
wood_N
|
||||||
|
write_V2
|
||||||
|
yellow_ADeg
|
||||||
|
young_ADeg
|
||||||
37
lib/resource/MkLexicon.hs
Normal file
37
lib/resource/MkLexicon.hs
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
module MkLexicon where
|
||||||
|
|
||||||
|
import Char
|
||||||
|
|
||||||
|
allLines o f = do
|
||||||
|
s <- readFile f
|
||||||
|
mapM_ (putStrLn . o) (filter noComm (lines s))
|
||||||
|
|
||||||
|
|
||||||
|
-- discard comments and empty lines
|
||||||
|
|
||||||
|
noComm s = case s of
|
||||||
|
'-':'-':_ -> False
|
||||||
|
"" -> False
|
||||||
|
_ -> True
|
||||||
|
|
||||||
|
-- postfix with category
|
||||||
|
|
||||||
|
postfix p s = takeWhile (not . isSpace) s ++ "_" ++ p
|
||||||
|
|
||||||
|
-- make fun rule
|
||||||
|
|
||||||
|
mkFun s =
|
||||||
|
let (w,p) = span (/='_') s in
|
||||||
|
" " ++ s ++ " : " ++ tail p ++ " ;"
|
||||||
|
|
||||||
|
-- make regular lin rule
|
||||||
|
|
||||||
|
mkLin s =
|
||||||
|
let (w,p) = span (/='_') s in
|
||||||
|
" " ++ s ++ " = " ++ lin (tail p) w ++ " ;"
|
||||||
|
where
|
||||||
|
lin cat w = case cat of
|
||||||
|
"V2" -> "dirV2 (regV" ++ " \"" ++ w ++ "\")"
|
||||||
|
'V':_ -> "mk" ++ cat ++ " (regV" ++ " \"" ++ w ++ "\")"
|
||||||
|
_ -> "reg" ++ cat ++ " \"" ++ w ++ "\""
|
||||||
|
|
||||||
198
lib/resource/abstract/Basic.gf
Normal file
198
lib/resource/abstract/Basic.gf
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
abstract Basic = Shallow ** {
|
||||||
|
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_VV : VV ;
|
||||||
|
be_V : V ;
|
||||||
|
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_N : N ;
|
||||||
|
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 ;
|
||||||
|
doctor_N : N ;
|
||||||
|
dog_N : N ;
|
||||||
|
door_N : N ;
|
||||||
|
drink_V2 : V2 ;
|
||||||
|
eat_V2 : V2 ;
|
||||||
|
enemy_N : N ;
|
||||||
|
factory_N : N ;
|
||||||
|
father_N : N ;
|
||||||
|
fear_VS : VS ;
|
||||||
|
find_V2 : V2 ;
|
||||||
|
fish_N : N ;
|
||||||
|
floor_N : N ;
|
||||||
|
forget_V2 : V2 ;
|
||||||
|
fridge_N : N ;
|
||||||
|
friend_N : N ;
|
||||||
|
fruit_N : N ;
|
||||||
|
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 ;
|
||||||
|
meat_N : N ;
|
||||||
|
milk_N : N ;
|
||||||
|
moon_N : N ;
|
||||||
|
mother_N : N ;
|
||||||
|
mountain_N : N ;
|
||||||
|
music_N : N ;
|
||||||
|
narrow_ADeg : ADeg ;
|
||||||
|
new_ADeg : ADeg ;
|
||||||
|
newspaper_N : N ;
|
||||||
|
oil_N : N ;
|
||||||
|
old_ADeg : ADeg ;
|
||||||
|
open_V2 : V2 ;
|
||||||
|
paper_N : N ;
|
||||||
|
peace_N : N ;
|
||||||
|
pen_N : N ;
|
||||||
|
planet_N : N ;
|
||||||
|
plastic_N : N ;
|
||||||
|
play_V2 : V2 ;
|
||||||
|
policeman_N : N ;
|
||||||
|
priest_N : N ;
|
||||||
|
queen_N : N ;
|
||||||
|
radio_N : N ;
|
||||||
|
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_V : V ;
|
||||||
|
switch8on_V : V ;
|
||||||
|
table_N : N ;
|
||||||
|
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 ;
|
||||||
|
wood_N : N ;
|
||||||
|
write_V2 : V2 ;
|
||||||
|
yellow_ADeg : ADeg ;
|
||||||
|
young_ADeg : ADeg ;
|
||||||
|
}
|
||||||
@@ -105,9 +105,10 @@ cat
|
|||||||
--3 Adverbs and prepositions/cases
|
--3 Adverbs and prepositions/cases
|
||||||
--
|
--
|
||||||
|
|
||||||
Adv ; -- adverbial e.g. "now", "in the house"
|
Adv ; -- sentence adverb e.g. "now", "in the house"
|
||||||
|
AdV ; -- verb adverb e.g. "always"
|
||||||
AdA ; -- ad-adjective e.g. "very"
|
AdA ; -- ad-adjective e.g. "very"
|
||||||
AdS ; -- sentence adverbial e.g. "therefore", "otherwise"
|
AdC ; -- conjoining adverb e.g. "therefore", "otherwise"
|
||||||
PP ; -- prepositional phrase e.g. "in London"
|
PP ; -- prepositional phrase e.g. "in London"
|
||||||
Prep ; -- pre/postposition, case e.g. "after", Adessive
|
Prep ; -- pre/postposition, case e.g. "after", Adessive
|
||||||
|
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ fun
|
|||||||
AdvPP : PP -> Adv ; -- "in London", "after the war"
|
AdvPP : PP -> Adv ; -- "in London", "after the war"
|
||||||
PrepNP : Prep -> NP -> PP ; -- "in London", "after the war"
|
PrepNP : Prep -> NP -> PP ; -- "in London", "after the war"
|
||||||
|
|
||||||
AdvVP : VP -> Adv -> VP ; -- "always walks", "walks in the park"
|
AdvVP : VP -> AdV -> VP ; -- "always walks"
|
||||||
AdvCN : CN -> PP -> CN ; -- "house in London"
|
AdvCN : CN -> PP -> CN ; -- "house in London"
|
||||||
AdvAP : AdA -> AP -> AP ; -- "very good"
|
AdvAP : AdA -> AP -> AP ; -- "very good"
|
||||||
|
|
||||||
@@ -178,8 +178,8 @@ fun
|
|||||||
QuestPhrase : QS -> Phr ; -- "Do I walk?"
|
QuestPhrase : QS -> Phr ; -- "Do I walk?"
|
||||||
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
ImperOne, ImperMany : Imp -> Phr ; -- "Be a man!", "Be men!"
|
||||||
|
|
||||||
PrepS : PP -> AdS ; -- "in Sweden, (there are bears)"
|
AdvCl : Cl -> Adv -> Cl ; -- "John walks in the park"
|
||||||
AdvS : AdS -> S -> Phr ; -- "Therefore, 2 is prime."
|
AdvPhr : AdC -> S -> Phr ; -- "Therefore, 2 is prime."
|
||||||
|
|
||||||
--!
|
--!
|
||||||
--3 Coordination
|
--3 Coordination
|
||||||
|
|||||||
435
lib/resource/abstract/Shallow.gf
Normal file
435
lib/resource/abstract/Shallow.gf
Normal file
@@ -0,0 +1,435 @@
|
|||||||
|
--!
|
||||||
|
--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"
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
200
lib/resource/abstract/ShallowI.gf
Normal file
200
lib/resource/abstract/ShallowI.gf
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
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 ;
|
||||||
|
}
|
||||||
@@ -56,7 +56,7 @@ fun
|
|||||||
EverywhereNP, SomewhereNP,NowhereNP : Adv ; -- everywhere, somewhere, nowhere
|
EverywhereNP, SomewhereNP,NowhereNP : Adv ; -- everywhere, somewhere, nowhere
|
||||||
VeryAdv, TooAdv : AdA ; -- very, too
|
VeryAdv, TooAdv : AdA ; -- very, too
|
||||||
AlmostAdv, QuiteAdv : AdA ; -- almost, quite
|
AlmostAdv, QuiteAdv : AdA ; -- almost, quite
|
||||||
OtherwiseAdv, ThereforeAdv : AdS ; -- therefore, otherwise
|
OtherwiseAdv, ThereforeAdv : AdC ; -- therefore, otherwise
|
||||||
|
|
||||||
--!
|
--!
|
||||||
--2 Conjunctions and subjunctions
|
--2 Conjunctions and subjunctions
|
||||||
|
|||||||
203
lib/resource/english/BasicEng.gf
Normal file
203
lib/resource/english/BasicEng.gf
Normal file
@@ -0,0 +1,203 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete BasicEng of Basic = ShallowEng ** open NewParadigmsEng in {
|
||||||
|
|
||||||
|
flags startcat=Phr ; lexer=textlit ; parser=chart ; unlexer=text ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
airplane_N = regN "airplane" ;
|
||||||
|
--- answer_V2S = mkV2S (regV "answer") ;
|
||||||
|
apartment_N = regN "apartment" ;
|
||||||
|
apple_N = regN "apple" ;
|
||||||
|
art_N = regN "art" ;
|
||||||
|
---- 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") ;
|
||||||
|
beer_N = regN "beer" ;
|
||||||
|
---- beg_VV = mkVV (regV "beg") ;
|
||||||
|
---- be_V = (regV "be") ;
|
||||||
|
big_ADeg = regADeg "big" ;
|
||||||
|
bike_N = regN "bike" ;
|
||||||
|
bird_N = regN "bird" ;
|
||||||
|
black_ADeg = regADeg "black" ;
|
||||||
|
blue_ADeg = regADeg "blue" ;
|
||||||
|
boat_N = regN "boat" ;
|
||||||
|
book_N = regN "book" ;
|
||||||
|
boot_N = regN "boot" ;
|
||||||
|
boss_N = regN "boss" ;
|
||||||
|
boy_N = regN "boy" ;
|
||||||
|
bread_N = regN "bread" ;
|
||||||
|
break_V2 = dirV2 (regV "break") ;
|
||||||
|
broad_ADeg = regADeg "broad" ;
|
||||||
|
brother_N = regN "brother" ;
|
||||||
|
brown_ADeg = regADeg "brown" ;
|
||||||
|
butter_N = regN "butter" ;
|
||||||
|
buy_V2 = dirV2 (regV "buy") ;
|
||||||
|
camera_N = regN "camera" ;
|
||||||
|
cap_N = regN "cap" ;
|
||||||
|
car_N = regN "car" ;
|
||||||
|
carpet_N = regN "carpet" ;
|
||||||
|
cat_N = regN "cat" ;
|
||||||
|
ceiling_N = regN "ceiling" ;
|
||||||
|
chair_N = regN "chair" ;
|
||||||
|
cheese_N = regN "cheese" ;
|
||||||
|
child_N = regN "child" ;
|
||||||
|
church_N = regN "church" ;
|
||||||
|
city_N = regN "city" ;
|
||||||
|
clean_ADeg = regADeg "clean" ;
|
||||||
|
clever_ADeg = regADeg "clever" ;
|
||||||
|
close_V2 = dirV2 (regV "close") ;
|
||||||
|
coat_N = regN "coat" ;
|
||||||
|
cold_ADeg = regADeg "cold" ;
|
||||||
|
come_V = (regV "come") ;
|
||||||
|
computer_N = regN "computer" ;
|
||||||
|
country_N = regN "country" ;
|
||||||
|
cousin_N = regN "cousin" ;
|
||||||
|
cow_N = regN "cow" ;
|
||||||
|
die_V = (regV "die") ;
|
||||||
|
dirty_ADeg = regADeg "dirty" ;
|
||||||
|
doctor_N = regN "doctor" ;
|
||||||
|
dog_N = regN "dog" ;
|
||||||
|
door_N = regN "door" ;
|
||||||
|
drink_V2 = dirV2 (regV "drink") ;
|
||||||
|
eat_V2 = dirV2 (regV "eat") ;
|
||||||
|
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" ;
|
||||||
|
floor_N = regN "floor" ;
|
||||||
|
forget_V2 = dirV2 (regV "forget") ;
|
||||||
|
fridge_N = regN "fridge" ;
|
||||||
|
friend_N = regN "friend" ;
|
||||||
|
fruit_N = regN "fruit" ;
|
||||||
|
garden_N = regN "garden" ;
|
||||||
|
girl_N = regN "girl" ;
|
||||||
|
glove_N = regN "glove" ;
|
||||||
|
gold_N = regN "gold" ;
|
||||||
|
good_ADeg = regADeg "good" ;
|
||||||
|
go_V = (regV "go") ;
|
||||||
|
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") ;
|
||||||
|
hill_N = regN "hill" ;
|
||||||
|
---- hope_VS = mkVS (regV "hope") ;
|
||||||
|
horse_N = regN "horse" ;
|
||||||
|
hot_ADeg = regADeg "hot" ;
|
||||||
|
house_N = regN "house" ;
|
||||||
|
important_ADeg = regADeg "important" ;
|
||||||
|
industry_N = regN "industry" ;
|
||||||
|
iron_N = regN "iron" ;
|
||||||
|
king_N = regN "king" ;
|
||||||
|
know_V2 = dirV2 (regV "know") ;
|
||||||
|
lake_N = regN "lake" ;
|
||||||
|
lamp_N = regN "lamp" ;
|
||||||
|
learn_V2 = dirV2 (regV "learn") ;
|
||||||
|
leather_N = regN "leather" ;
|
||||||
|
leave_V2 = dirV2 (regV "leave") ;
|
||||||
|
like_V2 = dirV2 (regV "like") ;
|
||||||
|
listen_V2 = dirV2 (regV "listen") ;
|
||||||
|
live_V = (regV "live") ;
|
||||||
|
long_ADeg = regADeg "long" ;
|
||||||
|
lose_V2 = dirV2 (regV "lose") ;
|
||||||
|
love_N = regN "love" ;
|
||||||
|
love_V2 = dirV2 (regV "love") ;
|
||||||
|
man_N = regN "man" ;
|
||||||
|
meat_N = regN "meat" ;
|
||||||
|
milk_N = regN "milk" ;
|
||||||
|
moon_N = regN "moon" ;
|
||||||
|
mother_N = regN "mother" ;
|
||||||
|
mountain_N = regN "mountain" ;
|
||||||
|
music_N = regN "music" ;
|
||||||
|
narrow_ADeg = regADeg "narrow" ;
|
||||||
|
new_ADeg = regADeg "new" ;
|
||||||
|
newspaper_N = regN "newspaper" ;
|
||||||
|
oil_N = regN "oil" ;
|
||||||
|
old_ADeg = regADeg "old" ;
|
||||||
|
open_V2 = dirV2 (regV "open") ;
|
||||||
|
paper_N = regN "paper" ;
|
||||||
|
peace_N = regN "peace" ;
|
||||||
|
pen_N = regN "pen" ;
|
||||||
|
planet_N = regN "planet" ;
|
||||||
|
plastic_N = regN "plastic" ;
|
||||||
|
play_V2 = dirV2 (regV "play") ;
|
||||||
|
policeman_N = regN "policeman" ;
|
||||||
|
priest_N = regN "priest" ;
|
||||||
|
queen_N = regN "queen" ;
|
||||||
|
radio_N = regN "radio" ;
|
||||||
|
read_V2 = dirV2 (regV "read") ;
|
||||||
|
red_ADeg = regADeg "red" ;
|
||||||
|
religion_N = regN "religion" ;
|
||||||
|
restaurant_N = regN "restaurant" ;
|
||||||
|
river_N = regN "river" ;
|
||||||
|
rock_N = regN "rock" ;
|
||||||
|
roof_N = regN "roof" ;
|
||||||
|
rubber_N = regN "rubber" ;
|
||||||
|
run_V = (regV "run") ;
|
||||||
|
---- say_VS = mkVS (regV "say") ;
|
||||||
|
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" ;
|
||||||
|
ship_N = regN "ship" ;
|
||||||
|
shirt_N = regN "shirt" ;
|
||||||
|
shoe_N = regN "shoe" ;
|
||||||
|
shop_N = regN "shop" ;
|
||||||
|
short_ADeg = regADeg "short" ;
|
||||||
|
silver_N = regN "silver" ;
|
||||||
|
sister_N = regN "sister" ;
|
||||||
|
sleep_V = (regV "sleep") ;
|
||||||
|
small_ADeg = regADeg "small" ;
|
||||||
|
snake_N = regN "snake" ;
|
||||||
|
sock_N = regN "sock" ;
|
||||||
|
speak_V2 = dirV2 (regV "speak") ;
|
||||||
|
star_N = regN "star" ;
|
||||||
|
steel_N = regN "steel" ;
|
||||||
|
stone_N = regN "stone" ;
|
||||||
|
stove_N = regN "stove" ;
|
||||||
|
student_N = regN "student" ;
|
||||||
|
stupid_ADeg = regADeg "stupid" ;
|
||||||
|
sun_N = regN "sun" ;
|
||||||
|
switch8off_V = (regV "switch8off") ;
|
||||||
|
switch8on_V = (regV "switch8on") ;
|
||||||
|
table_N = regN "table" ;
|
||||||
|
teacher_N = regN "teacher" ;
|
||||||
|
teach_V2 = dirV2 (regV "teach") ;
|
||||||
|
television_N = regN "television" ;
|
||||||
|
thick_ADeg = regADeg "thick" ;
|
||||||
|
thin_ADeg = regADeg "thin" ;
|
||||||
|
train_N = regN "train" ;
|
||||||
|
travel_V = (regV "travel") ;
|
||||||
|
tree_N = regN "tree" ;
|
||||||
|
trousers_N = regN "trousers" ;
|
||||||
|
ugly_ADeg = regADeg "ugly" ;
|
||||||
|
understand_V2 = dirV2 (regV "understand") ;
|
||||||
|
university_N = regN "university" ;
|
||||||
|
village_N = regN "village" ;
|
||||||
|
wait_V2 = dirV2 (regV "wait") ;
|
||||||
|
walk_V = (regV "walk") ;
|
||||||
|
warm_ADeg = regADeg "warm" ;
|
||||||
|
war_N = regN "war" ;
|
||||||
|
watch_V2 = dirV2 (regV "watch") ;
|
||||||
|
water_N = regN "water" ;
|
||||||
|
white_ADeg = regADeg "white" ;
|
||||||
|
window_N = regN "window" ;
|
||||||
|
wine_N = regN "wine" ;
|
||||||
|
win_V2 = dirV2 (regV "win") ;
|
||||||
|
woman_N = regN "woman" ;
|
||||||
|
wood_N = regN "wood" ;
|
||||||
|
write_V2 = dirV2 (regV "write") ;
|
||||||
|
yellow_ADeg = regADeg "yellow" ;
|
||||||
|
young_ADeg = regADeg "young" ;
|
||||||
|
} ;
|
||||||
@@ -74,7 +74,10 @@ lincat
|
|||||||
Tense = {s : Str ; t : Tense} ;
|
Tense = {s : Str ; t : Tense} ;
|
||||||
Ant = {s : Str ; a : Anteriority} ;
|
Ant = {s : Str ; a : Anteriority} ;
|
||||||
|
|
||||||
Adv = {s : Str ; p : Bool} ;
|
Adv = {s : Str} ;
|
||||||
|
AdV = {s : Str} ;
|
||||||
|
AdA = {s : Str} ;
|
||||||
|
AdC = {s : Str} ;
|
||||||
|
|
||||||
S = {s : Str} ;
|
S = {s : Str} ;
|
||||||
Cl = Clause ;
|
Cl = Clause ;
|
||||||
|
|||||||
@@ -17,13 +17,13 @@ resource MorphoEng = TypesEng ** open Prelude, (Predef=Predef) in {
|
|||||||
|
|
||||||
oper
|
oper
|
||||||
y2ie : Str -> Str -> Str = \fly,s ->
|
y2ie : Str -> Str -> Str = \fly,s ->
|
||||||
let y = last fly in
|
let y = last (init fly) in
|
||||||
case y of {
|
case y of {
|
||||||
"a" => fly + "s" ;
|
"a" => fly + s ;
|
||||||
"e" => fly + "s" ;
|
"e" => fly + s ;
|
||||||
"o" => fly + "s" ;
|
"o" => fly + s ;
|
||||||
"u" => fly + "s" ;
|
"u" => fly + s ;
|
||||||
_ => init fly ++ "ies"
|
_ => init fly + "ie" + s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
@@ -175,17 +175,25 @@ oper
|
|||||||
--
|
--
|
||||||
-- Except for "be", the worst case needs four forms.
|
-- Except for "be", the worst case needs four forms.
|
||||||
|
|
||||||
mkVerbP3 : (_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone ->
|
mkVerbP3worst : (_,_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone,going ->
|
||||||
{s = table {
|
{s = table {
|
||||||
InfImp => go ;
|
InfImp => go ;
|
||||||
Indic P3 => goes ;
|
Indic P3 => goes ;
|
||||||
Indic _ => go ;
|
Indic _ => go ;
|
||||||
Pastt _ => went ;
|
Pastt _ => went ;
|
||||||
PPart => gone ;
|
PPart => gone ;
|
||||||
PresPart => go + "ing" ---- fix!
|
PresPart => going
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
mkVerbP3 : (_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone ->
|
||||||
|
let going = case last go of {
|
||||||
|
"e" => init go + "ing" ;
|
||||||
|
_ => go + "ing"
|
||||||
|
}
|
||||||
|
in
|
||||||
|
mkVerbP3worst go goes went gone going ;
|
||||||
|
|
||||||
-- This is what we use to derive the irregular forms in almost all cases
|
-- This is what we use to derive the irregular forms in almost all cases
|
||||||
|
|
||||||
mkVerbIrreg : (_,_,_ : Str) -> VerbP3 = \bite,bit,bitten ->
|
mkVerbIrreg : (_,_,_ : Str) -> VerbP3 = \bite,bit,bitten ->
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
--
|
--
|
||||||
-- The following modules are presupposed:
|
-- The following modules are presupposed:
|
||||||
|
|
||||||
resource ParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in {
|
resource NewParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in {
|
||||||
|
|
||||||
--2 Parameters
|
--2 Parameters
|
||||||
--
|
--
|
||||||
@@ -35,8 +35,10 @@ resource ParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in
|
|||||||
oper
|
oper
|
||||||
Gender : Type ;
|
Gender : Type ;
|
||||||
|
|
||||||
human : Gender ;
|
human : Gender ;
|
||||||
nonhuman : Gender ;
|
nonhuman : Gender ;
|
||||||
|
masculine : Gender ;
|
||||||
|
feminite : Gender ;
|
||||||
|
|
||||||
-- To abstract over number names, we define the following.
|
-- To abstract over number names, we define the following.
|
||||||
|
|
||||||
@@ -52,28 +54,32 @@ oper
|
|||||||
nominative : Case ;
|
nominative : Case ;
|
||||||
genitive : Case ;
|
genitive : Case ;
|
||||||
|
|
||||||
|
-- Prepositions used in many-argument functions are just strings.
|
||||||
|
|
||||||
|
Preposition : Type = Str ;
|
||||||
|
|
||||||
|
|
||||||
--2 Nouns
|
--2 Nouns
|
||||||
|
|
||||||
|
-- Worst case: give all four forms and the semantic gender.
|
||||||
|
|
||||||
|
mkN : (man,men,man's,men's : Str) -> N ;
|
||||||
|
|
||||||
-- The regular function captures the variants for nouns ending with
|
-- The regular function captures the variants for nouns ending with
|
||||||
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes";
|
||||||
-- "fly - flies" (but "toy - toys"),
|
-- "fly - flies" (but "toy - toys"),
|
||||||
|
|
||||||
regN : Str -> N ;
|
regN : Str -> N ;
|
||||||
|
|
||||||
-- Worst case: give all four forms and the semantic gender.
|
|
||||||
|
|
||||||
mkN : (man,men,man's,men's : Str) -> N ;
|
|
||||||
|
|
||||||
-- In practice the worst case is just: give singular and plural nominative.
|
-- In practice the worst case is just: give singular and plural nominative.
|
||||||
|
|
||||||
manN : (man,men : Str) -> N ;
|
reg2N : (man,men : Str) -> N ;
|
||||||
|
|
||||||
-- All nouns created by the previous functions are marked as
|
-- All nouns created by the previous functions are marked as
|
||||||
-- $nonhuman$. If you want a $human$ noun, wrap it with the following
|
-- $nonhuman$. If you want a $human$ noun, wrap it with the following
|
||||||
-- function:
|
-- function:
|
||||||
|
|
||||||
humanN : N -> N ;
|
genderN : Gender -> N -> N ;
|
||||||
|
|
||||||
--3 Compound nouns
|
--3 Compound nouns
|
||||||
--
|
--
|
||||||
@@ -85,34 +91,40 @@ oper
|
|||||||
--
|
--
|
||||||
-- Relational nouns ("daughter of x") need a preposition.
|
-- Relational nouns ("daughter of x") need a preposition.
|
||||||
|
|
||||||
mkN2 : N -> Prep -> N2 ;
|
mkN2 : N -> Preposition -> N2 ;
|
||||||
|
|
||||||
-- The most common preposition is "of", and the following is a
|
-- The most common preposition is "of", and the following is a
|
||||||
-- shortcut for regulat, $nonhuman$ relational nouns with "of".
|
-- shortcut for regular, $nonhuman$ relational nouns with "of".
|
||||||
|
|
||||||
regN2 : Str -> N2 ;
|
regN2 : Str -> N2 ;
|
||||||
|
|
||||||
-- Use the function $mkPrep$ or see the section on prepositions below to
|
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
||||||
-- form other prepositions.
|
-- form other prepositions.
|
||||||
--
|
--
|
||||||
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||||
|
|
||||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
||||||
|
|
||||||
|
|
||||||
--3 Relational common noun phrases
|
--3 Relational common noun phrases
|
||||||
--
|
--
|
||||||
-- In some cases, you may want to make a complex $CN$ into a
|
-- In some cases, you may want to make a complex $CN$ into a
|
||||||
-- relational noun (e.g. "the old town hall of").
|
-- relational noun (e.g. "the old town hall of").
|
||||||
|
|
||||||
cnN2 : CN -> Prep -> N2 ;
|
cnN2 : CN -> Preposition -> N2 ;
|
||||||
cnN3 : CN -> Prep -> Prep -> N3 ;
|
cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
||||||
|
|
||||||
--
|
--
|
||||||
--3 Proper names
|
--3 Proper names and noun phrases
|
||||||
--
|
--
|
||||||
-- Proper names, with a regular genitive, are formed as follows
|
-- Proper names, with a regular genitive, are formed as follows
|
||||||
|
|
||||||
pnReg : Str -> PN ; -- John, John's
|
regPN : Str -> Gender -> PN ; -- John, John's
|
||||||
|
|
||||||
|
-- To form a noun phrase that can also be plural and have an irregular
|
||||||
|
-- genitive, you can use the worst-case function.
|
||||||
|
|
||||||
|
mkNP : Str -> Str -> Number -> Gender -> NP ;
|
||||||
|
|
||||||
--2 Adjectives
|
--2 Adjectives
|
||||||
|
|
||||||
@@ -130,7 +142,7 @@ oper
|
|||||||
--
|
--
|
||||||
-- Two-place adjectives need a preposition for their second argument.
|
-- Two-place adjectives need a preposition for their second argument.
|
||||||
|
|
||||||
mkA2 : A -> Prep -> A2 ;
|
mkA2 : A -> Preposition -> A2 ;
|
||||||
|
|
||||||
-- Comparison adjectives may two more forms.
|
-- Comparison adjectives may two more forms.
|
||||||
|
|
||||||
@@ -145,7 +157,7 @@ oper
|
|||||||
-- However, the duplication of the final consonant is nor predicted,
|
-- However, the duplication of the final consonant is nor predicted,
|
||||||
-- but a separate pattern is used:
|
-- but a separate pattern is used:
|
||||||
|
|
||||||
fatADeg : Str -> ADeg ; -- fat, fatter, fattest
|
duplADeg : Str -> ADeg ; -- fat, fatter, fattest
|
||||||
|
|
||||||
-- If comparison is formed by "more, "most", as in general for
|
-- If comparison is formed by "more, "most", as in general for
|
||||||
-- long adjective, the following pattern is used:
|
-- long adjective, the following pattern is used:
|
||||||
@@ -162,19 +174,18 @@ oper
|
|||||||
-- Adverbs are not inflected. Most lexical ones have position
|
-- Adverbs are not inflected. Most lexical ones have position
|
||||||
-- after the verb. Some can be preverbal (e.g. "always").
|
-- after the verb. Some can be preverbal (e.g. "always").
|
||||||
|
|
||||||
mkAdv : Str -> Adv ;
|
mkAdv : Str -> Adv ;
|
||||||
preAdv : Str -> Adv ;
|
mkAdV : Str -> AdV ;
|
||||||
|
|
||||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
mkAdA : Str -> AdA ;
|
mkAdA : Str -> AdA ;
|
||||||
mkAdS : Str -> AdS ;
|
|
||||||
|
|
||||||
--2 Prepositions
|
--2 Prepositions
|
||||||
--
|
--
|
||||||
-- A preposition is just a string.
|
-- A preposition is just a string.
|
||||||
|
|
||||||
mkPrep : Str -> Prep ;
|
mkPreposition : Str -> Preposition ;
|
||||||
|
|
||||||
--2 Verbs
|
--2 Verbs
|
||||||
--
|
--
|
||||||
@@ -190,6 +201,11 @@ oper
|
|||||||
|
|
||||||
regV : Str -> V ;
|
regV : Str -> V ;
|
||||||
|
|
||||||
|
-- The following variant duplicates the in consonant in the forms like
|
||||||
|
-- "rip - ripped - ripping".
|
||||||
|
|
||||||
|
regDuplV : Str -> V ;
|
||||||
|
|
||||||
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
-- There is an extensive list of irregular verbs in the module $IrregularEng$.
|
||||||
-- In practice, it is enough to give three forms,
|
-- In practice, it is enough to give three forms,
|
||||||
-- e.g. "drink - drank - drunk", with a variant indicating consonant
|
-- e.g. "drink - drank - drunk", with a variant indicating consonant
|
||||||
@@ -210,7 +226,7 @@ oper
|
|||||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||||
|
|
||||||
mkV2 : V -> Prep -> V2 ;
|
mkV2 : V -> Preposition -> V2 ;
|
||||||
|
|
||||||
dirV2 : V -> V2 ;
|
dirV2 : V -> V2 ;
|
||||||
|
|
||||||
@@ -223,6 +239,7 @@ oper
|
|||||||
dirV3 : V -> Str -> V3 ; -- give,_,to
|
dirV3 : V -> Str -> V3 ; -- give,_,to
|
||||||
dirdirV3 : V -> V3 ; -- give,_,_
|
dirdirV3 : V -> V3 ; -- give,_,_
|
||||||
|
|
||||||
|
|
||||||
--2 Definitions of paradigms
|
--2 Definitions of paradigms
|
||||||
--
|
--
|
||||||
-- The definitions should not bother the user of the API. So they are
|
-- The definitions should not bother the user of the API. So they are
|
||||||
@@ -232,114 +249,130 @@ oper
|
|||||||
Gender = SyntaxEng.Gender ;
|
Gender = SyntaxEng.Gender ;
|
||||||
Number = SyntaxEng.Number ;
|
Number = SyntaxEng.Number ;
|
||||||
Case = SyntaxEng.Case ;
|
Case = SyntaxEng.Case ;
|
||||||
human = Hum ;
|
human = Masc ;
|
||||||
nonhuman = NoHum ;
|
nonhuman = Neutr ;
|
||||||
|
masculine = Masc ;
|
||||||
|
feminine = Fem ;
|
||||||
singular = Sg ;
|
singular = Sg ;
|
||||||
plural = Pl ;
|
plural = Pl ;
|
||||||
nominative = Nom ;
|
nominative = Nom ;
|
||||||
genitive = Gen ;
|
genitive = Gen ;
|
||||||
|
|
||||||
mkN = \man,men,man's,men's,g ->
|
regN = \ray ->
|
||||||
mkNoun man men man's men's ** {g = g ; lock_N = <>} ;
|
let
|
||||||
---
|
ra = Predef.tk 1 ray ;
|
||||||
nReg a g = addGenN nounReg a g ;
|
y = Predef.dp 1 ray ;
|
||||||
nKiss n g = addGenN nounS n g ;
|
r = Predef.tk 2 ray ;
|
||||||
nFly = \fly -> addGenN nounY (Predef.tk 1 fly) ;
|
ay = Predef.dp 2 ray ;
|
||||||
nMan = \man,men -> mkN man men (man + "'s") (men + "'s") ;
|
rays =
|
||||||
nHero = nKiss ;
|
case y of {
|
||||||
nSheep = \sheep -> nMan sheep sheep ;
|
"y" => y2ie ray "s" ;
|
||||||
|
"s" => ray + "es" ;
|
||||||
|
"z" => ray + "es" ;
|
||||||
|
"x" => ray + "es" ;
|
||||||
|
_ => case ay of {
|
||||||
|
"sh" => ray + "es" ;
|
||||||
|
"ch" => ray + "es" ;
|
||||||
|
_ => ray + "s"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
in
|
||||||
|
reg2N ray rays ;
|
||||||
|
|
||||||
nHuman = \s -> nGen s Hum ;
|
reg2N = \man,men ->
|
||||||
nNonhuman = \s -> nGen s NoHum ;
|
let mens = case last men of {
|
||||||
|
"s" => men + "'" ;
|
||||||
|
_ => men + "'s"
|
||||||
|
}
|
||||||
|
in
|
||||||
|
mkN man men (man + "'s") mens ;
|
||||||
|
|
||||||
nGen : Str -> Gender -> N = \fly,g -> let {
|
mkN = \man,men,man's,men's ->
|
||||||
fl = Predef.tk 1 fly ;
|
mkNoun man men man's men's ** {g = Neutr ; lock_N = <>} ;
|
||||||
y = Predef.dp 1 fly ;
|
|
||||||
eqy = ifTok (Str -> Gender -> N) y
|
|
||||||
} in
|
|
||||||
eqy "y" nFly (
|
|
||||||
eqy "s" nKiss (
|
|
||||||
eqy "z" nKiss (
|
|
||||||
nReg))) fly g ;
|
|
||||||
|
|
||||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
genderN g man = {s = man.s ; g = g ; lock_N = <>} ;
|
||||||
funNonhuman = \s -> mkN2 (nNonhuman s) "of" ;
|
|
||||||
funHuman = \s -> mkN2 (nHuman s) "of" ;
|
|
||||||
|
|
||||||
pnReg n = nameReg n ** {lock_PN = <>} ;
|
mkN2 = \n,p -> UseN n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
|
regN2 n = mkN2 (regN n) (mkPreposition "of") ;
|
||||||
|
mkN3 = \n,p,q -> UseN n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
||||||
|
cnN2 = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
||||||
|
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; s2 = p ; s3 = q} ;
|
||||||
|
|
||||||
cnNonhuman = \s -> UseN (nGen s nonhuman) ;
|
regPN n g = nameReg n g ** {lock_PN = <>} ;
|
||||||
cnHuman = \s -> UseN (nGen s human) ;
|
mkNP x y n g = {s = table {GenP => x ; _ => y} ; a = toAgr n P3 g ;
|
||||||
npReg = \s -> UsePN (pnReg s) ;
|
lock_NP = <>} ;
|
||||||
|
|
||||||
mkN2CN = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
mkA a b = mkAdjective a b ** {lock_A = <>} ;
|
||||||
funOfCN = \n -> mkN2CN n "of" ;
|
regA a = regAdjective a ** {lock_A = <>} ;
|
||||||
|
|
||||||
addGenN : (Str -> CommonNoun) -> Str -> Gender -> N = \f ->
|
mkA2 a p = a ** {s2 = p ; lock_A2 = <>} ;
|
||||||
\s,g -> f s ** {g = g ; lock_N = <>} ;
|
|
||||||
|
|
||||||
mkA a = regAdjective a ** {lock_A = <>} ;
|
mkADeg a b c d = mkAdjDegrWorst a b c c d d ** {lock_ADeg = <>} ;
|
||||||
mkA2 = \s,p -> regAdjective s ** {s2 = p} ** {lock_A2 = <>} ;
|
|
||||||
mkADeg a b c = adjDegrIrreg a b c ** {lock_ADeg = <>} ;
|
|
||||||
aReg a = adjDegrReg a ** {lock_ADeg = <>} ;
|
|
||||||
aFat = \fat -> let {fatt = fat + Predef.dp 1 fat} in
|
|
||||||
mkADeg fat (fatt + "er") (fatt + "est") ;
|
|
||||||
aRidiculous a = adjDegrLong a ** {lock_ADeg = <>} ;
|
|
||||||
apReg = \s -> UseA (mkA s) ;
|
|
||||||
|
|
||||||
aGen : Str -> ADeg = \s -> case last s of {
|
regADeg happy =
|
||||||
"y" => mkADeg s (init s + "ier") (init s + "iest") ;
|
let
|
||||||
"e" => mkADeg s (s + "r") (s + "st") ;
|
happ = init happy ;
|
||||||
_ => aReg s
|
y = last happy ;
|
||||||
} ;
|
happie = case y of {
|
||||||
|
"y" => happ + "ie" ;
|
||||||
|
"e" => happy ;
|
||||||
|
_ => happy + "e"
|
||||||
|
} ;
|
||||||
|
happily = case y of {
|
||||||
|
"y" => happ + "ily" ;
|
||||||
|
_ => happy + "ly"
|
||||||
|
} ;
|
||||||
|
in mkADeg happy happily (happie + "r") (happie + "st") ;
|
||||||
|
|
||||||
mkAdv a = advPost a ** {lock_Adv = <>} ;
|
duplADeg fat = mkADeg fat
|
||||||
mkAdvPre a = advPre a ** {lock_Adv = <>} ;
|
(fat + "ly") (fat + last fat + "er") (fat + last fat + "est") ;
|
||||||
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
compoundADeg a = let ad = (a.s ! AAdj) in
|
||||||
mkAdA a = ss a ** {lock_AdA = <>} ;
|
mkADeg ad (a.s ! AAdv) ("more" ++ ad) ("most" ++ ad) ;
|
||||||
mkAdS a = ss a ** {lock_AdS = <>} ;
|
adegA a = {s = a.s ! Pos ; lock_A = <>} ;
|
||||||
|
|
||||||
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
|
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||||
{lock_V = <>} ;
|
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||||
vReg = \walk -> mkV walk (walk + "s") (walk + "ed") (walk + "ed") ;
|
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||||
vKiss = \kiss -> mkV kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
|
||||||
vFly = \cry -> let {cr = Predef.tk 1 cry} in
|
|
||||||
mkV cry (cr + "ies") (cr + "ied") (cr + "ied") ;
|
|
||||||
vGo = vKiss ;
|
|
||||||
|
|
||||||
vGen = \fly -> let {
|
mkPreposition p = p ;
|
||||||
fl = Predef.tk 1 fly ;
|
|
||||||
y = Predef.dp 1 fly ;
|
|
||||||
eqy = ifTok (Str -> V) y
|
|
||||||
} in
|
|
||||||
eqy "y" vFly (
|
|
||||||
eqy "s" vKiss (
|
|
||||||
eqy "z" vKiss (
|
|
||||||
vReg))) fly ;
|
|
||||||
|
|
||||||
vPart = \go, goes, went, gone, up ->
|
mkV a b c d e = mkVerbP3worst a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||||
verbPart (mkVerbP3 go goes went gone) up ** {lock_V = <>} ;
|
|
||||||
vPartReg = \get, up ->
|
|
||||||
verbPart (vGen get) up ** {lock_V = <>} ;
|
|
||||||
|
|
||||||
mkV2 = \v,p -> v ** {lock_V2 = <> ; s3 = p} ;
|
regV cry =
|
||||||
tvPartReg = \get, along, to -> mkV2 (vPartReg get along) to ;
|
let
|
||||||
|
cr = init cry ;
|
||||||
|
y = last cry ;
|
||||||
|
cries = (regN cry).s ! Pl ! Nom ; -- !
|
||||||
|
crie = init cries ;
|
||||||
|
cried = case last crie of {
|
||||||
|
"e" => crie + "d" ;
|
||||||
|
_ => crie + "ed"
|
||||||
|
} ;
|
||||||
|
crying = case y of {
|
||||||
|
"e" => cr + "ing" ;
|
||||||
|
_ => cry + "ing"
|
||||||
|
}
|
||||||
|
in mkV cry cries cried cried crying ;
|
||||||
|
|
||||||
vBe = verbBe ** {s1 = [] ; lock_V = <>} ;
|
regDuplV fit =
|
||||||
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
|
let fitt = fit + last fit in
|
||||||
|
mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
||||||
|
|
||||||
tvGen = \s,p -> mkV2 (vGen s) p ;
|
irregV x y z = mkVerbIrreg x y z ** {s1 = [] ; lock_V = <>} ;
|
||||||
tvDir = \v -> mkV2 v [] ;
|
|
||||||
tvGenDir = \s -> tvDir (vGen s) ;
|
|
||||||
|
|
||||||
mkV3 x y z = mkDitransVerb x y z ** {lock_V3 = <>} ;
|
irregDuplV fit y z =
|
||||||
v3Dir x y = mkV3 x [] y ;
|
let
|
||||||
v3DirDir x = v3Dir x [] ;
|
fitting = (regDuplV fit).s ! PresPart
|
||||||
|
in
|
||||||
|
mkV fit (fit + "s") y z fitting ;
|
||||||
|
|
||||||
-- these are used in the generated lexicon
|
partV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
||||||
noun : Str -> N = nNonhuman ;
|
|
||||||
|
|
||||||
verb2 : Str -> Str -> V2 = \v -> mkV2 (vGen v) ;
|
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; lock_V2 = <>} ;
|
||||||
verb3 : Str -> Str -> Str -> V3 = \v -> mkV3 (vGen v) ;
|
dirV2 v = mkV2 v [] ;
|
||||||
|
|
||||||
|
mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; s4 = q ; lock_V3 = <>} ;
|
||||||
|
dirV3 v p = mkV3 v [] p ;
|
||||||
|
dirdirV3 v = dirV3 v [] ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ oper
|
|||||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||||
|
|
||||||
mkAdA : Str -> AdA ;
|
mkAdA : Str -> AdA ;
|
||||||
mkAdS : Str -> AdS ;
|
mkAdC : Str -> AdC ;
|
||||||
|
|
||||||
-- Prepositional phrases are another productive form of adverbials.
|
-- Prepositional phrases are another productive form of adverbials.
|
||||||
|
|
||||||
@@ -249,11 +249,11 @@ oper
|
|||||||
_ => aReg s
|
_ => aReg s
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
mkAdv a = advPost a ** {lock_Adv = <>} ;
|
mkAdv a = ss a ** {lock_Adv = <>} ;
|
||||||
mkAdvPre a = advPre a ** {lock_Adv = <>} ;
|
mkAdvPre a = ss a ** {lock_Adv = <>} ;
|
||||||
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
||||||
mkAdA a = ss a ** {lock_AdA = <>} ;
|
mkAdA a = ss a ** {lock_AdA = <>} ;
|
||||||
mkAdS a = ss a ** {lock_AdS = <>} ;
|
mkAdC a = ss a ** {lock_AdC = <>} ;
|
||||||
|
|
||||||
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
|
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
|
||||||
{lock_V = <>} ;
|
{lock_V = <>} ;
|
||||||
|
|||||||
@@ -133,8 +133,8 @@ lin
|
|||||||
|
|
||||||
-- Adverbs.
|
-- Adverbs.
|
||||||
|
|
||||||
AdjAdv a = advPost (a.s ! AAdv) ;
|
AdjAdv a = ss (a.s ! AAdv) ;
|
||||||
AdvPP p = advPost p.s ;
|
AdvPP p = p ;
|
||||||
PrepNP p = prepPhrase p.s ; ---
|
PrepNP p = prepPhrase p.s ; ---
|
||||||
|
|
||||||
AdvVP = adVerbPhrase ;
|
AdvVP = adVerbPhrase ;
|
||||||
@@ -181,8 +181,8 @@ lin
|
|||||||
ImperOne = imperUtterance singular ;
|
ImperOne = imperUtterance singular ;
|
||||||
ImperMany = imperUtterance plural ;
|
ImperMany = imperUtterance plural ;
|
||||||
|
|
||||||
PrepS p = ss (p.s ++ ",") ;
|
AdvCl = advClause ;
|
||||||
AdvS = advSentence ;
|
AdvPhr = advSentence ;
|
||||||
|
|
||||||
|
|
||||||
--!
|
--!
|
||||||
|
|||||||
4
lib/resource/english/ShallowEng.gf
Normal file
4
lib/resource/english/ShallowEng.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete ShallowEng of Shallow = ShallowI with (Resource = ResourceEng) ;
|
||||||
|
|
||||||
@@ -65,9 +65,9 @@ concrete StructuralEng of Structural =
|
|||||||
WhenIAdv = ss "when" ;
|
WhenIAdv = ss "when" ;
|
||||||
WhereIAdv = ss "where" ;
|
WhereIAdv = ss "where" ;
|
||||||
WhyIAdv = ss "why" ;
|
WhyIAdv = ss "why" ;
|
||||||
EverywhereNP = advPost "everywhere" ;
|
EverywhereNP = ss "everywhere" ;
|
||||||
SomewhereNP = advPost "somewhere" ;
|
SomewhereNP = ss "somewhere" ;
|
||||||
NowhereNP = advPost "nowhere" ;
|
NowhereNP = ss "nowhere" ;
|
||||||
|
|
||||||
AndConj = ss "and" ** {n = Pl} ;
|
AndConj = ss "and" ** {n = Pl} ;
|
||||||
OrConj = ss "or" ** {n = Sg} ;
|
OrConj = ss "or" ** {n = Sg} ;
|
||||||
|
|||||||
@@ -573,21 +573,17 @@ oper
|
|||||||
--
|
--
|
||||||
-- Adverbs are not inflected (we ignore comparison, and treat
|
-- Adverbs are not inflected (we ignore comparison, and treat
|
||||||
-- compared adverbials as separate expressions; this could be done another way).
|
-- compared adverbials as separate expressions; this could be done another way).
|
||||||
-- We distinguish between post- and pre-verbal adverbs.
|
-- We distinguish between different combinatory adverbs in the sybntax itself.
|
||||||
|
|
||||||
Adverb : Type = SS ** {p : Bool} ;
|
Adverb : Type = SS ;
|
||||||
|
|
||||||
advPre : Str -> Adverb = \seldom -> ss seldom ** {p = False} ;
|
|
||||||
advPost : Str -> Adverb = \well -> ss well ** {p = True} ;
|
|
||||||
|
|
||||||
-- N.B. this rule generates the cyclic parsing rule $VP#2 ::= VP#2$
|
-- N.B. this rule generates the cyclic parsing rule $VP#2 ::= VP#2$
|
||||||
-- and cannot thus be parsed.
|
-- and cannot thus be parsed.
|
||||||
|
|
||||||
adVerbPhrase : VerbGroup -> Adverb -> VerbGroup = \sings, well ->
|
adVerbPhrase : VerbGroup -> Adverb -> VerbGroup = \sings, often ->
|
||||||
let {postp = orB well.p sings.isAux} in
|
|
||||||
{
|
{
|
||||||
s = \\b,sf,a => (if_then_else Str postp [] well.s) ++ sings.s ! b ! sf ! a ;
|
s = \\b,sf,a => sings.s ! b ! sf ! a ++ often.s ; ---- depends on sf and isAux
|
||||||
s2 = \\b,sf,a => sings.s2 ! b ! sf ! a ++ (if_then_else Str postp well.s []) ;
|
s2 = \\b,sf,a => sings.s2 ! b ! sf ! a ;
|
||||||
isAux = sings.isAux
|
isAux = sings.isAux
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
@@ -601,7 +597,7 @@ oper
|
|||||||
-- is a little shaky, since other prepositions may be preferred ("on", "at").
|
-- is a little shaky, since other prepositions may be preferred ("on", "at").
|
||||||
|
|
||||||
prepPhrase : Preposition -> NounPhrase -> Adverb = \on, it ->
|
prepPhrase : Preposition -> NounPhrase -> Adverb = \on, it ->
|
||||||
advPost (on ++ it.s ! AccP) ;
|
ss (on ++ it.s ! AccP) ;
|
||||||
|
|
||||||
locativeNounPhrase : NounPhrase -> Adverb =
|
locativeNounPhrase : NounPhrase -> Adverb =
|
||||||
prepPhrase "in" ;
|
prepPhrase "in" ;
|
||||||
@@ -1042,7 +1038,13 @@ oper
|
|||||||
|
|
||||||
--2 Sentence adverbs
|
--2 Sentence adverbs
|
||||||
--
|
--
|
||||||
-- This class covers adverbs such as "otherwise", "therefore", which are prefixed
|
-- Sentence adverbs is the largest class and open for
|
||||||
|
-- e.g. prepositional phrases.
|
||||||
|
|
||||||
|
advClause : Clause -> Adverb -> Clause = \yousing,well ->
|
||||||
|
{s = \\b,c => yousing.s ! b ! c ++ well.s} ;
|
||||||
|
|
||||||
|
-- Conjunctive adverbs are such as "otherwise", "therefore", which are prefixed
|
||||||
-- to a sentence to form a phrase.
|
-- to a sentence to form a phrase.
|
||||||
|
|
||||||
advSentence : SS -> Sentence -> Utterance = \hence,itiseven ->
|
advSentence : SS -> Sentence -> Utterance = \hence,itiseven ->
|
||||||
@@ -1206,7 +1208,7 @@ oper
|
|||||||
|
|
||||||
subjunctVerbPhrase : VerbGroup -> Subjunction -> Sentence -> VerbGroup =
|
subjunctVerbPhrase : VerbGroup -> Subjunction -> Sentence -> VerbGroup =
|
||||||
\V, if, A ->
|
\V, if, A ->
|
||||||
adVerbPhrase V (advPost (if.s ++ A.s)) ;
|
adVerbPhrase V (ss (if.s ++ A.s)) ;
|
||||||
|
|
||||||
--2 One-word utterances
|
--2 One-word utterances
|
||||||
--
|
--
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ lin
|
|||||||
Uncle = funOfReg "uncle" human ;
|
Uncle = funOfReg "uncle" human ;
|
||||||
Connection = cnNoHum (nounReg "connection") ** {s2 = "from" ; s3 = "to"} ;
|
Connection = cnNoHum (nounReg "connection") ** {s2 = "from" ; s3 = "to"} ;
|
||||||
|
|
||||||
Always = advPre "always" ;
|
Always = ss "always" ;
|
||||||
Well = advPost "well" ;
|
Well = ss "well" ;
|
||||||
|
|
||||||
SwitchOn = mkTransVerbPart (verbP3s "switch") "on" ;
|
SwitchOn = mkTransVerbPart (verbP3s "switch") "on" ;
|
||||||
SwitchOff = mkTransVerbPart (verbP3s "switch") "off" ;
|
SwitchOff = mkTransVerbPart (verbP3s "switch") "off" ;
|
||||||
@@ -49,8 +49,8 @@ lin
|
|||||||
Mary = nameReg "Mary" Fem ;
|
Mary = nameReg "Mary" Fem ;
|
||||||
|
|
||||||
--- next
|
--- next
|
||||||
AlreadyAdv = advPre "already" ;
|
AlreadyAdv = ss "already" ;
|
||||||
NowAdv = advPre "now" ;
|
NowAdv = ss "now" ;
|
||||||
|
|
||||||
Paint = mkTransVerbDir (verbNoPart (regVerbP3 "paint")) ;
|
Paint = mkTransVerbDir (verbNoPart (regVerbP3 "paint")) ;
|
||||||
Green = adjDegrReg "green" ;
|
Green = adjDegrReg "green" ;
|
||||||
|
|||||||
@@ -58,7 +58,10 @@ lincat
|
|||||||
|
|
||||||
|
|
||||||
Adv = Adverb ;
|
Adv = Adverb ;
|
||||||
-- = {s : Str ; isPost : Bool} ;
|
-- = {s : Str} ;
|
||||||
|
AdV = Adverb ;
|
||||||
|
AdA = Adverb ;
|
||||||
|
AdC = Adverb ;
|
||||||
PP = Adverb ;
|
PP = Adverb ;
|
||||||
|
|
||||||
S = Sentence ;
|
S = Sentence ;
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ lin
|
|||||||
ImperOne = imperUtterance singular ;
|
ImperOne = imperUtterance singular ;
|
||||||
ImperMany = imperUtterance plural ;
|
ImperMany = imperUtterance plural ;
|
||||||
|
|
||||||
PrepS p = ss (p.s ++ ",") ;
|
AdvCl = advClause ;
|
||||||
AdvS = advSentence ;
|
AdvPhr = advSentence ;
|
||||||
|
|
||||||
|
|
||||||
--!
|
--!
|
||||||
|
|||||||
@@ -690,19 +690,18 @@ oper
|
|||||||
-- Even prepositional phrases can be both
|
-- Even prepositional phrases can be both
|
||||||
-- ("att han i alla fall skulle komma").
|
-- ("att han i alla fall skulle komma").
|
||||||
|
|
||||||
Adverb : Type = SS ** {isPost : Bool} ;
|
Adverb : Type = SS ;
|
||||||
PrepPhrase : Type = Adverb ;
|
PrepPhrase : Type = Adverb ;
|
||||||
|
|
||||||
advPre : Str -> Adverb = \alltid -> ss alltid ** {isPost = False} ;
|
advPre : Str -> Adverb = ss ;
|
||||||
advPost : Str -> Adverb = \bra -> ss bra ** {isPost = True} ;
|
advPost : Str -> Adverb = ss ;
|
||||||
|
|
||||||
adVerbPhrase : VerbGroup -> Adverb -> VerbGroup = \spelar, bra ->
|
adVerbPhrase : VerbGroup -> Adverb -> VerbGroup = \spelar, ofta ->
|
||||||
let {postp = bra.isPost} in
|
|
||||||
{
|
{
|
||||||
--- this unfortunately generates VP#2 ::= VP#2
|
--- this unfortunately generates VP#2 ::= VP#2
|
||||||
s = spelar.s ;
|
s = spelar.s ;
|
||||||
s2 = \\b => (if_then_else Str postp [] bra.s) ++ spelar.s2 ! b ;
|
s2 = \\b => ofta.s ++ spelar.s2 ! b ;
|
||||||
s3 = \\sf,g,n,p => spelar.s3 ! sf ! g ! n ! p ++ (if_then_else Str postp bra.s [])
|
s3 = \\sf,g,n,p => spelar.s3 ! sf ! g ! n ! p
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \mycket, dyr ->
|
advAdjPhrase : SS -> AdjPhrase -> AdjPhrase = \mycket, dyr ->
|
||||||
@@ -1163,6 +1162,13 @@ oper
|
|||||||
ss (I.s ! n ++ "!") ;
|
ss (I.s ! n ++ "!") ;
|
||||||
|
|
||||||
--2 Sentence adverbials
|
--2 Sentence adverbials
|
||||||
|
--
|
||||||
|
-- Sentence adverbs is the largest class and open for
|
||||||
|
-- e.g. prepositional phrases.
|
||||||
|
|
||||||
|
advClause : Clause -> Adverb -> Clause = \yousing,well ->
|
||||||
|
{s = \\b,c => yousing.s ! b ! c ++ well.s} ;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- This class covers adverbials such as "annars", "därför", which are prefixed
|
-- This class covers adverbials such as "annars", "därför", which are prefixed
|
||||||
-- to a sentence to form a phrase.
|
-- to a sentence to form a phrase.
|
||||||
|
|||||||
Reference in New Issue
Block a user