mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-06-02 14:48:54 -06:00
resource = resource-1.0
This commit is contained in:
38
lib/resource/english/AdjectiveEng.gf
Normal file
38
lib/resource/english/AdjectiveEng.gf
Normal file
@@ -0,0 +1,38 @@
|
||||
concrete AdjectiveEng of Adjective = CatEng ** open ResEng, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
PositA a = {
|
||||
s = \\_ => a.s ! AAdj Posit ;
|
||||
isPre = True
|
||||
} ;
|
||||
ComparA a np = {
|
||||
s = \\_ => a.s ! AAdj Compar ++ "than" ++ np.s ! Nom ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
-- $SuperlA$ belongs to determiner syntax in $Noun$.
|
||||
|
||||
ComplA2 a np = {
|
||||
s = \\_ => a.s ! AAdj Posit ++ a.c2 ++ np.s ! Acc ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
ReflA2 a = {
|
||||
s = \\ag => a.s ! AAdj Posit ++ a.c2 ++ reflPron ! ag ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
SentAP ap sc = {
|
||||
s = \\a => ap.s ! a ++ sc.s ;
|
||||
isPre = False
|
||||
} ;
|
||||
|
||||
AdAP ada ap = {
|
||||
s = \\a => ada.s ++ ap.s ! a ;
|
||||
isPre = ap.isPre
|
||||
} ;
|
||||
|
||||
UseA2 a = a ;
|
||||
|
||||
}
|
||||
21
lib/resource/english/AdverbEng.gf
Normal file
21
lib/resource/english/AdverbEng.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
concrete AdverbEng of Adverb = CatEng ** open ResEng, Prelude in {
|
||||
|
||||
lin
|
||||
PositAdvAdj a = {s = a.s ! AAdv} ;
|
||||
ComparAdvAdj cadv a np = {
|
||||
s = cadv.s ++ a.s ! AAdv ++ "than" ++ np.s ! Nom
|
||||
} ;
|
||||
ComparAdvAdjS cadv a s = {
|
||||
s = cadv.s ++ a.s ! AAdv ++ "than" ++ s.s
|
||||
} ;
|
||||
|
||||
PrepNP prep np = {s = prep.s ++ np.s ! Acc} ;
|
||||
|
||||
AdAdv = cc2 ;
|
||||
|
||||
SubjS = cc2 ;
|
||||
AdvSC s = s ; --- this rule give stack overflow in ordinary parsing
|
||||
|
||||
AdnCAdv cadv = {s = cadv.s ++ "than"} ;
|
||||
|
||||
}
|
||||
@@ -1,231 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -val
|
||||
|
||||
concrete BasicEng of Basic = CategoriesEng ** open ParadigmsEng in {
|
||||
|
||||
flags
|
||||
startcat=Phr ; lexer=textlit ; unlexer=text ;
|
||||
optimize=all ;
|
||||
|
||||
lin
|
||||
airplane_N = regN "airplane" ;
|
||||
answer_V2S = mkV2S (regV "answer") "to" ;
|
||||
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 (irregV "become" "became" "become") ;
|
||||
beer_N = regN "beer" ;
|
||||
beg_V2V = mkV2V (regDuplV "beg") [] "to" ;
|
||||
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 (irregV "break" "broke" "broken") ;
|
||||
broad_ADeg = regADeg "broad" ;
|
||||
brother_N2 = regN2 "brother" ;
|
||||
brown_ADeg = regADeg "brown" ;
|
||||
butter_N = regN "butter" ;
|
||||
buy_V2 = dirV2 (irregV "buy" "bought" "bought") ;
|
||||
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 = mk2N "child" "children" ;
|
||||
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 = (irregV "come" "came" "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" ;
|
||||
distance_N3 = mkN3 (regN "distance") "from" "to" ;
|
||||
doctor_N = regN "doctor" ;
|
||||
dog_N = regN "dog" ;
|
||||
door_N = regN "door" ;
|
||||
drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ;
|
||||
easy_A2V = mkA2V (regA "easy") "for" ;
|
||||
eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ;
|
||||
empty_ADeg = regADeg "empty" ;
|
||||
enemy_N = regN "enemy" ;
|
||||
factory_N = regN "factory" ;
|
||||
father_N2 = regN2 "father" ;
|
||||
fear_VS = mkVS (regV "fear") ;
|
||||
find_V2 = dirV2 (irregV "find" "found" "found") ;
|
||||
fish_N = mk2N "fish" "fish" ;
|
||||
floor_N = regN "floor" ;
|
||||
forget_V2 = dirV2 (irregV "forget" "forgot" "forgotten") ;
|
||||
fridge_N = regN "fridge" ;
|
||||
friend_N = regN "friend" ;
|
||||
fruit_N = regN "fruit" ;
|
||||
fun_AV = mkAV (regA "fun") ;
|
||||
garden_N = regN "garden" ;
|
||||
girl_N = regN "girl" ;
|
||||
glove_N = regN "glove" ;
|
||||
gold_N = regN "gold" ;
|
||||
good_ADeg = mkADeg "good" "well" "better" "best" ;
|
||||
go_V = (mkV "go" "goes" "went" "gone" "going") ;
|
||||
green_ADeg = regADeg "green" ;
|
||||
harbour_N = regN "harbour" ;
|
||||
hate_V2 = dirV2 (regV "hate") ;
|
||||
hat_N = regN "hat" ;
|
||||
have_V2 = dirV2 (mkV "have" "has" "had" "had" "having") ;
|
||||
hear_V2 = dirV2 (irregV "hear" "heard" "heard") ;
|
||||
hill_N = regN "hill" ;
|
||||
hope_VS = mkVS (regV "hope") ;
|
||||
horse_N = regN "horse" ;
|
||||
hot_ADeg = regADeg "hot" ;
|
||||
house_N = regN "house" ;
|
||||
important_ADeg = compoundADeg (regA "important") ;
|
||||
industry_N = regN "industry" ;
|
||||
iron_N = regN "iron" ;
|
||||
king_N = regN "king" ;
|
||||
know_V2 = dirV2 (irregV "know" "knew" "known") ;
|
||||
lake_N = regN "lake" ;
|
||||
lamp_N = regN "lamp" ;
|
||||
learn_V2 = dirV2 (regV "learn") ;
|
||||
leather_N = regN "leather" ;
|
||||
leave_V2 = dirV2 (irregV "leave" "left" "left") ;
|
||||
like_V2 = dirV2 (regV "like") ;
|
||||
listen_V2 = dirV2 (regV "listen") ;
|
||||
live_V = (regV "live") ;
|
||||
long_ADeg = regADeg "long" ;
|
||||
lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
||||
love_N = regN "love" ;
|
||||
love_V2 = dirV2 (regV "love") ;
|
||||
man_N = mk2N "man" "men" ;
|
||||
married_A2 = mkA2 (regA "married") "to" ;
|
||||
meat_N = regN "meat" ;
|
||||
milk_N = regN "milk" ;
|
||||
moon_N = regN "moon" ;
|
||||
mother_N2 = regN2 "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") ;
|
||||
paint_V2A = mkV2A (regV "paint") [] ;
|
||||
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" ;
|
||||
probable_AS = mkAS (regA "probable") ;
|
||||
queen_N = regN "queen" ;
|
||||
radio_N = regN "radio" ;
|
||||
rain_V0 = mkV0 (regV "rain") ;
|
||||
read_V2 = dirV2 (irregV "read" "read" "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 = (irregDuplV "run" "ran" "run") ;
|
||||
say_VS = mkVS (irregV "say" "said" "said") ;
|
||||
school_N = regN "school" ;
|
||||
science_N = regN "science" ;
|
||||
sea_N = regN "sea" ;
|
||||
seek_V2 = dirV2 (irregV "seek" "sought" "sought") ;
|
||||
see_V2 = dirV2 (irregV "see" "saw" "seen") ;
|
||||
sell_V3 = dirV3 (irregV "sell" "sold" "sold") "to" ;
|
||||
send_V3 = dirV3 (irregV "send" "sent" "sent") "to" ;
|
||||
sheep_N = mk2N "sheep" "sheep" ;
|
||||
ship_N = regN "ship" ;
|
||||
shirt_N = regN "shirt" ;
|
||||
shoe_N = regN "shoe" ;
|
||||
shop_N = regN "shop" ;
|
||||
short_ADeg = regADeg "short" ;
|
||||
silver_N = regN "silver" ;
|
||||
sister_N = regN "sister" ;
|
||||
sleep_V = (irregV "sleep" "slept" "slept") ;
|
||||
small_ADeg = regADeg "small" ;
|
||||
snake_N = regN "snake" ;
|
||||
sock_N = regN "sock" ;
|
||||
speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ;
|
||||
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_V2 = dirV2 (partV (regV "switch") "off") ;
|
||||
switch8on_V2 = dirV2 (partV (regV "switch") "on") ;
|
||||
table_N = regN "table" ;
|
||||
talk_V3 = mkV3 (regV "talk") "to" "about" ;
|
||||
teacher_N = regN "teacher" ;
|
||||
teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
|
||||
television_N = regN "television" ;
|
||||
thick_ADeg = regADeg "thick" ;
|
||||
thin_ADeg = regADeg "thin" ;
|
||||
train_N = regN "train" ;
|
||||
travel_V = (regDuplV "travel") ;
|
||||
tree_N = regN "tree" ;
|
||||
---- trousers_N = regN "trousers" ;
|
||||
ugly_ADeg = regADeg "ugly" ;
|
||||
understand_V2 = dirV2 (irregV "understand" "understood" "understood") ;
|
||||
university_N = regN "university" ;
|
||||
village_N = regN "village" ;
|
||||
wait_V2 = mkV2 (regV "wait") "for" ;
|
||||
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 (irregV "win" "won" "won") ;
|
||||
woman_N = mk2N "woman" "women" ;
|
||||
wonder_VQ = mkVQ (regV "wonder") ;
|
||||
wood_N = regN "wood" ;
|
||||
write_V2 = dirV2 (irregV "write" "wrote" "written") ;
|
||||
yellow_ADeg = regADeg "yellow" ;
|
||||
young_ADeg = regADeg "young" ;
|
||||
|
||||
do_V2 = dirV2 (mkV "do" "does" "did" "done" "doing") ;
|
||||
now_Adv = mkAdv "now" ;
|
||||
already_Adv = mkAdv "already" ;
|
||||
song_N = regN "song" ;
|
||||
add_V3 = dirV3 (regV "add") "to" ;
|
||||
number_N = regN "number" ;
|
||||
put_V2 = mkV2 (irregDuplV "put" "put" "put") [] ;
|
||||
stop_V = regDuplV "stop" ;
|
||||
jump_V = regV "jump" ;
|
||||
here_Adv = mkAdv "here" ;
|
||||
here7to_Adv = mkAdv ["to here"] ;
|
||||
here7from_Adv = mkAdv ["from here"] ;
|
||||
there_Adv = mkAdv "there" ;
|
||||
there7to_Adv = mkAdv "there" ;
|
||||
there7from_Adv = mkAdv ["from there"] ;
|
||||
} ;
|
||||
84
lib/resource/english/CatEng.gf
Normal file
84
lib/resource/english/CatEng.gf
Normal file
@@ -0,0 +1,84 @@
|
||||
concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
|
||||
-- Tensed/Untensed
|
||||
|
||||
S = {s : Str} ;
|
||||
QS = {s : QForm => Str} ;
|
||||
RS = {s : Agr => Str ; c : Case} ; -- c for it clefts
|
||||
|
||||
-- Sentence
|
||||
|
||||
Cl = {s : Tense => Anteriority => CPolarity => Order => Str} ;
|
||||
Slash = {
|
||||
s : Tense => Anteriority => CPolarity => Order => Str ;
|
||||
c2 : Str
|
||||
} ;
|
||||
Imp = {s : CPolarity => Number => Str} ;
|
||||
|
||||
-- Question
|
||||
|
||||
QCl = {s : Tense => Anteriority => CPolarity => QForm => Str} ;
|
||||
IP = {s : Case => Str ; n : Number} ;
|
||||
IComp = {s : Str} ;
|
||||
IDet = {s : Str ; n : Number} ;
|
||||
|
||||
-- Relative
|
||||
|
||||
RCl = {s : Tense => Anteriority => CPolarity => Agr => Str ; c : Case} ;
|
||||
RP = {s : RCase => Str ; a : RAgr} ;
|
||||
|
||||
-- Verb
|
||||
|
||||
VP = {
|
||||
s : Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ;
|
||||
prp : Str ; -- present participle
|
||||
inf : Str ; -- infinitive
|
||||
ad : Str ;
|
||||
s2 : Agr => Str
|
||||
} ;
|
||||
|
||||
Comp = {s : Agr => Str} ;
|
||||
|
||||
-- Adjective
|
||||
|
||||
AP = {s : Agr => Str ; isPre : Bool} ;
|
||||
|
||||
-- Noun
|
||||
|
||||
CN = {s : Number => Case => Str} ;
|
||||
NP, Pron = {s : Case => Str ; a : Agr} ;
|
||||
Det = {s : Str ; n : Number} ;
|
||||
Predet, QuantSg, QuantPl, Num, Ord = {s : Str} ;
|
||||
Quant = {s : Number => Str} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
Conj = {s : Str ; n : Number} ;
|
||||
DConj = {s1,s2 : Str ; n : Number} ;
|
||||
Subj = {s : Str} ;
|
||||
Prep = {s : Str} ;
|
||||
|
||||
-- Open lexical classes, e.g. Lexicon
|
||||
|
||||
V, VS, VQ, VA = Verb ; -- = {s : VForm => Str} ;
|
||||
V2, V2A = Verb ** {c2 : Str} ;
|
||||
V3 = Verb ** {c2, c3 : Str} ;
|
||||
VV = {s : VVForm => Str ; isAux : Bool} ;
|
||||
|
||||
A = {s : AForm => Str} ;
|
||||
A2 = {s : AForm => Str ; c2 : Str} ;
|
||||
|
||||
N = {s : Number => Case => Str} ;
|
||||
N2 = {s : Number => Case => Str} ** {c2 : Str} ;
|
||||
N3 = {s : Number => Case => Str} ** {c2,c3 : Str} ;
|
||||
PN = {s : Case => Str} ;
|
||||
|
||||
}
|
||||
@@ -1,107 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
concrete CategoriesEng of Categories = PredefCnc ** open Prelude, SyntaxEng in {
|
||||
|
||||
lincat
|
||||
N = CommNoun ;
|
||||
-- = {s : Number => Case => Str}
|
||||
CN = CommNounPhrase ;
|
||||
-- = CommNoun ** {g : Gender}
|
||||
NP = {s : NPForm => Str ; a : Agr} ;
|
||||
PN = {s : Case => Str ; g : Gender} ;
|
||||
Det = {s : Str ; n : Number} ;
|
||||
NDet = {s : Str} ;
|
||||
N2 = Function ;
|
||||
-- = CommNounPhrase ** {s2 : Preposition} ;
|
||||
N3 = Function ** {s3 : Preposition} ;
|
||||
Num = {s : Case => Str ; n : Number} ;
|
||||
Prep = {s : Str} ;
|
||||
|
||||
A = Adjective ;
|
||||
-- = {s : AForm => Str}
|
||||
A2 = Adjective ** {s2 : Preposition} ;
|
||||
ADeg = {s : Degree => AForm => Str} ;
|
||||
AP = {s : Agr => Str ; p : Bool} ;
|
||||
AS = Adjective ; --- "more difficult for him to come than..."
|
||||
A2S = Adjective ** {s2 : Preposition} ;
|
||||
AV = Adjective ;
|
||||
A2V = Adjective ** {s2 : Preposition} ;
|
||||
|
||||
V = Verb ;
|
||||
-- = {s : VForm => Str ; s1 : Particle}
|
||||
VP = {s,s2 : Bool => SForm => Agr => Str ; isAux : Bool} ;
|
||||
VPI = {s : VIForm => Agr => Str ; s1 : Str} ; -- s1 is "not" or []
|
||||
VCl = {s : Bool => Anteriority => VIForm => Agr => Str ; s1 : Bool => Str} ;
|
||||
V2 = TransVerb ;
|
||||
-- = Verb ** {s3 : Preposition} ;
|
||||
V3 = TransVerb ** {s4 : Preposition} ;
|
||||
VS = Verb ;
|
||||
VV = AuxVerb ** {isAux : Bool} ;
|
||||
|
||||
VS = Verb ;
|
||||
VQ = Verb ;
|
||||
VA = Verb ;
|
||||
|
||||
V2S = TransVerb ;
|
||||
V2Q = TransVerb ;
|
||||
V2V = TransVerb ** {s4 : Str} ;
|
||||
----V2V = {s : VForm => Str ; s1 : Particle ; s3, s4 : Str} ;
|
||||
V2A = TransVerb ;
|
||||
V0 = Verb ;
|
||||
|
||||
TP = {s : Str ; b : Bool ; t : Tense ; a : Anteriority} ; --- the Str field is dummy
|
||||
Tense = {s : Str ; t : Tense} ;
|
||||
Pol = {s : Str ; p : Bool} ;
|
||||
Ant = {s : Str ; a : Anteriority} ;
|
||||
|
||||
PP = {s : Str} ;
|
||||
Adv = {s : Str} ;
|
||||
AdV = {s : Str} ;
|
||||
AdA = {s : Str} ;
|
||||
AdC = {s : Str} ;
|
||||
|
||||
S = {s : Str} ;
|
||||
Cl = Clause ;
|
||||
-- = {s : Order => Bool => SForm => Str} ;
|
||||
Slash = {s : QuestForm => Bool => SForm => Str ; s2 : Preposition} ;
|
||||
RP = {s : Gender => Number => NPForm => Str} ;
|
||||
RCl = {s : (Bool * SForm * Agr) => Str} ;
|
||||
RS = {s : Agr => Str} ;
|
||||
|
||||
IP = {s : NPForm => Str ; n : Number ; g : Gender} ;
|
||||
IDet = {s : Str ; n : Number} ;
|
||||
IAdv = {s : Str} ;
|
||||
QCl = {s : Bool => SForm => QuestForm => Str} ;
|
||||
QS = {s : QuestForm => Str} ;
|
||||
Imp = {s : Number => Str} ;
|
||||
Phr = {s : Str} ;
|
||||
Text = {s : Str} ;
|
||||
|
||||
Conj = {s : Str ; n : Number} ;
|
||||
ConjD = {s1 : Str ; s2 : Str ; n : Number} ;
|
||||
|
||||
ListS = {s1 : Str ; s2 : Str} ;
|
||||
ListAP = {s1,s2 : Agr => Str ; p : Bool} ;
|
||||
ListNP = {s1,s2 : NPForm => Str ; a : Agr} ;
|
||||
ListAdv = {s1 : Str ; s2 : Str} ;
|
||||
|
||||
} ;
|
||||
@@ -1,97 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete ClauseEng of Clause = CategoriesEng **
|
||||
|
||||
open Prelude, SyntaxEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
SPredV np v = predVerbClause np v (complVerb v) ;
|
||||
SPredPassV np v = predBeGroup np (passVerb v) ;
|
||||
SPredV2 np v x = predVerbClause np v (complTransVerb v x) ;
|
||||
SPredReflV2 np v = predVerbClause np v (reflTransVerb v) ;
|
||||
SPredV3 np v x y = predVerbClause np v (complDitransVerb v x y) ;
|
||||
SPredVS np v x = predVerbClause np v (complSentVerb v x) ;
|
||||
SPredVV np v x = predVerbClause np (aux2verb v) (complVerbVerb v x) ;
|
||||
SPredVQ np v x = predVerbClause np v (complQuestVerb v x) ;
|
||||
SPredVA np v x = predVerbClause np v (complAdjVerb v x) ;
|
||||
SPredV2A np v x y = predVerbClause np v (complDitransAdjVerb v x y) ;
|
||||
SPredSubjV2V np v x y = predVerbClause np v (complDitransVerbVerb False v x y) ;
|
||||
SPredObjV2V np v x y = predVerbClause np v (complDitransVerbVerb True v x y) ;
|
||||
SPredV2S np v x y = predVerbClause np v (complDitransSentVerb v x y) ;
|
||||
SPredV2Q np v x y = predVerbClause np v (complDitransQuestVerb v x y) ;
|
||||
|
||||
SPredAP np v = predBeGroup np v.s ;
|
||||
SPredCN np v = predBeGroup np (complCommNoun v) ;
|
||||
SPredNP np v = predBeGroup np (complNounPhrase v) ;
|
||||
SPredAdv np v = predBeGroup np (complAdverb v) ;
|
||||
|
||||
SPredProgVP = progressiveClause ;
|
||||
|
||||
QPredV np v = intVerbClause np v (complVerb v) ;
|
||||
QPredPassV np v = predBeGroupQ np (passVerb v) ;
|
||||
QPredV2 np v x = intVerbClause np v (complTransVerb v x) ;
|
||||
QPredReflV2 np v = intVerbClause np v (reflTransVerb v) ;
|
||||
QPredV3 np v x y = intVerbClause np v (complDitransVerb v x y) ;
|
||||
QPredVS np v x = intVerbClause np v (complSentVerb v x) ;
|
||||
QPredVV np v x = intVerbClause np (aux2verb v) (complVerbVerb v x) ;
|
||||
QPredVQ np v x = intVerbClause np v (complQuestVerb v x) ;
|
||||
QPredVA np v x = intVerbClause np v (complAdjVerb v x) ;
|
||||
QPredV2A np v x y = intVerbClause np v (complDitransAdjVerb v x y) ;
|
||||
QPredSubjV2V np v x y = intVerbClause np v (complDitransVerbVerb False v x y) ;
|
||||
QPredObjV2V np v x y = intVerbClause np v (complDitransVerbVerb True v x y) ;
|
||||
QPredV2S np v x y = intVerbClause np v (complDitransSentVerb v x y) ;
|
||||
QPredV2Q np v x y = intVerbClause np v (complDitransQuestVerb v x y) ;
|
||||
|
||||
QPredAP np v = predBeGroupQ np v.s ;
|
||||
QPredCN np v = predBeGroupQ np (complCommNoun v) ;
|
||||
QPredNP np v = predBeGroupQ np (complNounPhrase v) ;
|
||||
QPredAdv np v = predBeGroupQ np (complAdverb v) ;
|
||||
|
||||
QPredProgVP np vp = predBeGroupQ np (vp.s ! VIPresPart) ;
|
||||
|
||||
RPredV np v = relVerbClause np v (complVerb v) ;
|
||||
RPredPassV np v = predBeGroupR np (passVerb v) ;
|
||||
RPredV2 np v x = relVerbClause np v (complTransVerb v x) ;
|
||||
RPredReflV2 np v = relVerbClause np v (reflTransVerb v) ;
|
||||
RPredV3 np v x y = relVerbClause np v (complDitransVerb v x y) ;
|
||||
RPredVS np v x = relVerbClause np v (complSentVerb v x) ;
|
||||
RPredVV np v x = relVerbClause np (aux2verb v) (complVerbVerb v x) ;
|
||||
RPredVQ np v x = relVerbClause np v (complQuestVerb v x) ;
|
||||
RPredVA np v x = relVerbClause np v (complAdjVerb v x) ;
|
||||
RPredV2A np v x y = relVerbClause np v (complDitransAdjVerb v x y) ;
|
||||
RPredSubjV2V np v x y = relVerbClause np v (complDitransVerbVerb False v x y) ;
|
||||
RPredObjV2V np v x y = relVerbClause np v (complDitransVerbVerb True v x y) ;
|
||||
RPredV2S np v x y = relVerbClause np v (complDitransSentVerb v x y) ;
|
||||
RPredV2Q np v x y = relVerbClause np v (complDitransQuestVerb v x y) ;
|
||||
|
||||
RPredAP np v = predBeGroupR np v.s ;
|
||||
RPredCN np v = predBeGroupR np (complCommNoun v) ;
|
||||
RPredNP np v = predBeGroupR np (complNounPhrase v) ;
|
||||
RPredAdv np v = predBeGroupR np (complAdverb v) ;
|
||||
|
||||
RPredProgVP np vp = predBeGroupR np (vp.s ! VIPresPart) ;
|
||||
|
||||
IPredV v = predVerbI v (complVerb v) ;
|
||||
IPredPassV v = predVerbI v (passVerb v) ;
|
||||
IPredV2 v x = predVerbI v (complTransVerb v x) ;
|
||||
IPredReflV2 v = predVerbI v (reflTransVerb v) ;
|
||||
IPredV3 v x y = predVerbI v (complDitransVerb v x y) ;
|
||||
IPredVS v x = predVerbI v (complSentVerb v x) ;
|
||||
IPredVV v x = predVerbI (aux2verb v) (complVerbVerb v x) ;
|
||||
IPredVQ v x = predVerbI v (complQuestVerb v x) ;
|
||||
IPredVA v x = predVerbI v (complAdjVerb v x) ;
|
||||
IPredV2A v x y = predVerbI v (complDitransAdjVerb v x y) ;
|
||||
IPredSubjV2V v x y = predVerbI v (complDitransVerbVerb False v x y) ;
|
||||
IPredObjV2V v x y = predVerbI v (complDitransVerbVerb True v x y) ;
|
||||
IPredV2S v x y = predVerbI v (complDitransSentVerb v x y) ;
|
||||
IPredV2Q v x y = predVerbI v (complDitransQuestVerb v x y) ;
|
||||
|
||||
IPredAP v = predBeGroupI v.s ;
|
||||
IPredCN v = predBeGroupI (complCommNoun v) ;
|
||||
IPredNP v = predBeGroupI (complNounPhrase v) ;
|
||||
IPredAdv v = predBeGroupI (complAdverb v) ;
|
||||
|
||||
IPredProgVP vp = predBeGroupI (vp.s ! VIPresPart) ;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -opt
|
||||
|
||||
concrete ClauseEngVP of Clause = CategoriesEng **
|
||||
ClauseI with (Rules=RulesEng), (Verbphrase=VerbphraseEng) ;
|
||||
45
lib/resource/english/ConjunctionEng.gf
Normal file
45
lib/resource/english/ConjunctionEng.gf
Normal file
@@ -0,0 +1,45 @@
|
||||
concrete ConjunctionEng of Conjunction =
|
||||
CatEng ** open ResEng, Coordination, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
ConjS = conjunctSS ;
|
||||
DConjS = conjunctDistrSS ;
|
||||
|
||||
ConjAdv = conjunctSS ;
|
||||
DConjAdv = conjunctDistrSS ;
|
||||
|
||||
ConjNP conj ss = conjunctTable Case conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
} ;
|
||||
DConjNP conj ss = conjunctDistrTable Case conj ss ** {
|
||||
a = {n = conjNumber conj.n ss.a.n ; p = ss.a.p}
|
||||
} ;
|
||||
|
||||
ConjAP conj ss = conjunctTable Agr conj ss ** {
|
||||
isPre = ss.isPre
|
||||
} ;
|
||||
DConjAP conj ss = conjunctDistrTable Agr conj ss ** {
|
||||
isPre = ss.isPre
|
||||
} ;
|
||||
|
||||
-- These fun's are generated from the list cat's.
|
||||
|
||||
BaseS = twoSS ;
|
||||
ConsS = consrSS comma ;
|
||||
BaseAdv = twoSS ;
|
||||
ConsAdv = consrSS comma ;
|
||||
BaseNP x y = twoTable Case x y ** {a = conjAgr x.a y.a} ;
|
||||
ConsNP xs x = consrTable Case comma xs x ** {a = conjAgr xs.a x.a} ;
|
||||
BaseAP x y = twoTable Agr x y ** {isPre = andB x.isPre y.isPre} ;
|
||||
ConsAP xs x = consrTable Agr comma xs x ** {isPre = andB xs.isPre x.isPre} ;
|
||||
|
||||
lincat
|
||||
[S] = {s1,s2 : Str} ;
|
||||
[Adv] = {s1,s2 : Str} ;
|
||||
[NP] = {s1,s2 : Case => Str ; a : Agr} ;
|
||||
[AP] = {s1,s2 : Agr => Str ; isPre : Bool} ;
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
concrete CountryEng of Country = open CategoriesEng, ParadigmsEng in {
|
||||
|
||||
lincat
|
||||
Country = PN ;
|
||||
Nationality = A ;
|
||||
Language = N ;
|
||||
|
||||
lin
|
||||
Denmark = regPN "Denmark" nonhuman ;
|
||||
England = regPN "England" nonhuman ;
|
||||
Finland = regPN "Finland" nonhuman ;
|
||||
France = regPN "France" nonhuman ;
|
||||
Germany = regPN "Germany" nonhuman ;
|
||||
Italy = regPN "Italy" nonhuman ;
|
||||
Norway = regPN "Norway" nonhuman ;
|
||||
Russia = regPN "Russia" nonhuman ;
|
||||
Spain = regPN "Spain" nonhuman ;
|
||||
Sweden = regPN "Sweden" nonhuman ;
|
||||
|
||||
Danish = regA "Danish" ;
|
||||
English = regA "English" ;
|
||||
|
||||
DanishLang = regN "Danish" ;
|
||||
EnglishLang = regN "English" ;
|
||||
|
||||
|
||||
} ;
|
||||
@@ -1,9 +0,0 @@
|
||||
instance DemResEng of DemRes = open Prelude, ResourceEng, SyntaxEng in {
|
||||
|
||||
oper
|
||||
msS : S -> Str = \x -> x.s ;
|
||||
msQS : QS -> Str = \x -> x.s ! DirQ ;
|
||||
msImp : Imp -> Str = \x -> x.s ! Sg ;
|
||||
|
||||
|
||||
} ;
|
||||
@@ -1,7 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete DemonstrativeEng of Demonstrative =
|
||||
CategoriesEng ** DemonstrativeI with
|
||||
(Resource = ResourceEng),
|
||||
(Basic = BasicEng),
|
||||
(DemRes = DemResEng) ;
|
||||
@@ -1,43 +0,0 @@
|
||||
---- to be merged in TypesEng
|
||||
|
||||
resource DeptypEng = open Prelude, TypesEng in {
|
||||
|
||||
param
|
||||
VComp =
|
||||
CVt_
|
||||
| CVt CComp
|
||||
| CVtN CPrep CComp ;
|
||||
|
||||
CComp =
|
||||
CCtN CPrep
|
||||
| CCtS
|
||||
| CCtV
|
||||
| CCtQ
|
||||
| CCtA ;
|
||||
|
||||
CPrep = CP_ | CP_at | CP_in | CP_on | CP_to ;
|
||||
|
||||
oper
|
||||
strCPrep : CPrep -> Str = \p -> case p of {
|
||||
CP_ => [] ;
|
||||
CP_at => "at" ;
|
||||
CP_in => "in" ;
|
||||
CP_on => "on" ;
|
||||
CP_to => "to"
|
||||
} ;
|
||||
|
||||
cprep1, cprep2 : VComp -> Str -> Str ;
|
||||
|
||||
cprep1 c s = case c of {
|
||||
CVt (CCtN cp) => strCPrep cp ++ s ;
|
||||
CVtN cp _ => strCPrep cp ++ s ;
|
||||
_ => s
|
||||
} ;
|
||||
|
||||
cprep2 c s = case c of {
|
||||
CVtN _ (CCtN cp) => strCPrep cp ++ s ;
|
||||
_ => s
|
||||
} ;
|
||||
|
||||
|
||||
}
|
||||
9
lib/resource/english/English.gf
Normal file
9
lib/resource/english/English.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete English of EnglishAbs =
|
||||
LangEng,
|
||||
IrregEng-[
|
||||
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
|
||||
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V],
|
||||
ExtraEng
|
||||
** {} ;
|
||||
9
lib/resource/english/EnglishAbs.gf
Normal file
9
lib/resource/english/EnglishAbs.gf
Normal file
@@ -0,0 +1,9 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
abstract EnglishAbs =
|
||||
Lang,
|
||||
IrregEngAbs-[
|
||||
blow_V,burn_V,come_V,dig_V,fall_V,fly_V,freeze_V,go_V,lie_V,run_V,
|
||||
sew_V,sing_V,sit_V,sleep_V,spit_V,stand_V,swell_V,swim_V,think_V],
|
||||
ExtraEngAbs
|
||||
** {} ;
|
||||
53
lib/resource/english/ExtraEng.gf
Normal file
53
lib/resource/english/ExtraEng.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete ExtraEng of ExtraEngAbs = CatEng **
|
||||
open ResEng, Coordination, Prelude in {
|
||||
|
||||
lin
|
||||
GenNP np = {s = \\_ => np.s ! Gen} ;
|
||||
ComplBareVS v s = insertObj (\\_ => s.s) (predV v) ;
|
||||
|
||||
StrandRelSlash rp slash = {
|
||||
s = \\t,a,p,_ => rp.s ! RC Acc ++ slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = Acc
|
||||
} ;
|
||||
EmptyRelSlash rp slash = {
|
||||
s = \\t,a,p,_ => slash.s ! t ! a ! p ! ODir ++ slash.c2 ;
|
||||
c = Acc
|
||||
} ;
|
||||
|
||||
StrandQuestSlash ip slash =
|
||||
{s = \\t,a,b,q =>
|
||||
(mkQuestion (ss (ip.s ! Acc)) slash).s ! t ! a ! b ! q ++ slash.c2
|
||||
};
|
||||
|
||||
lincat
|
||||
VPI = {s : VPIForm => Agr => Str} ;
|
||||
[VPI] = {s1,s2 : VPIForm => Agr => Str} ;
|
||||
|
||||
param
|
||||
VPIForm = VPIInf | VPIPPart ;
|
||||
|
||||
lin
|
||||
BaseVPI = twoTable2 VPIForm Agr ;
|
||||
ConsVPI = consrTable2 VPIForm Agr comma ;
|
||||
|
||||
MkVPI vp = {
|
||||
s = \\v,a => vp.ad ++ vp.inf ++ vp.s2 ! a
|
||||
} ;
|
||||
ConjVPI = conjunctTable2 VPIForm Agr ;
|
||||
ComplVPIVV vv vpi =
|
||||
insertObj (\\a => (if_then_Str vv.isAux [] "to") ++ vpi.s ! VPIInf ! a) (predVV vv) ;
|
||||
|
||||
UncNegCl t a cl = {s = t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg ! ODir} ;
|
||||
UncNegQCl t a cl = {s = \\q => t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg !q} ;
|
||||
UncNegRCl t a cl = {
|
||||
s = \\r => t.s ++ a.s ++ cl.s ! t.t ! a.a ! neg ! r ;
|
||||
c = cl.c
|
||||
} ;
|
||||
UncNegImpSg imp = {s = imp.s ! neg ! Sg} ;
|
||||
UncNegImpPl imp = {s = imp.s ! neg ! Pl} ;
|
||||
|
||||
|
||||
oper
|
||||
neg = CNeg False ;
|
||||
|
||||
}
|
||||
12
lib/resource/english/ExtraEngAbs.gf
Normal file
12
lib/resource/english/ExtraEngAbs.gf
Normal file
@@ -0,0 +1,12 @@
|
||||
abstract ExtraEngAbs = Extra ** {
|
||||
|
||||
-- uncontracted negations; contracted are the default
|
||||
fun
|
||||
UncNegCl : Tense -> Ant -> Cl -> S ;
|
||||
UncNegQCl : Tense -> Ant -> QCl -> QS ;
|
||||
UncNegRCl : Tense -> Ant -> RCl -> RS ;
|
||||
|
||||
UncNegImpSg : Imp -> Utt; -- do not help yourself
|
||||
UncNegImpPl : Imp -> Utt; -- do not help yourselves
|
||||
|
||||
}
|
||||
21
lib/resource/english/GrammarEng.gf
Normal file
21
lib/resource/english/GrammarEng.gf
Normal file
@@ -0,0 +1,21 @@
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete GrammarEng of Grammar =
|
||||
NounEng,
|
||||
VerbEng,
|
||||
AdjectiveEng,
|
||||
AdverbEng,
|
||||
NumeralEng,
|
||||
SentenceEng,
|
||||
QuestionEng,
|
||||
RelativeEng,
|
||||
ConjunctionEng,
|
||||
PhraseEng,
|
||||
TextX,
|
||||
StructuralEng,
|
||||
IdiomEng
|
||||
** {
|
||||
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
} ;
|
||||
30
lib/resource/english/IdiomEng.gf
Normal file
30
lib/resource/english/IdiomEng.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
concrete IdiomEng of Idiom = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
ImpersCl vp = mkClause "it" (agrP3 Sg) vp ;
|
||||
GenericCl vp = mkClause "one" (agrP3 Sg) vp ;
|
||||
|
||||
CleftNP np rs = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => rs.s ! np.a)
|
||||
(insertObj (\\_ => np.s ! rs.c) (predAux auxBe))) ;
|
||||
|
||||
CleftAdv ad s = mkClause "it" (agrP3 Sg)
|
||||
(insertObj (\\_ => conjThat ++ s.s)
|
||||
(insertObj (\\_ => ad.s) (predAux auxBe))) ;
|
||||
|
||||
ExistNP np =
|
||||
mkClause "there" (agrP3 np.a.n)
|
||||
(insertObj (\\_ => np.s ! Acc) (predAux auxBe)) ;
|
||||
|
||||
ExistIP ip =
|
||||
mkQuestion (ss (ip.s ! Nom))
|
||||
(mkClause "there" (agrP3 ip.n) (predAux auxBe)) ;
|
||||
|
||||
ProgrVP vp = insertObj (\\a => vp.ad ++ vp.prp ++ vp.s2 ! a) (predAux auxBe) ;
|
||||
|
||||
ImpPl1 vp = {s = "let's" ++ infVP True vp {n = Pl ; p = P1}} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
--# -path=.:../../prelude:../abstract
|
||||
--# -path=.:prelude:../abstract:../common
|
||||
|
||||
concrete VerbsEng of VerbsEngAbs = CategoriesEng ** open ParadigmsEng in {
|
||||
concrete IrregEng of IrregEngAbs = CatEng ** open ParadigmsEng in {
|
||||
|
||||
flags optimize=values ;
|
||||
|
||||
lin
|
||||
awake_V = irregV "awake" "awoke" "awoken" ;
|
||||
@@ -57,7 +59,7 @@ concrete VerbsEng of VerbsEngAbs = CategoriesEng ** open ParadigmsEng in {
|
||||
freeze_V = irregV "freeze" "froze" "frozen" ;
|
||||
get_V = irregDuplV "get" "got" "gotten" ;
|
||||
give_V = irregV "give" "gave" "given" ;
|
||||
go_V = irregV "go" "went" "gone" ;
|
||||
go_V = mkV "go" "goes" "went" "gone" "going" ;
|
||||
grind_V = irregV "grind" "ground" "ground" ;
|
||||
grow_V = irregV "grow" "grew" "grown" ;
|
||||
hang_V = irregV "hang" "hung" "hung" ;
|
||||
@@ -1,7 +1,6 @@
|
||||
abstract VerbsEngAbs = Categories ** {
|
||||
abstract IrregEngAbs = Cat ** {
|
||||
fun
|
||||
awake_V : V ;
|
||||
|
||||
bear_V : V ;
|
||||
beat_V : V ;
|
||||
become_V : V ;
|
||||
@@ -1,26 +1,10 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
-- # -path=.:resource/english:resource/abstract:prelude
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
|
||||
concrete LangEng of Lang =
|
||||
RulesEng,
|
||||
ClauseEng,
|
||||
StructuralEng,
|
||||
BasicEng,
|
||||
TimeEng,
|
||||
CountryEng,
|
||||
MathEng
|
||||
GrammarEng,
|
||||
LexiconEng
|
||||
** {
|
||||
|
||||
** open Prelude, ParadigmsEng in {
|
||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||
|
||||
lin
|
||||
AdvDate d = prefixSS "on" d ;
|
||||
AdvTime t = prefixSS "at" t ;
|
||||
NWeekday w = w ;
|
||||
PNWeekday w = nounPN w ;
|
||||
|
||||
PNCountry x = x ;
|
||||
ANationality x = x ;
|
||||
NLanguage x = x ;
|
||||
|
||||
}
|
||||
} ;
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete LangVPEng of LangVP =
|
||||
LangEng,
|
||||
VerbphraseEng,
|
||||
** {} ;
|
||||
367
lib/resource/english/LexiconEng.gf
Normal file
367
lib/resource/english/LexiconEng.gf
Normal file
@@ -0,0 +1,367 @@
|
||||
--# -path=.:prelude
|
||||
|
||||
concrete LexiconEng of Lexicon = CatEng **
|
||||
open ParadigmsEng, IrregEng, Prelude in {
|
||||
|
||||
flags
|
||||
optimize=values ;
|
||||
|
||||
lin
|
||||
airplane_N = regN "airplane" ;
|
||||
answer_V2S = mkV2S (regV "answer") toP ;
|
||||
apartment_N = regN "apartment" ;
|
||||
apple_N = regN "apple" ;
|
||||
art_N = regN "art" ;
|
||||
ask_V2Q = mkV2Q (regV "ask") noPrep ;
|
||||
baby_N = regN "baby" ;
|
||||
bad_A = mkADeg "bad" "badly" "worse" "worst" ;
|
||||
bank_N = regN "bank" ;
|
||||
beautiful_A = regADeg "beautiful" ;
|
||||
become_VA = mkVA (irregV "become" "became" "become") ;
|
||||
beer_N = regN "beer" ;
|
||||
beg_V2V = mkV2V (regDuplV "beg") noPrep toP ;
|
||||
big_A = duplADeg "big" ;
|
||||
bike_N = regN "bike" ;
|
||||
bird_N = regN "bird" ;
|
||||
black_A = regADeg "black" ;
|
||||
blue_A = 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 (irregV "break" "broke" "broken") ;
|
||||
broad_A = regADeg "broad" ;
|
||||
brother_N2 = regN2 "brother" ;
|
||||
brown_A = regADeg "brown" ;
|
||||
butter_N = regN "butter" ;
|
||||
buy_V2 = dirV2 (irregV "buy" "bought" "bought") ;
|
||||
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 = mk2N "child" "children" ;
|
||||
church_N = regN "church" ;
|
||||
city_N = regN "city" ;
|
||||
clean_A = regADeg "clean" ;
|
||||
clever_A = regADeg "clever" ;
|
||||
close_V2 = dirV2 (regV "close") ;
|
||||
coat_N = regN "coat" ;
|
||||
cold_A = regADeg "cold" ;
|
||||
come_V = (irregV "come" "came" "come") ;
|
||||
computer_N = regN "computer" ;
|
||||
country_N = regN "country" ;
|
||||
cousin_N = regN "cousin" ;
|
||||
cow_N = regN "cow" ;
|
||||
die_V = (regV "die") ;
|
||||
dirty_A = regADeg "dirty" ;
|
||||
distance_N3 = mkN3 (regN "distance") fromP toP ;
|
||||
doctor_N = regN "doctor" ;
|
||||
dog_N = regN "dog" ;
|
||||
door_N = regN "door" ;
|
||||
drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ;
|
||||
easy_A2V = mkA2V (regA "easy") forP ;
|
||||
eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ;
|
||||
empty_A = regADeg "empty" ;
|
||||
enemy_N = regN "enemy" ;
|
||||
factory_N = regN "factory" ;
|
||||
father_N2 = regN2 "father" ;
|
||||
fear_VS = mkVS (regV "fear") ;
|
||||
find_V2 = dirV2 (irregV "find" "found" "found") ;
|
||||
fish_N = mk2N "fish" "fish" ;
|
||||
floor_N = regN "floor" ;
|
||||
forget_V2 = dirV2 (irregDuplV "forget" "forgot" "forgotten") ;
|
||||
fridge_N = regN "fridge" ;
|
||||
friend_N = regN "friend" ;
|
||||
fruit_N = regN "fruit" ;
|
||||
fun_AV = mkAV (regA "fun") ;
|
||||
garden_N = regN "garden" ;
|
||||
girl_N = regN "girl" ;
|
||||
glove_N = regN "glove" ;
|
||||
gold_N = regN "gold" ;
|
||||
good_A = mkADeg "good" "well" "better" "best" ;
|
||||
go_V = mkV "go" "goes" "went" "gone" "going" ;
|
||||
green_A = regADeg "green" ;
|
||||
harbour_N = regN "harbour" ;
|
||||
hate_V2 = dirV2 (regV "hate") ;
|
||||
hat_N = regN "hat" ;
|
||||
have_V2 = dirV2 (mkV "have" "has" "had" "had" "having") ;
|
||||
hear_V2 = dirV2 (irregV "hear" "heard" "heard") ;
|
||||
hill_N = regN "hill" ;
|
||||
hope_VS = mkVS (regV "hope") ;
|
||||
horse_N = regN "horse" ;
|
||||
hot_A = duplADeg "hot" ;
|
||||
house_N = regN "house" ;
|
||||
important_A = compoundADeg (regA "important") ;
|
||||
industry_N = regN "industry" ;
|
||||
iron_N = regN "iron" ;
|
||||
king_N = regN "king" ;
|
||||
know_V2 = dirV2 (irregV "know" "knew" "known") ;
|
||||
lake_N = regN "lake" ;
|
||||
lamp_N = regN "lamp" ;
|
||||
learn_V2 = dirV2 (regV "learn") ;
|
||||
leather_N = regN "leather" ;
|
||||
leave_V2 = dirV2 (irregV "leave" "left" "left") ;
|
||||
like_V2 = dirV2 (regV "like") ;
|
||||
listen_V2 = mkV2 (regV "listen") toP ;
|
||||
live_V = (regV "live") ;
|
||||
long_A = regADeg "long" ;
|
||||
lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
|
||||
love_N = regN "love" ;
|
||||
love_V2 = dirV2 (regV "love") ;
|
||||
man_N = mk2N "man" "men" ;
|
||||
married_A2 = mkA2 (regA "married") toP ;
|
||||
meat_N = regN "meat" ;
|
||||
milk_N = regN "milk" ;
|
||||
moon_N = regN "moon" ;
|
||||
mother_N2 = regN2 "mother" ;
|
||||
mountain_N = regN "mountain" ;
|
||||
music_N = regN "music" ;
|
||||
narrow_A = regADeg "narrow" ;
|
||||
new_A = regADeg "new" ;
|
||||
newspaper_N = regN "newspaper" ;
|
||||
oil_N = regN "oil" ;
|
||||
old_A = regADeg "old" ;
|
||||
open_V2 = dirV2 (regV "open") ;
|
||||
paint_V2A = mkV2A (regV "paint") noPrep ;
|
||||
paper_N = regN "paper" ;
|
||||
paris_PN = regPN "Paris" ;
|
||||
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" ;
|
||||
probable_AS = mkAS (regA "probable") ;
|
||||
queen_N = regN "queen" ;
|
||||
radio_N = regN "radio" ;
|
||||
rain_V0 = mkV0 (regV "rain") ;
|
||||
read_V2 = dirV2 (irregV "read" "read" "read") ;
|
||||
red_A = duplADeg "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 = (irregDuplV "run" "ran" "run") ;
|
||||
say_VS = mkVS (irregV "say" "said" "said") ;
|
||||
school_N = regN "school" ;
|
||||
science_N = regN "science" ;
|
||||
sea_N = regN "sea" ;
|
||||
seek_V2 = dirV2 (irregV "seek" "sought" "sought") ;
|
||||
see_V2 = dirV2 (irregV "see" "saw" "seen") ;
|
||||
sell_V3 = dirV3 (irregV "sell" "sold" "sold") toP ;
|
||||
send_V3 = dirV3 (irregV "send" "sent" "sent") toP ;
|
||||
sheep_N = mk2N "sheep" "sheep" ;
|
||||
ship_N = regN "ship" ;
|
||||
shirt_N = regN "shirt" ;
|
||||
shoe_N = regN "shoe" ;
|
||||
shop_N = regN "shop" ;
|
||||
short_A = regADeg "short" ;
|
||||
silver_N = regN "silver" ;
|
||||
sister_N = regN "sister" ;
|
||||
sleep_V = (irregV "sleep" "slept" "slept") ;
|
||||
small_A = regADeg "small" ;
|
||||
snake_N = regN "snake" ;
|
||||
sock_N = regN "sock" ;
|
||||
speak_V2 = dirV2 (irregV "speak" "spoke" "spoken") ;
|
||||
star_N = regN "star" ;
|
||||
steel_N = regN "steel" ;
|
||||
stone_N = regN "stone" ;
|
||||
stove_N = regN "stove" ;
|
||||
student_N = regN "student" ;
|
||||
stupid_A = regADeg "stupid" ;
|
||||
sun_N = regN "sun" ;
|
||||
switch8off_V2 = dirV2 (partV (regV "switch") "off") ;
|
||||
switch8on_V2 = dirV2 (partV (regV "switch") "on") ;
|
||||
table_N = regN "table" ;
|
||||
talk_V3 = mkV3 (regV "talk") toP aboutP ;
|
||||
teacher_N = regN "teacher" ;
|
||||
teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
|
||||
television_N = regN "television" ;
|
||||
thick_A = regADeg "thick" ;
|
||||
thin_A = duplADeg "thin" ;
|
||||
train_N = regN "train" ;
|
||||
travel_V = (regDuplV "travel") ;
|
||||
tree_N = regN "tree" ;
|
||||
---- trousers_N = regN "trousers" ;
|
||||
ugly_A = regADeg "ugly" ;
|
||||
understand_V2 = dirV2 (irregV "understand" "understood" "understood") ;
|
||||
university_N = regN "university" ;
|
||||
village_N = regN "village" ;
|
||||
wait_V2 = mkV2 (regV "wait") forP ;
|
||||
walk_V = (regV "walk") ;
|
||||
warm_A = regADeg "warm" ;
|
||||
war_N = regN "war" ;
|
||||
watch_V2 = dirV2 (regV "watch") ;
|
||||
water_N = regN "water" ;
|
||||
white_A = regADeg "white" ;
|
||||
window_N = regN "window" ;
|
||||
wine_N = regN "wine" ;
|
||||
win_V2 = dirV2 (irregDuplV "win" "won" "won") ;
|
||||
woman_N = mk2N "woman" "women" ;
|
||||
wonder_VQ = mkVQ (regV "wonder") ;
|
||||
wood_N = regN "wood" ;
|
||||
write_V2 = dirV2 (irregV "write" "wrote" "written") ;
|
||||
yellow_A = regADeg "yellow" ;
|
||||
young_A = regADeg "young" ;
|
||||
|
||||
do_V2 = dirV2 (mkV "do" "does" "did" "done" "doing") ;
|
||||
now_Adv = mkAdv "now" ;
|
||||
already_Adv = mkAdv "already" ;
|
||||
song_N = regN "song" ;
|
||||
add_V3 = dirV3 (regV "add") toP ;
|
||||
number_N = regN "number" ;
|
||||
put_V2 = mkV2 (irregDuplV "put" "put" "put") noPrep ;
|
||||
stop_V = regDuplV "stop" ;
|
||||
jump_V = regV "jump" ;
|
||||
|
||||
left_Ord = ss "left" ;
|
||||
right_Ord = ss "right" ;
|
||||
far_Adv = mkAdv "far" ;
|
||||
correct_A = (regA "correct") ;
|
||||
dry_A = regA "dry" ;
|
||||
dull_A = regA "dull" ;
|
||||
full_A = regA "full" ;
|
||||
heavy_A = regA "heavy" ;
|
||||
near_A = regA "near" ;
|
||||
rotten_A = (regA "rotten") ;
|
||||
round_A = regA "round" ;
|
||||
sharp_A = regA "sharp" ;
|
||||
smooth_A = regA "smooth" ;
|
||||
straight_A = regA "straight" ;
|
||||
wet_A = regA "wet" ; ----
|
||||
wide_A = regA "wide" ;
|
||||
animal_N = regN "animal" ;
|
||||
ashes_N = regN "ash" ; -- FIXME: plural only?
|
||||
back_N = regN "back" ;
|
||||
bark_N = regN "bark" ;
|
||||
belly_N = regN "belly" ;
|
||||
blood_N = regN "blood" ;
|
||||
bone_N = regN "bone" ;
|
||||
breast_N = regN "breast" ;
|
||||
cloud_N = regN "cloud" ;
|
||||
day_N = regN "day" ;
|
||||
dust_N = regN "dust" ;
|
||||
ear_N = regN "ear" ;
|
||||
earth_N = regN "earth" ;
|
||||
egg_N = regN "egg" ;
|
||||
eye_N = regN "eye" ;
|
||||
fat_N = regN "fat" ;
|
||||
feather_N = regN "feather" ;
|
||||
fingernail_N = regN "fingernail" ;
|
||||
fire_N = regN "fire" ;
|
||||
flower_N = regN "flower" ;
|
||||
fog_N = regN "fog" ;
|
||||
foot_N = mk2N "foot" "feet" ;
|
||||
forest_N = regN "forest" ;
|
||||
grass_N = regN "grass" ;
|
||||
guts_N = regN "gut" ; -- FIXME: no singular
|
||||
hair_N = regN "hair" ;
|
||||
hand_N = regN "hand" ;
|
||||
head_N = regN "head" ;
|
||||
heart_N = regN "heart" ;
|
||||
horn_N = regN "horn" ;
|
||||
husband_N = genderN masculine (regN "husband") ;
|
||||
ice_N = regN "ice" ;
|
||||
knee_N = regN "knee" ;
|
||||
leaf_N = mk2N "leaf" "leaves" ;
|
||||
leg_N = regN "leg" ;
|
||||
liver_N = regN "liver" ;
|
||||
louse_N = mk2N "louse" "lice" ;
|
||||
mouth_N = regN "mouth" ;
|
||||
name_N = regN "name" ;
|
||||
neck_N = regN "neck" ;
|
||||
night_N = regN "night" ;
|
||||
nose_N = regN "nose" ;
|
||||
person_N = genderN human (regN "person") ;
|
||||
rain_N = regN "rain" ;
|
||||
road_N = regN "road" ;
|
||||
root_N = regN "root" ;
|
||||
rope_N = regN "rope" ;
|
||||
salt_N = regN "salt" ;
|
||||
sand_N = regN "sand" ;
|
||||
seed_N = regN "seed" ;
|
||||
skin_N = regN "skin" ;
|
||||
sky_N = regN "sky" ;
|
||||
smoke_N = regN "smoke" ;
|
||||
snow_N = regN "snow" ;
|
||||
stick_N = regN "stick" ;
|
||||
tail_N = regN "tail" ;
|
||||
tongue_N = regN "tongue" ;
|
||||
tooth_N = mk2N "tooth" "teeth" ;
|
||||
wife_N = genderN feminine (mk2N "wife" "wives") ;
|
||||
wind_N = regN "wind" ;
|
||||
wing_N = regN "wing" ;
|
||||
worm_N = regN "worm" ;
|
||||
year_N = regN "year" ;
|
||||
blow_V = blow_V ;
|
||||
breathe_V = dirV2 (regV "breathe") ;
|
||||
burn_V = burn_V ;
|
||||
dig_V = dig_V ;
|
||||
fall_V = fall_V ;
|
||||
float_V = regV "float" ;
|
||||
flow_V = regV "flow" ;
|
||||
fly_V = fly_V ;
|
||||
freeze_V = freeze_V ;
|
||||
give_V3 = dirV3 give_V toP ;
|
||||
laugh_V = regV "laugh" ;
|
||||
lie_V = lie_V ;
|
||||
play_V = regV "play" ;
|
||||
sew_V = sew_V ;
|
||||
sing_V = sing_V ;
|
||||
sit_V = sit_V ;
|
||||
smell_V = regV "smell" ;
|
||||
spit_V = spit_V ;
|
||||
stand_V = stand_V ;
|
||||
swell_V = swell_V ;
|
||||
swim_V = swim_V ;
|
||||
think_V = think_V ;
|
||||
turn_V = regV "turn" ;
|
||||
vomit_V = regV "vomit" ;
|
||||
|
||||
bite_V2 = dirV2 bite_V ;
|
||||
count_V2 = dirV2 (regV "count") ;
|
||||
cut_V2 = dirV2 cut_V ;
|
||||
fear_V2 = dirV2 (regV "fear") ;
|
||||
fight_V2 = dirV2 fight_V ;
|
||||
hit_V2 = dirV2 hit_V ;
|
||||
hold_V2 = dirV2 hold_V ;
|
||||
hunt_V2 = dirV2 (regV "hunt") ;
|
||||
kill_V2 = dirV2 (regV "kill") ;
|
||||
pull_V2 = dirV2 (regV "pull") ;
|
||||
push_V2 = dirV2 (regV "push") ;
|
||||
rub_V2 = dirV2 (regDuplV "rub") ;
|
||||
scratch_V2 = dirV2 (regV "scratch") ;
|
||||
split_V2 = dirV2 split_V ;
|
||||
squeeze_V2 = dirV2 (regV "squeeze") ;
|
||||
stab_V2 = dirV2 (regDuplV "stab") ;
|
||||
suck_V2 = dirV2 (regV "suck") ;
|
||||
throw_V2 = dirV2 throw_V ;
|
||||
tie_V2 = dirV2 (regV "tie") ;
|
||||
wash_V2 = dirV2 (regV "wash") ;
|
||||
wipe_V2 = dirV2 (regV "wipe") ;
|
||||
|
||||
-- other_A = regA "other" ;
|
||||
|
||||
grammar_N = regN "grammar" ;
|
||||
language_N = regN "language" ;
|
||||
rule_N = regN "rule" ;
|
||||
|
||||
oper
|
||||
aboutP = mkPrep "about" ;
|
||||
atP = mkPrep "at" ;
|
||||
forP = mkPrep "for" ;
|
||||
fromP = mkPrep "from" ;
|
||||
inP = mkPrep "in" ;
|
||||
onP = mkPrep "on" ;
|
||||
toP = mkPrep "to" ;
|
||||
|
||||
} ;
|
||||
@@ -1,43 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete MathEng of Math = CategoriesEng ** open Prelude, SyntaxEng, ParadigmsEng in {
|
||||
|
||||
lin
|
||||
SymbPN i = {s = \\c => caseSymb c i.s ; g = Neutr} ;
|
||||
IntPN i = {s = \\c => caseSymb c i.s ; g = Neutr} ;
|
||||
IntNP cn i = nameNounPhrase {
|
||||
s = \\c => (cn.s ! Sg ! Nom ++ caseSymb c i.s) ;
|
||||
g = Neutr
|
||||
} ;
|
||||
|
||||
IndefSymbNumNP nu cn xs =
|
||||
addSymbNounPhrase (indefNounPhraseNum plural nu cn) xs.s ;
|
||||
DefSymbNumNP nu cn xs =
|
||||
addSymbNounPhrase (defNounPhraseNum plural nu cn) xs.s ;
|
||||
NDetSymbNP det nu cn xs =
|
||||
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||
|
||||
lincat
|
||||
SymbList = SS ;
|
||||
|
||||
lin
|
||||
SymbTwo = infixSS "and" ;
|
||||
SymbMore = infixSS "," ;
|
||||
|
||||
LetImp x np = {s = \\_ => "let" ++ x.s ! NomP ++ "be" ++ np.s ! NomP} ;
|
||||
ExistNP np = predVerbClause
|
||||
(nameNounPhraseN (fromAgr np.a).n (nameReg "there" Neutr))
|
||||
(regV "exist")
|
||||
(complNounPhrase np) ;
|
||||
|
||||
-- Moved from $RulesEng$.
|
||||
|
||||
SymbCN cn s =
|
||||
{s = \\n,c => cn.s ! n ! Nom ++ caseSymb c s.s ;
|
||||
g = cn.g} ;
|
||||
IntCN cn s =
|
||||
{s = \\n,c => cn.s ! n ! Nom ++ caseSymb c s.s ;
|
||||
g = cn.g} ;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete MinimalEng of Minimal = CategoriesEng ** open ParadigmsEng in {
|
||||
|
||||
flags
|
||||
optimize=all ;
|
||||
|
||||
lin
|
||||
man_N = mk2N "man" "men" ;
|
||||
wine_N = regN "wine" ;
|
||||
mother_N2 = regN2 "mother" ;
|
||||
distance_N3 = mkN3 (regN "distance") "from" "to" ;
|
||||
john_PN = regPN "John" masculine ;
|
||||
blue_ADeg = regADeg "blue" ;
|
||||
american_A = regA "american" ;
|
||||
married_A2 = mkA2 (regA "married") "to" ;
|
||||
probable_AS = mkAS (regA "probable") ;
|
||||
important_A2S = mkA2S (regA "important") "to" ;
|
||||
easy_A2V = mkA2V (regA "easy") "for" ;
|
||||
now_Adv = mkAdv "now" ;
|
||||
walk_V = (regV "walk") ;
|
||||
love_V2 = dirV2 (regV "love") ;
|
||||
give_V3 = dirV3 (irregV "give" "gave" "given") "to" ;
|
||||
believe_VS = mkVS (regV "believe") ;
|
||||
try_VV = mkVV (regV "try") ;
|
||||
wonder_VQ = mkVQ (regV "wonder") ;
|
||||
become_VA = mkVA (irregV "become" "became" "become") ;
|
||||
paint_V2A = mkV2A (regV "paint") [] ;
|
||||
promise_V2V = mkV2V (regV "promise") [] "to" ;
|
||||
ask_V2Q = mkV2Q (regV "ask") [] ;
|
||||
tell_V2S = mkV2S (irregV "tell" "told" "told") [] ;
|
||||
rain_V0 = mkV0 (regV "rain") ;
|
||||
|
||||
} ;
|
||||
@@ -1,52 +0,0 @@
|
||||
module Main where
|
||||
|
||||
import List
|
||||
|
||||
-- create a GF file from a word form list:
|
||||
-- one entry per line, newline or tab separated;
|
||||
-- variants separated by /
|
||||
-- comments are lines starting with --
|
||||
-- example line: bid bid/bade bid/bidden
|
||||
-- example resource: http://www2.gsu.edu/~wwwesl/egw/verbs.htm
|
||||
|
||||
-- parameters, depending on language
|
||||
|
||||
infile = "norwegian/web2.txt"
|
||||
outfile = "Verbs.gf"
|
||||
preamble = ""
|
||||
{-
|
||||
"resource VerbsEng = open ResourceEng, MorphoEng in {\n" ++
|
||||
" oper vIrreg : Str -> Str -> Str -> V = \\x,y,z ->\n" ++
|
||||
" mkVerbIrreg x y z ** {s1 = [] ; lock_V = <>} ;\n\n"
|
||||
-}
|
||||
oper = "irregV"
|
||||
cat = "V"
|
||||
name s = s ++ "_V"
|
||||
|
||||
ending = "}\n"
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
ss <- readFile infile >>= return . filter (not . null) . lines
|
||||
writeFile outfile preamble
|
||||
mapM_ (appendFile outfile . mkOne . words) (filter notComment ss)
|
||||
appendFile outfile ending
|
||||
|
||||
notComment = (/="--") . take 2
|
||||
|
||||
mkOne :: [String] -> String
|
||||
mkOne ws@(v:_) =
|
||||
" fun " ++ name v ++ " : " ++ cat ++ " ;\n" ++
|
||||
" lin " ++ name v ++ " : " ++ cat ++ " = " ++
|
||||
oper ++ " " ++ unwords (map arg ws) ++ " ;\n"
|
||||
where
|
||||
arg w = case variants w of
|
||||
[s] -> quote s
|
||||
vs -> "(variants {" ++
|
||||
unwords (intersperse ";" (map quote vs)) ++ "})"
|
||||
quote s = "\"" ++ s ++ "\""
|
||||
variants = chopBy '/'
|
||||
|
||||
chopBy c s = case span (/= c) s of
|
||||
(w1,_:w2) -> w1 : chopBy c w2
|
||||
(w1,_) -> [w1]
|
||||
@@ -2,14 +2,15 @@
|
||||
|
||||
--1 A Simple English Resource Morphology
|
||||
--
|
||||
-- Aarne Ranta 2002
|
||||
-- Aarne Ranta 2002 -- 2005
|
||||
--
|
||||
-- This resource morphology contains definitions needed in the resource
|
||||
-- syntax. It moreover contains the most usual inflectional patterns.
|
||||
--
|
||||
-- We use the parameter types and word classes defined in $Types.gf$.
|
||||
-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which
|
||||
-- gives a higher-level access to this module.
|
||||
|
||||
resource MorphoEng = TypesEng ** open Prelude, (Predef=Predef) in {
|
||||
resource MorphoEng = ResEng ** open Prelude, (Predef=Predef) in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
--2 Phonology
|
||||
--
|
||||
@@ -27,7 +28,6 @@ oper
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
--2 Nouns
|
||||
--
|
||||
-- For conciseness and abstraction, we define a worst-case macro for
|
||||
@@ -35,20 +35,7 @@ oper
|
||||
-- only need one string as argument.
|
||||
|
||||
oper
|
||||
mkNoun : (_,_,_,_ : Str) -> CommonNoun =
|
||||
\man,men, mans, mens -> {s = table {
|
||||
Sg => table {Nom => man ; Gen => mans} ;
|
||||
Pl => table {Nom => men ; Gen => mens}
|
||||
}} ;
|
||||
|
||||
nounReg : Str -> CommonNoun = \dog ->
|
||||
mkNoun dog (dog + "s") (dog + "'s") (dog + "s'");
|
||||
|
||||
nounS : Str -> CommonNoun = \kiss ->
|
||||
mkNoun kiss (kiss + "es") (kiss + "'s") (kiss + "es'") ;
|
||||
|
||||
nounY : Str -> CommonNoun = \fl ->
|
||||
mkNoun (fl + "y") (fl + "ies") (fl + "y's") (fl + "ies'") ;
|
||||
CommonNoun : Type = {s : Number => Case => Str} ;
|
||||
|
||||
nounGen : Str -> CommonNoun = \dog -> case last dog of {
|
||||
"y" => nounY "dog" ;
|
||||
@@ -56,27 +43,48 @@ oper
|
||||
_ => nounReg "dog"
|
||||
} ;
|
||||
|
||||
-- These are auxiliaries to $nounGen$.
|
||||
|
||||
nounReg : Str -> CommonNoun = \dog ->
|
||||
mkNoun dog (dog + "s") (dog + "'s") (dog + "s'");
|
||||
nounS : Str -> CommonNoun = \kiss ->
|
||||
mkNoun kiss (kiss + "es") (kiss + "'s") (kiss + "es'") ;
|
||||
nounY : Str -> CommonNoun = \fl ->
|
||||
mkNoun (fl + "y") (fl + "ies") (fl + "y's") (fl + "ies'") ;
|
||||
|
||||
|
||||
--3 Proper names
|
||||
--
|
||||
-- Regular proper names are inflected with "'s" in the genitive.
|
||||
|
||||
nameReg : Str -> Gender -> ProperName = \john,g ->
|
||||
{s = table {Nom => john ; Gen => john + "'s"} ; g = g} ;
|
||||
nameReg : Str -> Gender -> {s : Case => Str} = \john,g ->
|
||||
{s = table {Gen => john + "'s" ; _ => john} ; g = g} ;
|
||||
|
||||
--2 Determiners
|
||||
|
||||
mkDeterminer : Number -> Str -> {s : Str ; n : Number} = \n,s ->
|
||||
{s = s ; n = n} ;
|
||||
|
||||
--2 Pronouns
|
||||
--
|
||||
-- Here we define personal and relative pronouns.
|
||||
-- Here we define personal pronouns.
|
||||
--
|
||||
-- We record the form "mine" and the gender for later use.
|
||||
|
||||
Pronoun : Type =
|
||||
{s : Case => Str ; a : Agr ; g : Gender} ;
|
||||
|
||||
mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun =
|
||||
\I,me,my,mine,n,p,g ->
|
||||
{s = table {NomP => I ; AccP => me ; GenP => my ; GenSP => mine} ;
|
||||
n = n ; p = p ; g = g} ;
|
||||
{s = table {Nom => I ; Acc => me ; Gen => my} ;
|
||||
a = {n = n ; p = p} ;
|
||||
g = g
|
||||
} ;
|
||||
|
||||
human : Gender = Masc ; --- doesn't matter
|
||||
|
||||
pronI = mkPronoun "I" "me" "my" "mine" Sg P1 human ;
|
||||
pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb form still OK
|
||||
pronYouSg = mkPronoun "you" "you" "your" "yours" Sg P2 human ; -- verb agr OK
|
||||
pronHe = mkPronoun "he" "him" "his" "his" Sg P3 Masc ;
|
||||
pronShe = mkPronoun "she" "her" "her" "hers" Sg P3 Fem ;
|
||||
pronIt = mkPronoun "it" "it" "its" "it" Sg P3 Neutr ;
|
||||
@@ -85,128 +93,68 @@ oper
|
||||
pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ;
|
||||
pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; ---
|
||||
|
||||
-- Relative pronouns in the accusative have the 'no pronoun' variant.
|
||||
-- The simple pronouns do not really depend on number.
|
||||
|
||||
relPron : RelPron = {s = table {
|
||||
Neutr => \\_ => table {
|
||||
NomP => variants {"that" ; "which"} ;
|
||||
AccP => variants {"that" ; "which" ; []} ;
|
||||
GenP => variants {"whose"} ;
|
||||
GenSP => variants {"which"}
|
||||
} ;
|
||||
_ => \\_ => table {
|
||||
NomP => variants {"that" ; "who"} ;
|
||||
AccP => variants {"that" ; "who" ; "whom" ; []} ;
|
||||
GenP => variants {"whose"} ;
|
||||
GenSP => variants {"whom"}
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
--3 Determiners
|
||||
--
|
||||
-- We have just a heuristic definition of the indefinite article.
|
||||
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
|
||||
-- "o" ("one-sided"), vocalic "u" ("umbrella").
|
||||
|
||||
artIndef = pre {"a" ;
|
||||
"an" / strs {"a" ; "e" ; "i" ; "o" ; "A" ; "E" ; "I" ; "O" }} ;
|
||||
|
||||
artDef = "the" ;
|
||||
|
||||
--2 Adjectives
|
||||
--
|
||||
-- To form the adjectival and the adverbial forms, two strings are needed
|
||||
-- in the worst case.
|
||||
-- in the worst case. (First without degrees.)
|
||||
|
||||
mkAdjective : Str -> Str -> Adjective = \free,freely -> {
|
||||
s = table {
|
||||
AAdj => free ;
|
||||
AAdv => freely
|
||||
}
|
||||
} ;
|
||||
|
||||
-- However, the ending "iy" is sufficient for most cases. This function
|
||||
-- automatically changes the word-final "y" to "i" ("happy" - "happily").
|
||||
Adjective = {s : AForm => Str} ;
|
||||
|
||||
-- However, most adjectives can be inflected using the final character.
|
||||
-- N.B. this is not correct for "shy", but $mkAdjective$ has to be used.
|
||||
|
||||
regAdjective : Str -> Adjective = \free ->
|
||||
let
|
||||
y = Predef.dp 1 free
|
||||
in mkAdjective
|
||||
free
|
||||
(ifTok Str y "y" (Predef.tk 1 free + ("ily")) (free + "ly")) ;
|
||||
|
||||
-- For the comparison of adjectives, six forms are needed to cover all cases.
|
||||
-- But there is no adjective that actually needs all these.
|
||||
|
||||
mkAdjDegrWorst : (_,_,_,_,_,_ : Str) -> AdjDegr =
|
||||
\good,well,better,betterly,best,bestly ->
|
||||
{s = table {
|
||||
Pos => (mkAdjective good well).s ;
|
||||
Comp => (mkAdjective better betterly).s ;
|
||||
Sup => (mkAdjective best bestly).s
|
||||
}
|
||||
} ;
|
||||
|
||||
-- What is usually needed for irregular comparisons are just three forms,
|
||||
-- since the adverbial form is the same (in comparative or superlative)
|
||||
-- or formed in the regular way (positive).
|
||||
|
||||
adjDegrIrreg : (_,_,_ : Str) -> AdjDegr = \bad,worse,worst ->
|
||||
let badly = (regAdjective bad).s ! AAdv
|
||||
in mkAdjDegrWorst bad badly worse worse worst worst ;
|
||||
|
||||
-- Like above, the regular formation takes account of final "y".
|
||||
|
||||
adjDegrReg : Str -> AdjDegr = \happy ->
|
||||
let happi = ifTok Str (Predef.dp 1 happy) "y" (Predef.tk 1 happy + "i") happy
|
||||
in adjDegrIrreg happy (happi + "er") (happi + "est") ;
|
||||
e = last free ;
|
||||
fre = init free ;
|
||||
freely = case e of {
|
||||
"y" => fre + "ily" ;
|
||||
_ => free + "ly"
|
||||
} ;
|
||||
fre = case e of {
|
||||
"e" => fre ;
|
||||
"y" => fre + "i" ;
|
||||
_ => free
|
||||
}
|
||||
in
|
||||
mkAdjective free (fre + "er") (fre + "est") freely ;
|
||||
|
||||
-- Many adjectives are 'inflected' by adding a comparison word.
|
||||
|
||||
adjDegrLong : Str -> AdjDegr = \ridiculous ->
|
||||
adjDegrIrreg ridiculous ("more" ++ ridiculous) ("most" ++ ridiculous) ;
|
||||
adjDegrLong : Str -> Adjective = \ridiculous ->
|
||||
mkAdjective
|
||||
ridiculous
|
||||
("more" ++ ridiculous)
|
||||
("most" ++ ridiculous)
|
||||
((regAdjective ridiculous).s ! AAdv) ;
|
||||
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- Except for "be", the worst case needs four forms.
|
||||
-- The worst case needs five forms. (The verb "be" is treated separately.)
|
||||
|
||||
mkVerbP3worst : (_,_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone,going ->
|
||||
{s = table {
|
||||
InfImp => go ;
|
||||
Indic Sg => goes ;
|
||||
Indic _ => go ;
|
||||
Pastt => went ;
|
||||
PPart => gone ;
|
||||
PresPart => going
|
||||
}
|
||||
} ;
|
||||
|
||||
mkVerbP3 : (_,_,_,_: Str) -> VerbP3 = \go,goes,went,gone ->
|
||||
mkVerb4 : (_,_,_,_: Str) -> Verb = \go,goes,went,gone ->
|
||||
let going = case last go of {
|
||||
"e" => init go + "ing" ;
|
||||
_ => go + "ing"
|
||||
}
|
||||
in
|
||||
mkVerbP3worst go goes went gone going ;
|
||||
mkVerb go goes went gone going ;
|
||||
|
||||
-- This is what we use to derive the irregular forms in almost all cases
|
||||
|
||||
mkVerbIrreg : (_,_,_ : Str) -> VerbP3 = \bite,bit,bitten ->
|
||||
mkVerbIrreg : (_,_,_ : Str) -> Verb = \bite,bit,bitten ->
|
||||
let bites = case last bite of {
|
||||
"y" => y2ie bite "s" ;
|
||||
"s" => init bite + "es" ;
|
||||
_ => bite + "s"
|
||||
}
|
||||
in mkVerbP3 bite bites bit bitten ;
|
||||
in mkVerb4 bite bites bit bitten ;
|
||||
|
||||
-- This is used to derive regular forms.
|
||||
|
||||
mkVerbReg : Str -> VerbP3 = \soak ->
|
||||
mkVerbReg : Str -> Verb = \soak ->
|
||||
let
|
||||
soaks = case last soak of {
|
||||
"y" => y2ie soak "s" ;
|
||||
@@ -218,124 +166,33 @@ oper
|
||||
_ => soak + "ed"
|
||||
}
|
||||
in
|
||||
mkVerbP3 soak soaks soaked soaked ;
|
||||
mkVerb4 soak soaks soaked soaked ;
|
||||
|
||||
mkVerb : (_,_,_ : Str) -> VerbP3 = \ring,rang,rung ->
|
||||
mkVerbP3 ring (ring + "s") rang rung ;
|
||||
|
||||
regVerbP3 : Str -> VerbP3 = \walk ->
|
||||
mkVerb walk (walk + "ed") (walk + "ed") ;
|
||||
|
||||
verbP3s : Str -> VerbP3 = \kiss ->
|
||||
mkVerbP3 kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
||||
|
||||
verbP3e : Str -> VerbP3 = \love ->
|
||||
mkVerbP3 love (love + "s") (love + "d") (love + "d") ;
|
||||
|
||||
verbP3y : Str -> VerbP3 = \cr ->
|
||||
mkVerbP3 (cr + "y") (cr + "ies") (cr + "ied") (cr + "ied") ;
|
||||
|
||||
verbGen : Str -> VerbP3 = \kill -> case last kill of {
|
||||
verbGen : Str -> Verb = \kill -> case last kill of {
|
||||
"y" => verbP3y (init kill) ;
|
||||
"e" => verbP3y (init kill) ;
|
||||
"e" => verbP3e (init kill) ;
|
||||
"s" => verbP3s (init kill) ;
|
||||
_ => regVerbP3 kill
|
||||
} ;
|
||||
|
||||
verbP3Have = mkVerbP3 "have" "has" "had" "had" ;
|
||||
-- These are just auxiliary to $verbGen$.
|
||||
|
||||
verbP3Do = mkVerbP3 "do" "does" "did" "done" ;
|
||||
regVerbP3 : Str -> Verb = \walk ->
|
||||
mkVerbIrreg walk (walk + "ed") (walk + "ed") ;
|
||||
verbP3s : Str -> Verb = \kiss ->
|
||||
mkVerb4 kiss (kiss + "es") (kiss + "ed") (kiss + "ed") ;
|
||||
verbP3e : Str -> Verb = \love ->
|
||||
mkVerb4 love (love + "s") (love + "d") (love + "d") ;
|
||||
verbP3y : Str -> Verb = \cr ->
|
||||
mkVerb4 (cr + "y") (cr + "ies") (cr + "ied") (cr + "ied") ;
|
||||
|
||||
auxVerbBe : AuxVerb = {s = table {
|
||||
AInfImp => "be" ;
|
||||
AIndic P1 b => if_then_Str b "am" ["am not"] ;
|
||||
AIndic P2 b => negAux b "are" ;
|
||||
AIndic P3 b => negAux b "is" ;
|
||||
APastt Sg b => negAux b "was" ;
|
||||
APastt Pl b => negAux b "were" ;
|
||||
APPart => "been" ;
|
||||
APresPart => "being"
|
||||
}
|
||||
} ;
|
||||
--- The particle always appears right after the verb.
|
||||
|
||||
-- The negative forms are not used;
|
||||
--- the particle $want.s1$ disappears - is it ever needed?
|
||||
verbPart : Verb -> Str -> Verb = \v,p ->
|
||||
{s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ;
|
||||
|
||||
verb2aux : Verb -> AuxVerb = \want -> {s = table {
|
||||
AInfImp => want.s ! InfImp ;
|
||||
AIndic P3 b => want.s ! Indic Sg ;
|
||||
AIndic _ b => want.s ! Indic Pl ;
|
||||
APastt _ b => want.s ! Pastt ;
|
||||
APPart => want.s ! PPart ;
|
||||
APresPart => want.s ! PresPart
|
||||
}
|
||||
} ;
|
||||
verbNoPart : Verb -> Verb = \v -> verbPart v [] ;
|
||||
|
||||
aux2verb : AuxVerb -> Verb = \want -> {s = table {
|
||||
InfImp => want.s ! AInfImp ;
|
||||
Indic Sg => want.s ! AIndic P3 True ;
|
||||
Indic _ => want.s ! AIndic P2 True ;
|
||||
Pastt => want.s ! APastt Pl True ;
|
||||
PPart => want.s ! APPart ;
|
||||
PresPart => want.s ! APresPart
|
||||
} ;
|
||||
s1 = []
|
||||
} ;
|
||||
|
||||
-- The three most important example auxiliaries.
|
||||
|
||||
mkVerbAux : (_,_,_,_: Str) -> AuxVerb = \beable, can, could, beenable ->
|
||||
{s = table {
|
||||
AInfImp => beable ;
|
||||
AIndic _ b => negAux b can ;
|
||||
APastt _ b => negAux b could ;
|
||||
APPart => beenable ;
|
||||
APrepPart => nonExist ---- fix!
|
||||
} ;
|
||||
} ;
|
||||
|
||||
|
||||
verbPart : VerbP3 -> Particle -> Verb = \v,p ->
|
||||
v ** {s1 = p} ;
|
||||
|
||||
verbNoPart : VerbP3 -> Verb = \v -> verbPart v [] ;
|
||||
|
||||
negAux : Bool -> Str -> Str = \b,is -> if_then_Str b is (is + "n't") ;
|
||||
|
||||
-- The optional negation contraction is a useful macro e.g. for "do".
|
||||
|
||||
contractNot : Str -> Str = \is -> variants {is ++ "not" ; is + "n't"} ;
|
||||
|
||||
dont = contractNot (verbP3Do.s ! InfImp) ;
|
||||
|
||||
-- From $numerals$.
|
||||
|
||||
param
|
||||
DForm = unit | teen | ten ;
|
||||
CardOrd = NCard | NOrd ;
|
||||
|
||||
oper
|
||||
mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
||||
\two -> \twelve -> \twenty -> \second ->
|
||||
{s = table {
|
||||
unit => table {NCard => two ; NOrd => second} ;
|
||||
teen => \\c => mkCard c twelve ;
|
||||
ten => \\c => mkCard c twenty
|
||||
}
|
||||
} ;
|
||||
|
||||
regNum : Str -> {s : DForm => CardOrd => Str} =
|
||||
\six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ;
|
||||
|
||||
regCardOrd : Str -> {s : CardOrd => Str} = \ten ->
|
||||
{s = table {NCard => ten ; NOrd => regOrd ten}} ;
|
||||
|
||||
mkCard : CardOrd -> Str -> Str = \c,ten -> (regCardOrd ten).s ! c ;
|
||||
|
||||
regOrd : Str -> Str = \ten -> case last ten of {
|
||||
"y" => init ten + "ieth" ;
|
||||
_ => ten + "th"
|
||||
} ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete MultimodalEng of Multimodal =
|
||||
RulesEng, StructuralEng, BasicEng, TimeEng, DemonstrativeEng ** MultimodalI with
|
||||
(Resource = ResourceEng),
|
||||
(Basic = BasicEng),
|
||||
(Lang = LangEng),
|
||||
(DemRes = DemResEng) ;
|
||||
83
lib/resource/english/NounEng.gf
Normal file
83
lib/resource/english/NounEng.gf
Normal file
@@ -0,0 +1,83 @@
|
||||
concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
DetCN det cn = {
|
||||
s = \\c => det.s ++ cn.s ! det.n ! c ;
|
||||
a = agrP3 det.n
|
||||
} ;
|
||||
UsePN pn = pn ** {a = agrP3 Sg} ;
|
||||
UsePron p = p ;
|
||||
|
||||
PredetNP pred np = {
|
||||
s = \\c => pred.s ++ np.s ! c ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
PPartNP np v2 = {
|
||||
s = \\c => np.s ! c ++ v2.s ! VPPart ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
AdvNP np adv = {
|
||||
s = \\c => np.s ! c ++ adv.s ;
|
||||
a = np.a
|
||||
} ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s = quant.s ++ ord.s ;
|
||||
n = Sg
|
||||
} ;
|
||||
|
||||
DetPl quant num ord = {
|
||||
s = quant.s ++ num.s ++ ord.s ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
SgQuant quant = {s = quant.s ! Sg} ;
|
||||
PlQuant quant = {s = quant.s ! Pl} ;
|
||||
|
||||
PossPron p = {s = \\_ => p.s ! Gen} ;
|
||||
|
||||
NoNum, NoOrd = {s = []} ;
|
||||
|
||||
NumInt n = n ;
|
||||
OrdInt n = {s = n.s ++ "th"} ; ---
|
||||
|
||||
NumNumeral numeral = {s = numeral.s ! NCard} ;
|
||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||
|
||||
AdNum adn num = {s = adn.s ++ num.s} ;
|
||||
|
||||
OrdSuperl a = {s = a.s ! AAdj Superl} ;
|
||||
|
||||
DefArt = {s = \\_ => artDef} ;
|
||||
|
||||
IndefArt = {
|
||||
s = table {
|
||||
Sg => artIndef ;
|
||||
Pl => []
|
||||
}
|
||||
} ;
|
||||
|
||||
MassDet = {s = [] ; n = Sg} ;
|
||||
|
||||
UseN n = n ;
|
||||
UseN2 n = n ;
|
||||
UseN3 n = n ;
|
||||
|
||||
ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c} ;
|
||||
ComplN3 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; c2 = f.c3} ;
|
||||
|
||||
AdjCN ap cn = {
|
||||
s = \\n,c => preOrPost ap.isPre (ap.s ! agrP3 n) (cn.s ! n ! c)
|
||||
} ;
|
||||
RelCN cn rs = {s = \\n,c => cn.s ! n ! c ++ rs.s ! {n = n ; p = P3}} ;
|
||||
AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
|
||||
|
||||
SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
|
||||
|
||||
ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! c} ;
|
||||
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
concrete NumeralsEng of Numerals = open Prelude, MorphoEng in {
|
||||
concrete NumeralEng of Numeral = CatEng ** open ResEng in {
|
||||
|
||||
lincat Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
lincat Digit = {s : DForm => CardOrd => Str} ;
|
||||
lincat
|
||||
Digit = {s : DForm => CardOrd => Str} ;
|
||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
||||
Sub100 = {s : CardOrd => Str ; n : Number} ;
|
||||
Sub1000 = {s : CardOrd => Str ; n : Number} ;
|
||||
@@ -1,300 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 English Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2003
|
||||
--
|
||||
-- This is an API to the user of the resource grammar
|
||||
-- for adding lexical items. It give shortcuts for forming
|
||||
-- expressions of basic categories: nouns, adjectives, verbs.
|
||||
--
|
||||
-- Closed categories (determiners, pronouns, conjunctions) are
|
||||
-- accessed through the resource syntax API, $Structural.gf$.
|
||||
--
|
||||
-- The main difference with $MorphoEng.gf$ is that the types
|
||||
-- referred to are compiled resource grammar types. We have moreover
|
||||
-- had the design principle of always having existing forms, rather
|
||||
-- than stems, as string
|
||||
-- arguments of the paradigms.
|
||||
--
|
||||
-- The following modules are presupposed:
|
||||
|
||||
resource OldParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng, ResourceEng in {
|
||||
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
|
||||
oper
|
||||
Gender : Type ;
|
||||
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
Number : Type ;
|
||||
|
||||
singular : Number ;
|
||||
plural : Number ;
|
||||
|
||||
-- To abstract over case names, we define the following.
|
||||
Case : Type ;
|
||||
|
||||
nominative : Case ;
|
||||
genitive : Case ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Worst case: give all four forms and the semantic gender.
|
||||
-- In practice the worst case is just: give singular and plural nominative.
|
||||
|
||||
oper
|
||||
mkN : (man,men,man's,men's : Str) -> Gender -> N ;
|
||||
nMan : (man,men : Str) -> Gender -> N ;
|
||||
|
||||
-- Regular nouns, nouns ending with "s", "y", or "o", and nouns with the same
|
||||
-- plural form as the singular.
|
||||
|
||||
nReg : Str -> Gender -> N ; -- dog, dogs
|
||||
nKiss : Str -> Gender -> N ; -- kiss, kisses
|
||||
nFly : Str -> Gender -> N ; -- fly, flies
|
||||
nHero : Str -> Gender -> N ; -- hero, heroes (= nKiss !)
|
||||
nSheep : Str -> Gender -> N ; -- sheep, sheep
|
||||
|
||||
-- These use general heuristics, that recognizes the last letter. *N.B* it
|
||||
-- does not get right with "boy", "rush", since it only looks at one letter.
|
||||
|
||||
nHuman : Str -> N ; -- gambler/actress/nanny
|
||||
nNonhuman : Str -> N ; -- dog/kiss/fly
|
||||
|
||||
-- Nouns used as functions need a preposition. The most common is "of".
|
||||
|
||||
mkN2 : N -> Preposition -> N2 ;
|
||||
|
||||
funHuman : Str -> N2 ; -- the father/mistress/daddy of
|
||||
funNonhuman : Str -> N2 ; -- the successor/address/copy of
|
||||
|
||||
-- Proper names, with their regular genitive.
|
||||
|
||||
pnReg : (John : Str) -> PN ; -- John, John's
|
||||
|
||||
-- The most common cases on the higher-level category $CN$ have shortcuts.
|
||||
-- The regular "y"/"s" variation is taken into account.
|
||||
|
||||
cnNonhuman : Str -> CN ;
|
||||
cnHuman : Str -> CN ;
|
||||
npReg : Str -> NP ;
|
||||
|
||||
-- In some cases, you may want to make a complex $CN$ into a function.
|
||||
|
||||
mkN2CN : CN -> Preposition -> N2 ;
|
||||
funOfCN : CN -> N2 ;
|
||||
|
||||
|
||||
--2 Adjectives
|
||||
|
||||
-- Non-comparison one-place adjectives just have one form.
|
||||
|
||||
mkA : (even : Str) -> A ;
|
||||
|
||||
-- Two-place adjectives need a preposition as second argument.
|
||||
|
||||
mkA2 : (divisible, by : Str) -> A2 ;
|
||||
|
||||
-- Comparison adjectives have three forms. The common irregular
|
||||
-- cases are ones ending with "y" and a consonant that is duplicated;
|
||||
-- the "y" ending is recognized by the function $aReg$.
|
||||
|
||||
mkADeg : (good,better,best : Str) -> ADeg ;
|
||||
|
||||
aReg : (long : Str) -> ADeg ; -- long, longer, longest
|
||||
aFat : (fat : Str) -> ADeg ; -- fat, fatter, fattest
|
||||
aRidiculous : (ridiculous : Str) -> ADeg ; -- -/more/most ridiculous
|
||||
|
||||
-- On higher level, there are adjectival phrases. The most common case is
|
||||
-- just to use a one-place adjective.
|
||||
|
||||
apReg : Str -> AP ;
|
||||
|
||||
--2 Adverbs
|
||||
|
||||
-- Adverbs are not inflected. Most lexical ones have position not
|
||||
-- before the verb. Some can be preverbal (e.g. "always").
|
||||
|
||||
mkAdv : Str -> Adv ;
|
||||
mkAdvPre : Str -> Adv ;
|
||||
|
||||
-- Adverbs modifying adjectives and sentences can also be formed.
|
||||
|
||||
mkAdA : Str -> AdA ;
|
||||
mkAdC : Str -> AdC ;
|
||||
|
||||
-- Prepositional phrases are another productive form of adverbials.
|
||||
|
||||
mkPP : Str -> NP -> Adv ;
|
||||
|
||||
--2 Verbs
|
||||
--
|
||||
-- The fragment now has all verb forms, except the gerund/present participle.
|
||||
-- Except for "be", the worst case needs four forms: the infinitive and
|
||||
-- the third person singular present, the past indicative, and the past participle.
|
||||
|
||||
mkV : (go, goes, went, gone : Str) -> V ;
|
||||
|
||||
vReg : (walk : Str) -> V ; -- walk, walks
|
||||
vKiss : (kiss : Str) -> V ; -- kiss, kisses
|
||||
vFly : (fly : Str) -> V ; -- fly, flies
|
||||
vGo : (go : Str) -> V ; -- go, goes (= vKiss !)
|
||||
|
||||
-- This generic function recognizes the special cases where the last
|
||||
-- character is "y", "s", or "z". It is not right for "finish" and "convey".
|
||||
|
||||
vGen : Str -> V ; -- walk/kiss/fly
|
||||
|
||||
-- The verbs "be" and "have" are special.
|
||||
|
||||
---- vBe : V ;
|
||||
vHave : V ;
|
||||
|
||||
-- Verbs with a particle.
|
||||
|
||||
vPart : (go, goes, went, gone, up : Str) -> V ;
|
||||
vPartReg : (get, up : Str) -> V ;
|
||||
|
||||
-- Two-place verbs, and the special case with direct object.
|
||||
-- Notice that a particle can already be included in $V$.
|
||||
|
||||
mkV2 : V -> Str -> V2 ; -- look for, kill
|
||||
|
||||
tvGen : (look, for : Str) -> V2 ; -- look for, talk about
|
||||
tvDir : V -> V2 ; -- switch off
|
||||
tvGenDir : (kill : Str) -> V2 ; -- kill
|
||||
|
||||
-- Regular two-place verbs with a particle.
|
||||
|
||||
tvPartReg : Str -> Str -> Str -> V2 ; -- get, along, with
|
||||
|
||||
-- Ditransitive verbs.
|
||||
|
||||
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
||||
v3Dir : V -> Str -> V3 ; -- give,_,to
|
||||
v3DirDir : V -> V3 ; -- give,_,_
|
||||
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
--.
|
||||
|
||||
Gender = SyntaxEng.Gender ;
|
||||
Number = SyntaxEng.Number ;
|
||||
Case = SyntaxEng.Case ;
|
||||
human = Masc ;
|
||||
nonhuman = Neutr ;
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
nominative = Nom ;
|
||||
genitive = Nom ;
|
||||
|
||||
mkN = \man,men,man's,men's,g ->
|
||||
mkNoun man men man's men's ** {g = g ; lock_N = <>} ;
|
||||
nReg a g = addGenN nounReg a g ;
|
||||
nKiss n g = addGenN nounS n g ;
|
||||
nFly = \fly -> addGenN nounY (Predef.tk 1 fly) ;
|
||||
nMan = \man,men -> mkN man men (man + "'s") (men + "'s") ;
|
||||
nHero = nKiss ;
|
||||
nSheep = \sheep -> nMan sheep sheep ;
|
||||
|
||||
nHuman = \s -> nGen s human ;
|
||||
nNonhuman = \s -> nGen s nonhuman ;
|
||||
|
||||
nGen : Str -> Gender -> N = \fly,g -> let {
|
||||
fl = Predef.tk 1 fly ;
|
||||
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} ;
|
||||
funNonhuman = \s -> mkN2 (nNonhuman s) "of" ;
|
||||
funHuman = \s -> mkN2 (nHuman s) "of" ;
|
||||
|
||||
pnReg n = nameReg n human ** {lock_PN = <>} ;
|
||||
|
||||
cnNonhuman = \s -> UseN (nGen s nonhuman) ;
|
||||
cnHuman = \s -> UseN (nGen s human) ;
|
||||
npReg = \s -> UsePN (pnReg s) ;
|
||||
|
||||
mkN2CN = \n,p -> n ** {lock_N2 = <> ; s2 = p} ;
|
||||
funOfCN = \n -> mkN2CN n "of" ;
|
||||
|
||||
addGenN : (Str -> CommonNoun) -> Str -> Gender -> N = \f ->
|
||||
\s,g -> f s ** {g = g ; lock_N = <>} ;
|
||||
|
||||
mkA a = regAdjective a ** {lock_A = <>} ;
|
||||
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 {
|
||||
"y" => mkADeg s (init s + "ier") (init s + "iest") ;
|
||||
"e" => mkADeg s (s + "r") (s + "st") ;
|
||||
_ => aReg s
|
||||
} ;
|
||||
|
||||
mkAdv a = ss a ** {lock_Adv = <>} ;
|
||||
mkAdvPre a = ss a ** {lock_Adv = <>} ;
|
||||
mkPP x y = prepPhrase x y ** {lock_Adv = <>} ;
|
||||
mkAdA a = ss a ** {lock_AdA = <>} ;
|
||||
mkAdC a = ss a ** {lock_AdC = <>} ;
|
||||
|
||||
mkV = \go,goes,went,gone -> verbNoPart (mkVerbP3 go goes went gone) **
|
||||
{lock_V = <>} ;
|
||||
vReg = \walk -> mkV walk (walk + "s") (walk + "ed") (walk + "ed") ;
|
||||
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 {
|
||||
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 ->
|
||||
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} ;
|
||||
tvPartReg = \get, along, to -> mkV2 (vPartReg get along) to ;
|
||||
|
||||
vHave = verbP3Have ** {s1 = [] ; lock_V = <>} ;
|
||||
|
||||
tvGen = \s,p -> mkV2 (vGen s) p ;
|
||||
tvDir = \v -> mkV2 v [] ;
|
||||
tvGenDir = \s -> tvDir (vGen s) ;
|
||||
|
||||
mkV3 x y z = mkDitransVerb x y z ** {lock_V3 = <>} ;
|
||||
v3Dir x y = mkV3 x [] y ;
|
||||
v3DirDir x = v3Dir x [] ;
|
||||
|
||||
-- these are used in the generated lexicon
|
||||
noun : Str -> N = nNonhuman ;
|
||||
|
||||
verb2 : Str -> Str -> V2 = \v -> mkV2 (vGen v) ;
|
||||
verb3 : Str -> Str -> Str -> V3 = \v -> mkV3 (vGen v) ;
|
||||
|
||||
} ;
|
||||
@@ -1,10 +1,10 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -path=.:../abstract:../../prelude:../common
|
||||
|
||||
--1 English Lexical Paradigms
|
||||
--
|
||||
-- Aarne Ranta 2003
|
||||
-- Aarne Ranta 2003--2005
|
||||
--
|
||||
-- This is an API to the user of the resource grammar
|
||||
-- This is an API for the user of the resource grammar
|
||||
-- for adding lexical items. It gives functions for forming
|
||||
-- expressions of open categories: nouns, adjectives, verbs.
|
||||
--
|
||||
@@ -21,13 +21,15 @@
|
||||
-- regular cases. Then we give a worst-case function $mkC$, which serves as an
|
||||
-- escape to construct the most irregular words of type $C$.
|
||||
-- However, this function should only seldom be needed: we have a
|
||||
-- separate module $IrregularEng$, which covers all irregularly inflected
|
||||
-- words.
|
||||
--
|
||||
-- The following modules are presupposed:
|
||||
-- separate module [``IrregEng`` ../../english/IrregEng.gf],
|
||||
-- which covers irregular verbss.
|
||||
|
||||
resource ParadigmsEng = open (Predef=Predef), Prelude, SyntaxEng,
|
||||
CategoriesEng, RulesEng in {
|
||||
resource ParadigmsEng = open
|
||||
(Predef=Predef),
|
||||
Prelude,
|
||||
MorphoEng,
|
||||
CatEng
|
||||
in {
|
||||
--2 Parameters
|
||||
--
|
||||
-- To abstract over gender names, we define the following identifiers.
|
||||
@@ -38,7 +40,6 @@ oper
|
||||
human : Gender ;
|
||||
nonhuman : Gender ;
|
||||
masculine : Gender ;
|
||||
feminite : Gender ;
|
||||
|
||||
-- To abstract over number names, we define the following.
|
||||
|
||||
@@ -55,13 +56,13 @@ oper
|
||||
genitive : Case ;
|
||||
|
||||
-- Prepositions are used in many-argument functions for rection.
|
||||
-- The resource category $Prep$ is used.
|
||||
|
||||
Preposition : Type ;
|
||||
|
||||
|
||||
--2 Nouns
|
||||
|
||||
-- Worst case: give all four forms and the semantic gender.
|
||||
-- Worst case: give all four forms.
|
||||
|
||||
mkN : (man,men,man's,men's : Str) -> N ;
|
||||
|
||||
@@ -83,27 +84,29 @@ oper
|
||||
|
||||
--3 Compound nouns
|
||||
--
|
||||
-- All the functions above work quite as well to form compound nouns,
|
||||
-- such as "baby boom".
|
||||
-- A compound noun ia an uninflected string attached to an inflected noun,
|
||||
-- such as "baby boom", "chief executive officer".
|
||||
|
||||
compoundN : Str -> N -> N ;
|
||||
|
||||
|
||||
--3 Relational nouns
|
||||
--
|
||||
-- Relational nouns ("daughter of x") need a preposition.
|
||||
|
||||
mkN2 : N -> Preposition -> N2 ;
|
||||
mkN2 : N -> Prep -> N2 ;
|
||||
|
||||
-- The most common preposition is "of", and the following is a
|
||||
-- shortcut for regular, $nonhuman$ relational nouns with "of".
|
||||
-- shortcut for regular relational nouns with "of".
|
||||
|
||||
regN2 : Str -> N2 ;
|
||||
|
||||
-- Use the function $mkPreposition$ or see the section on prepositions below to
|
||||
-- Use the function $mkPrep$ or see the section on prepositions below to
|
||||
-- form other prepositions.
|
||||
--
|
||||
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
|
||||
|
||||
mkN3 : N -> Preposition -> Preposition -> N3 ;
|
||||
mkN3 : N -> Prep -> Prep -> N3 ;
|
||||
|
||||
|
||||
--3 Relational common noun phrases
|
||||
@@ -111,15 +114,16 @@ oper
|
||||
-- In some cases, you may want to make a complex $CN$ into a
|
||||
-- relational noun (e.g. "the old town hall of").
|
||||
|
||||
cnN2 : CN -> Preposition -> N2 ;
|
||||
cnN3 : CN -> Preposition -> Preposition -> N3 ;
|
||||
cnN2 : CN -> Prep -> N2 ;
|
||||
cnN3 : CN -> Prep -> Prep -> N3 ;
|
||||
|
||||
--
|
||||
--3 Proper names and noun phrases
|
||||
--
|
||||
-- Proper names, with a regular genitive, are formed as follows
|
||||
|
||||
regPN : Str -> Gender -> PN ; -- John, John's
|
||||
regPN : Str -> PN ;
|
||||
regGenPN : Str -> Gender -> PN ; -- John, John's
|
||||
|
||||
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
|
||||
|
||||
@@ -146,10 +150,12 @@ oper
|
||||
--
|
||||
-- Two-place adjectives need a preposition for their second argument.
|
||||
|
||||
mkA2 : A -> Preposition -> A2 ;
|
||||
mkA2 : A -> Prep -> A2 ;
|
||||
|
||||
-- Comparison adjectives may two more forms.
|
||||
|
||||
ADeg : Type ;
|
||||
|
||||
mkADeg : (good,better,best,well : Str) -> ADeg ;
|
||||
|
||||
-- The regular pattern recognizes two common variations:
|
||||
@@ -163,7 +169,7 @@ oper
|
||||
|
||||
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:
|
||||
|
||||
compoundADeg : A -> ADeg ; -- -/more/most ridiculous
|
||||
@@ -190,8 +196,8 @@ oper
|
||||
-- A preposition as used for rection in the lexicon, as well as to
|
||||
-- build $PP$s in the resource API, just requires a string.
|
||||
|
||||
mkPreposition : Str -> Preposition ;
|
||||
mkPrep : Str -> Prep ;
|
||||
mkPrep : Str -> Prep ;
|
||||
noPrep : Prep ;
|
||||
|
||||
-- (These two functions are synonyms.)
|
||||
|
||||
@@ -229,12 +235,18 @@ oper
|
||||
|
||||
partV : V -> Str -> V ;
|
||||
|
||||
--3 Reflexive verbs
|
||||
--
|
||||
-- By default, verbs are not reflexive; this function makes them that.
|
||||
|
||||
reflV : V -> V ;
|
||||
|
||||
--3 Two-place verbs
|
||||
--
|
||||
-- Two-place verbs need a preposition, except the special case with direct object.
|
||||
-- (transitive verbs). Notice that a particle comes from the $V$.
|
||||
|
||||
mkV2 : V -> Preposition -> V2 ;
|
||||
mkV2 : V -> Prep -> V2 ;
|
||||
|
||||
dirV2 : V -> V2 ;
|
||||
|
||||
@@ -243,9 +255,9 @@ oper
|
||||
-- Three-place (ditransitive) verbs need two prepositions, of which
|
||||
-- the first one or both can be absent.
|
||||
|
||||
mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
|
||||
dirV3 : V -> Str -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
|
||||
dirV3 : V -> Prep -> V3 ; -- give,_,to
|
||||
dirdirV3 : V -> V3 ; -- give,_,_
|
||||
|
||||
--3 Other complement patterns
|
||||
--
|
||||
@@ -254,29 +266,36 @@ oper
|
||||
|
||||
mkV0 : V -> V0 ;
|
||||
mkVS : V -> VS ;
|
||||
mkV2S : V -> Str -> V2S ;
|
||||
mkV2S : V -> Prep -> V2S ;
|
||||
mkVV : V -> VV ;
|
||||
mkV2V : V -> Str -> Str -> V2V ;
|
||||
mkV2V : V -> Prep -> Prep -> V2V ;
|
||||
mkVA : V -> VA ;
|
||||
mkV2A : V -> Str -> V2A ;
|
||||
mkV2A : V -> Prep -> V2A ;
|
||||
mkVQ : V -> VQ ;
|
||||
mkV2Q : V -> Str -> V2Q ;
|
||||
mkV2Q : V -> Prep -> V2Q ;
|
||||
|
||||
mkAS : A -> AS ;
|
||||
mkA2S : A -> Str -> A2S ;
|
||||
mkA2S : A -> Prep -> A2S ;
|
||||
mkAV : A -> AV ;
|
||||
mkA2V : A -> Str -> A2V ;
|
||||
mkA2V : A -> Prep -> A2V ;
|
||||
|
||||
-- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated
|
||||
-- just as synonyms of $V2$, and the second argument is given
|
||||
-- as an adverb. Likewise $AS, A2S, AV, A2V$ are just $A$.
|
||||
-- $V0$ is just $V$.
|
||||
|
||||
V0, V2S, V2V, V2A, V2Q : Type ;
|
||||
AS, A2S, AV, A2V : Type ;
|
||||
|
||||
--.
|
||||
--2 Definitions of paradigms
|
||||
--
|
||||
-- The definitions should not bother the user of the API. So they are
|
||||
-- hidden from the document.
|
||||
--.
|
||||
|
||||
Gender = SyntaxEng.Gender ;
|
||||
Number = SyntaxEng.Number ;
|
||||
Case = SyntaxEng.Case ;
|
||||
Gender = MorphoEng.Gender ;
|
||||
Number = MorphoEng.Number ;
|
||||
Case = MorphoEng.Case ;
|
||||
human = Masc ;
|
||||
nonhuman = Neutr ;
|
||||
masculine = Masc ;
|
||||
@@ -286,7 +305,7 @@ oper
|
||||
nominative = Nom ;
|
||||
genitive = Gen ;
|
||||
|
||||
Preposition = Str ;
|
||||
Preposition : Type = Str ; -- obsolete
|
||||
|
||||
regN = \ray ->
|
||||
let
|
||||
@@ -318,27 +337,32 @@ oper
|
||||
mkN man men (man + "'s") mens ;
|
||||
|
||||
mkN = \man,men,man's,men's ->
|
||||
mkNoun man men man's men's ** {g = Neutr ; lock_N = <>} ;
|
||||
mkNoun man man's men men's ** {g = Neutr ; lock_N = <>} ;
|
||||
|
||||
genderN g man = {s = man.s ; g = g ; lock_N = <>} ;
|
||||
|
||||
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} ;
|
||||
compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ;
|
||||
|
||||
regPN n g = nameReg n g ** {lock_PN = <>} ;
|
||||
mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||
regN2 n = mkN2 (regN n) (mkPrep "of") ;
|
||||
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||
cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
|
||||
cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
|
||||
|
||||
regPN n = regGenPN n human ;
|
||||
regGenPN n g = nameReg n g ** {lock_PN = <>} ;
|
||||
nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
|
||||
mkNP x y n g = {s = table {GenP => x ; _ => y} ; a = toAgr n P3 g ;
|
||||
mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = agrP3 n ;
|
||||
lock_NP = <>} ;
|
||||
|
||||
mkA a b = mkAdjective a b ** {lock_A = <>} ;
|
||||
mkA a b = mkAdjective a a a b ** {lock_A = <>} ;
|
||||
regA a = regAdjective a ** {lock_A = <>} ;
|
||||
|
||||
mkA2 a p = a ** {s2 = p ; lock_A2 = <>} ;
|
||||
mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ;
|
||||
|
||||
mkADeg a b c d = mkAdjDegrWorst a b c c d d ** {lock_ADeg = <>} ;
|
||||
ADeg = A ; ----
|
||||
|
||||
mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ;
|
||||
|
||||
regADeg happy =
|
||||
let
|
||||
@@ -353,22 +377,26 @@ oper
|
||||
"y" => happ + "ily" ;
|
||||
_ => happy + "ly"
|
||||
} ;
|
||||
in mkADeg happy happily (happie + "r") (happie + "st") ;
|
||||
in mkADeg happy (happie + "r") (happie + "st") happily ;
|
||||
|
||||
duplADeg fat = mkADeg fat
|
||||
(fat + "ly") (fat + last fat + "er") (fat + last fat + "est") ;
|
||||
compoundADeg a = let ad = (a.s ! AAdj) in
|
||||
mkADeg ad (a.s ! AAdv) ("more" ++ ad) ("most" ++ ad) ;
|
||||
adegA a = {s = a.s ! Pos ; lock_A = <>} ;
|
||||
duplADeg fat =
|
||||
mkADeg fat
|
||||
(fat + last fat + "er") (fat + last fat + "est") (fat + "ly") ;
|
||||
|
||||
compoundADeg a =
|
||||
let ad = (a.s ! AAdj Posit)
|
||||
in mkADeg ad ("more" ++ ad) ("most" ++ ad) (a.s ! AAdv) ;
|
||||
|
||||
adegA a = a ;
|
||||
|
||||
mkAdv x = ss x ** {lock_Adv = <>} ;
|
||||
mkAdV x = ss x ** {lock_AdV = <>} ;
|
||||
mkAdA x = ss x ** {lock_AdA = <>} ;
|
||||
|
||||
mkPreposition p = p ;
|
||||
mkPrep p = ss p ** {lock_Prep = <>} ;
|
||||
noPrep = mkPrep [] ;
|
||||
|
||||
mkV a b c d e = mkVerbP3worst a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||
mkV a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ;
|
||||
|
||||
regV cry =
|
||||
let
|
||||
@@ -394,36 +422,46 @@ oper
|
||||
mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
||||
|
||||
irregV x y z = let reg = (regV x).s in
|
||||
mkV x (reg ! Indic Sg) y z (reg ! PresPart) ** {s1 = [] ; lock_V = <>} ;
|
||||
mkV x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ;
|
||||
|
||||
irregDuplV fit y z =
|
||||
let
|
||||
fitting = (regDuplV fit).s ! PresPart
|
||||
fitting = (regDuplV fit).s ! VPresPart
|
||||
in
|
||||
mkV fit (fit + "s") y z fitting ;
|
||||
|
||||
partV v p = {s = v.s ; s1 = p ; lock_V = <>} ;
|
||||
partV v p = verbPart v p ** {lock_V = <>} ;
|
||||
reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ;
|
||||
|
||||
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; s3 = p ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v [] ;
|
||||
mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; lock_V2 = <>} ;
|
||||
dirV2 v = mkV2 v noPrep ;
|
||||
|
||||
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 [] ;
|
||||
mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; lock_V3 = <>} ;
|
||||
dirV3 v p = mkV3 v noPrep p ;
|
||||
dirdirV3 v = dirV3 v noPrep ;
|
||||
|
||||
mkV0 v = v ** {lock_V0 = <>} ;
|
||||
mkVS v = v ** {lock_VS = <>} ;
|
||||
mkV2S v p = mkV2 v p ** {lock_V2S = <>} ;
|
||||
mkVV v = verb2aux v ** {isAux = False ; lock_VV = <>} ;
|
||||
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2V = <>} ;
|
||||
mkVV v = {
|
||||
s = table {VVF vf => v.s ! vf ; _ => variants {}} ;
|
||||
isAux = False ; lock_VV = <>
|
||||
} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
|
||||
V0 : Type = V ;
|
||||
V2S, V2V, V2Q, V2A : Type = V2 ;
|
||||
AS, A2S, AV : Type = A ;
|
||||
A2V : Type = A2 ;
|
||||
|
||||
mkV0 v = v ** {lock_V = <>} ;
|
||||
mkV2S v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
mkV2V v p t = mkV2 v p ** {s4 = t ; lock_V2 = <>} ;
|
||||
mkVA v = v ** {lock_VA = <>} ;
|
||||
mkV2A v p = mkV2 v p ** {lock_V2A = <>} ;
|
||||
mkVQ v = v ** {lock_VQ = <>} ;
|
||||
mkV2Q v p = mkV2 v p ** {lock_V2Q = <>} ;
|
||||
mkV2Q v p = mkV2 v p ** {lock_V2 = <>} ;
|
||||
|
||||
mkAS v = v ** {lock_AS = <>} ;
|
||||
mkA2S v p = mkA2 v p ** {lock_A2S = <>} ;
|
||||
mkAV v = v ** {lock_AV = <>} ;
|
||||
mkA2V v p = mkA2 v p ** {lock_A2V = <>} ;
|
||||
mkAS v = v ** {lock_A = <>} ;
|
||||
mkA2S v p = mkA2 v p ** {lock_A = <>} ;
|
||||
mkAV v = v ** {lock_A = <>} ;
|
||||
mkA2V v p = mkA2 v p ** {lock_A2 = <>} ;
|
||||
|
||||
} ;
|
||||
|
||||
23
lib/resource/english/PhraseEng.gf
Normal file
23
lib/resource/english/PhraseEng.gf
Normal file
@@ -0,0 +1,23 @@
|
||||
concrete PhraseEng of Phrase = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
lin
|
||||
PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ;
|
||||
|
||||
UttS s = s ;
|
||||
UttQS qs = {s = qs.s ! QDir} ;
|
||||
UttImpSg pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! Sg} ;
|
||||
UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! Pl} ;
|
||||
|
||||
UttIP ip = {s = ip.s ! Nom} ; --- Acc also
|
||||
UttIAdv iadv = iadv ;
|
||||
UttNP np = {s = np.s ! Acc} ;
|
||||
UttVP vp = {s = infVP False vp (agrP3 Sg)} ;
|
||||
UttAdv adv = adv ;
|
||||
|
||||
NoPConj = {s = []} ;
|
||||
PConjConj conj = conj ;
|
||||
|
||||
NoVoc = {s = []} ;
|
||||
VocNP np = {s = "," ++ np.s ! Nom} ;
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
--# -opt
|
||||
|
||||
concrete PredicEng of Predic = CategoriesEng **
|
||||
open Prelude, SyntaxEng, DeptypEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lincat
|
||||
VType, CType = SS ;
|
||||
Verb = {s : VForm => Str ; isAux : Bool ; s1 : Particle ; c : VComp} ;
|
||||
Compl = {s1, s2 : Agr => Str} ;
|
||||
|
||||
lin
|
||||
CtN, CtV, CtS, CtQ, CtA = ss [] ;
|
||||
Vt, VtN = \x -> x ;
|
||||
Vt_ = ss [] ;
|
||||
|
||||
Compl_ = {s1, s2 = \\_ => []} ;
|
||||
ComplN np = {s1 = \\_ => np.s ! AccP ; s2 = \\_ => []} ;
|
||||
ComplA ap = {s1 = ap.s ; s2 = \\_ => []} ;
|
||||
ComplQ q = {s1 = \\_ => q.s ! DirQ ; s2 = \\_ => []} ;
|
||||
ComplS s = {s1 = \\_ => "that" ++ s.s ; s2 = \\_ => []} ;
|
||||
|
||||
ComplAdd c np co = {s1 = \\_ => c.s ++ np.s ! AccP ; s2 = co.s1} ;
|
||||
|
||||
|
||||
SPredVerb vt np verb compl =
|
||||
predVerbClause np verb
|
||||
(\\a => vt.s ++
|
||||
cprep1 verb.c (compl.s1 ! a) ++
|
||||
cprep2 verb.c (compl.s2 ! a)
|
||||
) ;
|
||||
QPredVerb vt np verb compl =
|
||||
intVerbClause np verb
|
||||
(\\a => vt.s ++
|
||||
cprep1 verb.c (compl.s1 ! a) ++
|
||||
cprep2 verb.c (compl.s2 ! a)
|
||||
) ;
|
||||
|
||||
RPredVerb vt np verb compl =
|
||||
relVerbClause np verb
|
||||
(\\a => vt.s ++
|
||||
cprep1 verb.c (compl.s1 ! a) ++
|
||||
cprep2 verb.c (compl.s2 ! a)
|
||||
) ;
|
||||
|
||||
IPredVerb vt verb compl =
|
||||
predVerbI verb
|
||||
(\\a => vt.s ++
|
||||
cprep1 verb.c (compl.s1 ! a) ++
|
||||
cprep2 verb.c (compl.s2 ! a)
|
||||
) ;
|
||||
|
||||
VeV1 v = v ** {isAux = False ; c = CVt_} ;
|
||||
VeV2 v = v ** {isAux = False ; c = CVt (CCtN CP_)} ; ---- other preps
|
||||
|
||||
{-
|
||||
Walk = {s = "walks" ; c = VC_} ;
|
||||
Love = {s = "loves" ; c = VC1 C_} ;
|
||||
Know = {s = "knows" ; c = VC_} ;
|
||||
Give = {s = "gives" ; c = VC2 C_ C_to} ;
|
||||
Tell = {s = "tells" ; c = VC_} ;
|
||||
Ask = {s = "asks" ; c = VC_} ;
|
||||
-}
|
||||
|
||||
}
|
||||
44
lib/resource/english/QuestionEng.gf
Normal file
44
lib/resource/english/QuestionEng.gf
Normal file
@@ -0,0 +1,44 @@
|
||||
concrete QuestionEng of Question = CatEng ** open ResEng, Prelude in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
QuestCl cl = {
|
||||
s = \\t,a,p =>
|
||||
let cls = cl.s ! t ! a ! p
|
||||
in table {
|
||||
QDir => cls ! OQuest ;
|
||||
QIndir => "if" ++ cls ! ODir
|
||||
} ---- "whether" in ExtEng
|
||||
} ;
|
||||
|
||||
QuestVP qp vp =
|
||||
let cl = mkClause (qp.s ! Nom) {n = qp.n ; p = P3} vp
|
||||
in {s = \\t,a,b,_ => cl.s ! t ! a ! b ! ODir} ;
|
||||
|
||||
QuestSlash ip slash =
|
||||
mkQuestion (ss (slash.c2 ++ ip.s ! Acc)) slash ;
|
||||
--- stranding in ExratEng
|
||||
|
||||
QuestIAdv iadv cl = mkQuestion iadv cl ;
|
||||
|
||||
QuestIComp icomp np =
|
||||
mkQuestion icomp (mkClause (np.s ! Nom) np.a (predAux auxBe)) ;
|
||||
|
||||
|
||||
PrepIP p ip = {s = p.s ++ ip.s ! Nom} ;
|
||||
|
||||
AdvIP ip adv = {
|
||||
s = \\c => ip.s ! c ++ adv.s ;
|
||||
n = ip.n
|
||||
} ;
|
||||
|
||||
IDetCN idet num ord cn = {
|
||||
s = \\c => idet.s ++ num.s ++ ord.s ++ cn.s ! idet.n ! c ;
|
||||
n = idet.n
|
||||
} ;
|
||||
|
||||
CompIAdv a = a ;
|
||||
|
||||
}
|
||||
48
lib/resource/english/RelativeEng.gf
Normal file
48
lib/resource/english/RelativeEng.gf
Normal file
@@ -0,0 +1,48 @@
|
||||
concrete RelativeEng of Relative = CatEng ** open ResEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
RelCl cl = {
|
||||
s = \\t,a,p,_ => "such" ++ "that" ++ cl.s ! t ! a ! p ! ODir ;
|
||||
c = Nom
|
||||
} ;
|
||||
|
||||
RelVP rp vp = {
|
||||
s = \\t,ant,b,ag =>
|
||||
let
|
||||
agr = case rp.a of {
|
||||
RNoAg => ag ;
|
||||
RAg a => a
|
||||
} ;
|
||||
cl = mkClause (rp.s ! RC Nom) agr vp
|
||||
in
|
||||
cl.s ! t ! ant ! b ! ODir ;
|
||||
c = Nom
|
||||
} ;
|
||||
|
||||
-- Pied piping: "at which we are looking". Stranding and empty
|
||||
-- relative are defined in $ExtraEng.gf$ ("that we are looking at",
|
||||
-- "we are looking at").
|
||||
|
||||
RelSlash rp slash = {
|
||||
s = \\t,a,p,_ => slash.c2 ++ rp.s ! RPrep ++ slash.s ! t ! a ! p ! ODir ;
|
||||
c = Acc
|
||||
} ;
|
||||
|
||||
FunRP p np rp = {
|
||||
s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep ;
|
||||
a = RAg np.a
|
||||
} ;
|
||||
|
||||
IdRP = {
|
||||
s = table {
|
||||
RC Gen => "whose" ;
|
||||
RC _ => "that" ;
|
||||
RPrep => "which"
|
||||
} ;
|
||||
a = RNoAg
|
||||
} ;
|
||||
|
||||
}
|
||||
427
lib/resource/english/ResEng.gf
Normal file
427
lib/resource/english/ResEng.gf
Normal file
@@ -0,0 +1,427 @@
|
||||
--# -path=.:../abstract:../common:../../prelude
|
||||
|
||||
--1 English auxiliary operations.
|
||||
|
||||
-- This module contains operations that are needed to make the
|
||||
-- resource syntax work. To define everything that is needed to
|
||||
-- implement $Test$, it moreover contains regular lexical
|
||||
-- patterns needed for $Lex$.
|
||||
|
||||
resource ResEng = ParamX ** open Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
|
||||
-- Some parameters, such as $Number$, are inherited from $ParamX$.
|
||||
|
||||
--2 For $Noun$
|
||||
|
||||
-- This is the worst-case $Case$ needed for pronouns.
|
||||
|
||||
param
|
||||
Case = Nom | Acc | Gen ;
|
||||
|
||||
-- Agreement of $NP$ is a record. We'll add $Gender$ later.
|
||||
|
||||
oper
|
||||
Agr = {n : Number ; p : Person} ;
|
||||
|
||||
param
|
||||
Gender = Neutr | Masc | Fem ;
|
||||
|
||||
--2 For $Verb$
|
||||
|
||||
-- Only these five forms are needed for open-lexicon verbs.
|
||||
|
||||
param
|
||||
VForm =
|
||||
VInf
|
||||
| VPres
|
||||
| VPPart
|
||||
| VPresPart
|
||||
| VPast --# notpresent
|
||||
;
|
||||
|
||||
-- Auxiliary verbs have special negative forms.
|
||||
|
||||
VVForm =
|
||||
VVF VForm
|
||||
| VVPresNeg
|
||||
| VVPastNeg --# notpresent
|
||||
;
|
||||
|
||||
-- The order of sentence is needed already in $VP$.
|
||||
|
||||
Order = ODir | OQuest ;
|
||||
|
||||
|
||||
--2 For $Adjective$
|
||||
|
||||
AForm = AAdj Degree | AAdv ;
|
||||
|
||||
--2 For $Relative$
|
||||
|
||||
RAgr = RNoAg | RAg {n : Number ; p : Person} ;
|
||||
RCase = RPrep | RC Case ;
|
||||
|
||||
--2 For $Numeral$
|
||||
|
||||
CardOrd = NCard | NOrd ;
|
||||
DForm = unit | teen | ten ;
|
||||
|
||||
--2 Transformations between parameter types
|
||||
|
||||
oper
|
||||
agrP3 : Number -> Agr = \n ->
|
||||
{n = n ; p = P3} ;
|
||||
|
||||
conjAgr : Agr -> Agr -> Agr = \a,b -> {
|
||||
n = conjNumber a.n b.n ;
|
||||
p = conjPerson a.p b.p
|
||||
} ;
|
||||
|
||||
-- For $Lex$.
|
||||
|
||||
-- For each lexical category, here are the worst-case constructors.
|
||||
|
||||
mkNoun : (_,_,_,_ : Str) -> {s : Number => Case => Str} =
|
||||
\man,mans,men,mens -> {
|
||||
s = table {
|
||||
Sg => table {
|
||||
Gen => mans ;
|
||||
_ => man
|
||||
} ;
|
||||
Pl => table {
|
||||
Gen => mens ;
|
||||
_ => men
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
mkAdjective : (_,_,_,_ : Str) -> {s : AForm => Str} =
|
||||
\good,better,best,well -> {
|
||||
s = table {
|
||||
AAdj Posit => good ;
|
||||
AAdj Compar => better ;
|
||||
AAdj Superl => best ;
|
||||
AAdv => well
|
||||
}
|
||||
} ;
|
||||
|
||||
mkVerb : (_,_,_,_,_ : Str) -> Verb =
|
||||
\go,goes,went,gone,going -> {
|
||||
s = table {
|
||||
VInf => go ;
|
||||
VPres => goes ;
|
||||
VPast => went ; --# notpresent
|
||||
VPPart => gone ;
|
||||
VPresPart => going
|
||||
} ;
|
||||
isRefl = False
|
||||
} ;
|
||||
|
||||
mkIP : (i,me,my : Str) -> Number -> {s : Case => Str ; n : Number} =
|
||||
\i,me,my,n -> let who = mkNP i me my n P3 in {s = who.s ; n = n} ;
|
||||
|
||||
mkNP : (i,me,my : Str) -> Number -> Person -> {s : Case => Str ; a : Agr} =
|
||||
\i,me,my,n,p -> {
|
||||
s = table {
|
||||
Nom => i ;
|
||||
Acc => me ;
|
||||
Gen => my
|
||||
} ;
|
||||
a = {
|
||||
n = n ;
|
||||
p = p
|
||||
}
|
||||
} ;
|
||||
|
||||
-- These functions cover many cases; full coverage inflectional patterns are
|
||||
-- in $MorphoEng$.
|
||||
|
||||
regN : Str -> {s : Number => Case => Str} = \car ->
|
||||
mkNoun car (car + "'s") (car + "s") (car + "s'") ;
|
||||
|
||||
regA : Str -> {s : AForm => Str} = \warm ->
|
||||
mkAdjective warm (warm + "er") (warm + "est") (warm + "ly") ;
|
||||
|
||||
regV : Str -> Verb = \walk ->
|
||||
mkVerb walk (walk + "s") (walk + "ed") (walk + "ed") (walk + "ing") ;
|
||||
|
||||
regNP : Str -> Number -> {s : Case => Str ; a : Agr} = \that,n ->
|
||||
mkNP that that (that + "'s") n P3 ;
|
||||
|
||||
-- We have just a heuristic definition of the indefinite article.
|
||||
-- There are lots of exceptions: consonantic "e" ("euphemism"), consonantic
|
||||
-- "o" ("one-sided"), vocalic "u" ("umbrella").
|
||||
|
||||
artIndef = pre {
|
||||
"a" ;
|
||||
"an" / strs {"a" ; "e" ; "i" ; "o" ; "A" ; "E" ; "I" ; "O" }
|
||||
} ;
|
||||
|
||||
artDef = "the" ;
|
||||
|
||||
-- For $Verb$.
|
||||
|
||||
Verb : Type = {
|
||||
s : VForm => Str ;
|
||||
isRefl : Bool
|
||||
} ;
|
||||
|
||||
param
|
||||
CPolarity =
|
||||
CPos
|
||||
| CNeg Bool ; -- contracted or not
|
||||
|
||||
oper
|
||||
contrNeg : Bool -> Polarity -> CPolarity = \b,p -> case p of {
|
||||
Pos => CPos ;
|
||||
Neg => CNeg b
|
||||
} ;
|
||||
|
||||
VerbForms : Type =
|
||||
Tense => Anteriority => CPolarity => Order => Agr => {fin, inf : Str} ;
|
||||
|
||||
VP : Type = {
|
||||
s : VerbForms ;
|
||||
prp : Str ; -- present participle
|
||||
inf : Str ; -- the infinitive form ; VerbForms would be the logical place
|
||||
ad : Str ; -- sentential adverb
|
||||
s2 : Agr => Str -- complement
|
||||
} ;
|
||||
|
||||
|
||||
predV : Verb -> VP = \verb -> {
|
||||
s = \\t,ant,b,ord,agr =>
|
||||
let
|
||||
inf = verb.s ! VInf ;
|
||||
fin = presVerb verb agr ;
|
||||
part = verb.s ! VPPart ;
|
||||
in
|
||||
case <t,ant,b,ord> of {
|
||||
<Pres,Simul,CPos,ODir> => vf fin [] ;
|
||||
<Pres,Simul,CPos,OQuest> => vf (does agr) inf ;
|
||||
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||
<Past,Simul,CPos,ODir> => vf (verb.s ! VPast) [] ; --# notpresent
|
||||
<Past,Simul,CPos,OQuest> => vf "did" inf ; --# notpresent
|
||||
<Past,Simul,CNeg c,_> => vfn c "did" "didn't" inf ; --# notpresent
|
||||
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
|
||||
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
|
||||
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
|
||||
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
||||
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
|
||||
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
|
||||
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
|
||||
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||
<Pres,Simul,CNeg c,_> => vfn c (does agr) (doesnt agr) inf
|
||||
} ;
|
||||
prp = verb.s ! VPresPart ;
|
||||
inf = verb.s ! VInf ;
|
||||
ad = [] ;
|
||||
s2 = \\a => if_then_Str verb.isRefl (reflPron ! a) []
|
||||
} ;
|
||||
|
||||
predAux : Aux -> VP = \verb -> {
|
||||
s = \\t,ant,cb,ord,agr =>
|
||||
let
|
||||
b = case cb of {
|
||||
CPos => Pos ;
|
||||
_ => Neg
|
||||
} ;
|
||||
inf = verb.inf ;
|
||||
fin = verb.pres ! b ! agr ;
|
||||
finp = verb.pres ! Pos ! agr ;
|
||||
part = verb.ppart ;
|
||||
in
|
||||
case <t,ant,cb,ord> of {
|
||||
<Pres,Anter,CPos,_> => vf (have agr) part ; --# notpresent
|
||||
<Pres,Anter,CNeg c,_> => vfn c (have agr) (havent agr) part ; --# notpresent
|
||||
<Past,Simul,CPos, _> => vf (verb.past ! b ! agr) [] ; --# notpresent
|
||||
<Past,Simul,CNeg c, _> => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent
|
||||
<Past,Anter,CPos,_> => vf "had" part ; --# notpresent
|
||||
<Past,Anter,CNeg c,_> => vfn c "had" "hadn't" part ; --# notpresent
|
||||
<Fut, Simul,CPos,_> => vf "will" inf ; --# notpresent
|
||||
<Fut, Simul,CNeg c,_> => vfn c "will" "won't" inf ; --# notpresent
|
||||
<Fut, Anter,CPos,_> => vf "will" ("have" ++ part) ; --# notpresent
|
||||
<Fut, Anter,CNeg c,_> => vfn c "will" "won't"("have" ++ part) ; --# notpresent
|
||||
<Cond,Simul,CPos,_> => vf "would" inf ; --# notpresent
|
||||
<Cond,Simul,CNeg c,_> => vfn c "would" "wouldn't" inf ; --# notpresent
|
||||
<Cond,Anter,CPos,_> => vf "would" ("have" ++ part) ; --# notpresent
|
||||
<Cond,Anter,CNeg c,_> => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent
|
||||
<Pres,Simul,CPos, _> => vf fin [] ;
|
||||
<Pres,Simul,CNeg c, _> => vfn c finp fin []
|
||||
} ;
|
||||
prp = verb.prpart ;
|
||||
inf = verb.inf ;
|
||||
ad = [] ;
|
||||
s2 = \\_ => []
|
||||
} ;
|
||||
|
||||
vf : Str -> Str -> {fin, inf : Str} = \x,y -> vfn True x x y ;
|
||||
|
||||
vfn : Bool -> Str -> Str -> Str -> {fin, inf : Str} = \contr,x,y,z ->
|
||||
case contr of {
|
||||
True => {fin = y ; inf = z} ;
|
||||
False => {fin = x ; inf = "not" ++ z}
|
||||
} ;
|
||||
|
||||
insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
inf = vp.inf ;
|
||||
ad = vp.ad ;
|
||||
s2 = \\a => vp.s2 ! a ++ obj ! a
|
||||
} ;
|
||||
|
||||
--- The adverb should be before the finite verb.
|
||||
|
||||
insertAdV : Str -> VP -> VP = \adv,vp -> {
|
||||
s = vp.s ;
|
||||
prp = vp.prp ;
|
||||
inf = vp.inf ;
|
||||
ad = vp.ad ++ adv ;
|
||||
s2 = \\a => vp.s2 ! a
|
||||
} ;
|
||||
|
||||
--
|
||||
|
||||
predVV : {s : VVForm => Str ; isAux : Bool} -> VP = \verb ->
|
||||
let verbs = verb.s
|
||||
in
|
||||
case verb.isAux of {
|
||||
True => predAux {
|
||||
pres = table {
|
||||
Pos => \\_ => verbs ! VVF VPres ;
|
||||
Neg => \\_ => verbs ! VVPresNeg
|
||||
} ;
|
||||
past = table { --# notpresent
|
||||
Pos => \\_ => verbs ! VVF VPast ; --# notpresent
|
||||
Neg => \\_ => verbs ! VVPastNeg --# notpresent
|
||||
} ; --# notpresent
|
||||
inf = verbs ! VVF VInf ;
|
||||
ppart = verbs ! VVF VPPart ;
|
||||
prpart = verbs ! VVF VPresPart ;
|
||||
} ;
|
||||
_ => predV {s = \\vf => verbs ! VVF vf ; isRefl = False}
|
||||
} ;
|
||||
|
||||
presVerb : {s : VForm => Str} -> Agr -> Str = \verb ->
|
||||
agrVerb (verb.s ! VPres) (verb.s ! VInf) ;
|
||||
|
||||
infVP : Bool -> VP -> Agr -> Str = \isAux,vp,a ->
|
||||
vp.ad ++ if_then_Str isAux [] "to" ++
|
||||
vp.inf ++ vp.s2 ! a ;
|
||||
|
||||
agrVerb : Str -> Str -> Agr -> Str = \has,have,agr ->
|
||||
case agr of {
|
||||
{n = Sg ; p = P3} => has ;
|
||||
_ => have
|
||||
} ;
|
||||
|
||||
have = agrVerb "has" "have" ;
|
||||
havent = agrVerb "hasn't" "haven't" ;
|
||||
does = agrVerb "does" "do" ;
|
||||
doesnt = agrVerb "doesn't" "don't" ;
|
||||
|
||||
Aux = {
|
||||
pres : Polarity => Agr => Str ;
|
||||
past : Polarity => Agr => Str ; --# notpresent
|
||||
inf,ppart,prpart : Str
|
||||
} ;
|
||||
|
||||
auxBe : Aux = {
|
||||
pres = \\b,a => case <b,a> of {
|
||||
<Pos,{n = Sg ; p = P1}> => "am" ;
|
||||
<Neg,{n = Sg ; p = P1}> => ["am not"] ; --- am not I
|
||||
_ => agrVerb (posneg b "is") (posneg b "are") a
|
||||
} ;
|
||||
past = \\b,a => case a of { --# notpresent
|
||||
{n = Sg ; p = P1|P3} => (posneg b "was") ; --# notpresent
|
||||
_ => (posneg b "were") --# notpresent
|
||||
} ; --# notpresent
|
||||
inf = "be" ;
|
||||
ppart = "been" ;
|
||||
prpart = "being"
|
||||
} ;
|
||||
|
||||
posneg : Polarity -> Str -> Str = \p,s -> case p of {
|
||||
Pos => s ;
|
||||
Neg => s + "n't"
|
||||
} ;
|
||||
|
||||
conjThat : Str = "that" ;
|
||||
|
||||
reflPron : Agr => Str = table {
|
||||
{n = Sg ; p = P1} => "myself" ;
|
||||
{n = Sg ; p = P2} => "yourself" ;
|
||||
{n = Sg ; p = P3} => "itself" ; ----
|
||||
{n = Pl ; p = P1} => "ourselves" ;
|
||||
{n = Pl ; p = P2} => "yourselves" ;
|
||||
{n = Pl ; p = P3} => "themselves"
|
||||
} ;
|
||||
|
||||
-- For $Sentence$.
|
||||
|
||||
Clause : Type = {
|
||||
s : Tense => Anteriority => CPolarity => Order => Str
|
||||
} ;
|
||||
|
||||
mkClause : Str -> Agr -> VP -> Clause =
|
||||
\subj,agr,vp -> {
|
||||
s = \\t,a,b,o =>
|
||||
let
|
||||
verb = vp.s ! t ! a ! b ! o ! agr ;
|
||||
compl = vp.s2 ! agr
|
||||
in
|
||||
case o of {
|
||||
ODir => subj ++ verb.fin ++ vp.ad ++ verb.inf ++ compl ;
|
||||
OQuest => verb.fin ++ subj ++ vp.ad ++ verb.inf ++ compl
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
-- For $Numeral$.
|
||||
|
||||
mkNum : Str -> Str -> Str -> Str -> {s : DForm => CardOrd => Str} =
|
||||
\two, twelve, twenty, second ->
|
||||
{s = table {
|
||||
unit => table {NCard => two ; NOrd => second} ;
|
||||
teen => \\c => mkCard c twelve ;
|
||||
ten => \\c => mkCard c twenty
|
||||
}
|
||||
} ;
|
||||
|
||||
regNum : Str -> {s : DForm => CardOrd => Str} =
|
||||
\six -> mkNum six (six + "teen") (six + "ty") (regOrd six) ;
|
||||
|
||||
regCardOrd : Str -> {s : CardOrd => Str} = \ten ->
|
||||
{s = table {NCard => ten ; NOrd => regOrd ten}} ;
|
||||
|
||||
mkCard : CardOrd -> Str -> Str = \c,ten ->
|
||||
(regCardOrd ten).s ! c ;
|
||||
|
||||
regOrd : Str -> Str = \ten ->
|
||||
case last ten of {
|
||||
"y" => init ten + "ieth" ;
|
||||
_ => ten + "th"
|
||||
} ;
|
||||
|
||||
mkQuestion :
|
||||
{s : Str} -> Clause ->
|
||||
{s : Tense => Anteriority => CPolarity => QForm => Str} = \wh,cl ->
|
||||
{
|
||||
s = \\t,a,p =>
|
||||
let
|
||||
cls = cl.s ! t ! a ! p ;
|
||||
why = wh.s
|
||||
in table {
|
||||
QDir => why ++ cls ! OQuest ;
|
||||
QIndir => why ++ cls ! ODir
|
||||
}
|
||||
} ;
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete ResourceEng of Resource = RulesEng, ClauseEng, StructuralEng ** {} ;
|
||||
---- concrete ResourceEng of Resource = RulesEng, VerbphraseEng ** {} ;
|
||||
@@ -1,207 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
concrete RulesEng of Rules = CategoriesEng ** open Prelude, SyntaxEng in {
|
||||
|
||||
flags
|
||||
optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseN = noun2CommNounPhrase ;
|
||||
UsePN = nameNounPhrase ;
|
||||
|
||||
IndefOneNP = indefNounPhrase singular ;
|
||||
IndefNumNP = indefNounPhraseNum plural ;
|
||||
DefOneNP = defNounPhrase singular ;
|
||||
DefNumNP = defNounPhraseNum plural ;
|
||||
|
||||
DetNP = detNounPhrase ;
|
||||
NDetNP = numDetNounPhrase ;
|
||||
NDetNum = justNumDetNounPhrase ;
|
||||
MassNP = detNounPhrase (mkDeterminer Sg []) ;
|
||||
|
||||
AppN2 = appFunComm ;
|
||||
AppN3 = appFun2 ;
|
||||
UseN2 = funAsCommNounPhrase ;
|
||||
|
||||
ModAP = modCommNounPhrase ;
|
||||
CNthatS = nounThatSentence ;
|
||||
|
||||
ModGenOne = npGenDet singular noNum ;
|
||||
ModGenNum = npGenDet plural ;
|
||||
|
||||
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"} ; n = Pl} ; ---
|
||||
NoNum = noNum ;
|
||||
|
||||
UseA = adj2adjPhrase ;
|
||||
ComplA2 = complAdj ;
|
||||
|
||||
ComplAV v x = complVerbAdj v x ;
|
||||
ComplObjA2V v x y = complVerbAdj2 True v x y ;
|
||||
|
||||
PositADeg = positAdjPhrase ;
|
||||
ComparADeg = comparAdjPhrase ;
|
||||
SuperlADeg = superlAdjPhrase ;
|
||||
|
||||
-- verbs and verb prases
|
||||
|
||||
PredAS = predAdjSent ;
|
||||
PredV0 rain = predVerbClause (pronNounPhrase pronIt) rain (complVerb rain) ;
|
||||
|
||||
-- Partial saturation.
|
||||
|
||||
UseV2 = transAsVerb ;
|
||||
|
||||
ComplA2S = predAdjSent2 ;
|
||||
|
||||
AdjPart = adjPastPart ;
|
||||
|
||||
UseV2V x = verb2aux x ** {isAux = False} ;
|
||||
UseV2S x = x ;
|
||||
UseV2Q x = x ;
|
||||
UseA2S x = x ;
|
||||
UseA2V x = x ;
|
||||
|
||||
UseCl tp cl = {s = tp.s ++ cl.s ! Dir ! tp.b ! VFinite tp.t tp.a} ;
|
||||
UseQCl tp cl = {s = \\q => tp.s ++ cl.s ! tp.b ! VFinite tp.t tp.a ! q} ;
|
||||
UseRCl tp cl = {s = \\a => tp.s ++ cl.s ! <tp.b, VFinite tp.t tp.a, a>} ;
|
||||
UseVCl p a cl = {
|
||||
s = \\v,ag => p.s ++ a.s ++ cl.s ! p.p ! a.a ! v ! ag ;
|
||||
s1 = cl.s1 ! p.p
|
||||
} ;
|
||||
|
||||
PosTP t a = {s = t.s ++ a.s ; b = True ; t = t.t ; a = a.a} ;
|
||||
NegTP t a = {s = t.s ++ a.s ; b = False ; t = t.t ; a = a.a} ;
|
||||
|
||||
TPresent = {s = [] ; t = Present} ;
|
||||
TPast = {s = [] ; t = Past} ;
|
||||
TFuture = {s = [] ; t = Future} ;
|
||||
TConditional = {s = [] ; t = Conditional} ;
|
||||
|
||||
ASimul = {s = [] ; a = Simul} ;
|
||||
AAnter = {s = [] ; a = Anter} ;
|
||||
|
||||
PPos = {s = [] ; p = True} ;
|
||||
PNeg = {s = [] ; p = False} ;
|
||||
|
||||
-- Adverbs.
|
||||
|
||||
AdjAdv a = ss (a.s ! AAdv) ;
|
||||
AdvPP p = p ;
|
||||
PrepNP p = prepPhrase p.s ; ---
|
||||
AdvCN = advCommNounPhrase ;
|
||||
AdvAP = advAdjPhrase ;
|
||||
AdvAdv = cc2 ;
|
||||
AdvNP pn pp = {s = \\c => pn.s ! c ++ pp.s ; a = pn.a} ;
|
||||
|
||||
--3 Sentences and relative clauses
|
||||
--
|
||||
|
||||
SlashV2 = slashTransVerbCl ;
|
||||
SlashVV2 = slashVerbVerb ;
|
||||
SlashAdv cl p = slashAdverb cl p.s ;
|
||||
|
||||
IdRP = identRelPron ;
|
||||
FunRP = funRelPron ;
|
||||
RelSlash = relSlash ;
|
||||
ModRS = modRelClause ;
|
||||
RelCl = relSuch ;
|
||||
|
||||
|
||||
--!
|
||||
--3 Questions and imperatives
|
||||
--
|
||||
|
||||
IDetCN d n = nounPhraseInt (detNounPhrase d n) ;
|
||||
FunIP = funIntPron ;
|
||||
|
||||
QuestCl = questClause ;
|
||||
IntSlash = intSlash ;
|
||||
QuestAdv = questAdverbial ;
|
||||
|
||||
PosImpVP = imperVerbPhrase True ;
|
||||
NegImpVP = imperVerbPhrase False ;
|
||||
|
||||
IndicPhrase = indicUtt ;
|
||||
QuestPhrase = interrogUtt ;
|
||||
ImperOne = imperUtterance singular ;
|
||||
ImperMany = imperUtterance plural ;
|
||||
|
||||
AdvCl = advClause ;
|
||||
AdvVPI = advVerbPhrase ;
|
||||
|
||||
AdCPhr = advSentence ;
|
||||
AdvPhr = advSentence ;
|
||||
|
||||
|
||||
--!
|
||||
--3 Coordination
|
||||
--
|
||||
|
||||
TwoS = twoSentence ;
|
||||
ConsS = consSentence ;
|
||||
ConjS = conjunctSentence ;
|
||||
ConjDS = conjunctDistrSentence ;
|
||||
|
||||
TwoAP = twoAdjPhrase ;
|
||||
ConsAP = consAdjPhrase ;
|
||||
ConjAP = conjunctAdjPhrase ;
|
||||
ConjDAP = conjunctDistrAdjPhrase ;
|
||||
|
||||
TwoNP = twoNounPhrase ;
|
||||
ConsNP = consNounPhrase ;
|
||||
ConjNP = conjunctNounPhrase ;
|
||||
ConjDNP = conjunctDistrNounPhrase ;
|
||||
|
||||
TwoAdv = twoSentence ;
|
||||
ConsAdv = consSentence ;
|
||||
ConjAdv = conjunctSentence ;
|
||||
ConjDAdv = conjunctDistrSentence ;
|
||||
|
||||
SubjS = subjunctSentence ;
|
||||
SubjImper = subjunctImperative ;
|
||||
SubjQS = subjunctQuestion ;
|
||||
AdvSubj if A = ss (if.s ++ A.s) ;
|
||||
|
||||
PhrNP = useNounPhrase ;
|
||||
PhrOneCN = useCommonNounPhrase singular ;
|
||||
PhrManyCN = useCommonNounPhrase plural ;
|
||||
PhrIP ip = ip ;
|
||||
PhrIAdv ia = ia ;
|
||||
PhrVPI = verbUtterance ;
|
||||
|
||||
OnePhr p = p ;
|
||||
ConsPhr = cc2 ;
|
||||
|
||||
-----------------------
|
||||
-- special constructions
|
||||
|
||||
OneNP = nameNounPhrase (nameReg "one" human) ;
|
||||
|
||||
ExistCN A = predBeGroup
|
||||
(nameNounPhrase (nameReg "there" Neutr))
|
||||
(complNounPhrase (indefNounPhrase singular A)) ;
|
||||
ExistNumCN nu A =
|
||||
predBeGroup
|
||||
(nameNounPhrasePl (nameReg "there" Neutr))
|
||||
(complNounPhrase (indefNounPhraseNum plural nu A)) ;
|
||||
|
||||
} ;
|
||||
53
lib/resource/english/SentenceEng.gf
Normal file
53
lib/resource/english/SentenceEng.gf
Normal file
@@ -0,0 +1,53 @@
|
||||
concrete SentenceEng of Sentence = CatEng ** open Prelude, ResEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
|
||||
PredVP np vp = mkClause (np.s ! Nom) np.a vp ;
|
||||
|
||||
PredSCVP sc vp = mkClause sc.s (agrP3 Sg) vp ;
|
||||
|
||||
ImpVP vp = {
|
||||
s = \\pol,n =>
|
||||
let
|
||||
agr = {n = n ; p = P2} ;
|
||||
verb = infVP True vp agr ;
|
||||
dont = case pol of {
|
||||
CNeg True => "don't" ;
|
||||
CNeg False => "do" ++ "not" ;
|
||||
_ => []
|
||||
}
|
||||
in
|
||||
dont ++ verb
|
||||
} ;
|
||||
|
||||
SlashV2 np v2 =
|
||||
mkClause (np.s ! Nom) np.a (predV v2) ** {c2 = v2.c2} ;
|
||||
|
||||
SlashVVV2 np vv v2 =
|
||||
mkClause (np.s ! Nom) np.a
|
||||
(insertObj (\\a => infVP vv.isAux (predV v2) a) (predVV vv)) **
|
||||
{c2 = v2.c2} ;
|
||||
|
||||
AdvSlash slash adv = {
|
||||
s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ;
|
||||
c2 = slash.c2
|
||||
} ;
|
||||
|
||||
SlashPrep cl prep = cl ** {c2 = prep.s} ;
|
||||
|
||||
EmbedS s = {s = conjThat ++ s.s} ;
|
||||
EmbedQS qs = {s = qs.s ! QIndir} ;
|
||||
EmbedVP vp = {s = infVP False vp (agrP3 Sg)} ; --- agr
|
||||
|
||||
UseCl t a p cl = {s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir} ;
|
||||
UseQCl t a p cl = {s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! q} ;
|
||||
UseRCl t a p cl = {
|
||||
s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! r ;
|
||||
c = cl.c
|
||||
} ;
|
||||
|
||||
oper
|
||||
ctr = contrNeg True ; -- contracted negations
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete SimpleEng of Simple = CategoriesEng ** SimpleI with
|
||||
(Categories = CategoriesEng),
|
||||
(Rules = RulesEng),
|
||||
(Structural = StructuralEng),
|
||||
(Verbphrase = VerbphraseEng)
|
||||
;
|
||||
@@ -1,21 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete SimpleLangEng of SimpleLang =
|
||||
SimpleEng,
|
||||
StructuralEng,
|
||||
BasicEng,
|
||||
TimeEng,
|
||||
CountryEng
|
||||
|
||||
** open Prelude, ParadigmsEng in {
|
||||
|
||||
lin
|
||||
AdvDate d = prefixSS "on" d ;
|
||||
AdvTime t = prefixSS "at" t ;
|
||||
NWeekday w = w ;
|
||||
PNWeekday w = nounPN w ;
|
||||
|
||||
PNCountry x = x ;
|
||||
ANationality x = x ;
|
||||
NLanguage x = x ;
|
||||
}
|
||||
@@ -1,101 +1,116 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Structural Words
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
concrete StructuralEng of Structural =
|
||||
CategoriesEng, NumeralsEng ** open Prelude, SyntaxEng in {
|
||||
concrete StructuralEng of Structural = CatEng **
|
||||
open MorphoEng, (P = ParadigmsEng), Prelude in {
|
||||
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
UseNumeral i = {
|
||||
s = table {Nom => i.s ! NCard ; Gen => i.s ! NCard ++ "'s"} ; n = i.n} ; ---
|
||||
|
||||
|
||||
above_Prep = ss "above" ;
|
||||
after_Prep = ss "after" ;
|
||||
all8mass_Det = mkDeterminer Sg "all" ; --- all the missing
|
||||
all_NDet = mkDeterminerNum "all" ;
|
||||
almost_Adv = ss "almost" ;
|
||||
all_Predet = ss "all" ;
|
||||
almost_AdA, almost_AdN = ss "almost" ;
|
||||
although_Subj = ss "although" ;
|
||||
always_AdV = ss "always" ;
|
||||
and_Conj = ss "and" ** {n = Pl} ;
|
||||
because_Subj = ss "because" ;
|
||||
before_Prep = ss "before" ;
|
||||
behind_Prep = ss "behind" ;
|
||||
between_Prep = ss "between" ;
|
||||
both_AndConjD = sd2 "both" "and" ** {n = Pl} ;
|
||||
both7and_DConj = sd2 "both" "and" ** {n = Pl} ;
|
||||
but_PConj = ss "but" ;
|
||||
by8agent_Prep = ss "by" ;
|
||||
by8means_Prep = ss "by" ;
|
||||
can8know_VV = vvCan ;
|
||||
can_VV = vvCan ;
|
||||
can8know_VV, can_VV = {
|
||||
s = table VVForm [["be able to"] ; "can" ; ["been able to"] ;
|
||||
["being able to"] ; "could" ; "can't" ; "couldn't"] ;
|
||||
isAux = True
|
||||
} ;
|
||||
during_Prep = ss "during" ;
|
||||
either8or_ConjD = sd2 "either" "or" ** {n = Sg} ;
|
||||
everybody_NP = nameNounPhrase (nameReg "everybody" human) ;
|
||||
every_Det = everyDet ;
|
||||
everything_NP = nameNounPhrase (nameReg "everything" Neutr) ;
|
||||
either7or_DConj = sd2 "either" "or" ** {n = Sg} ;
|
||||
everybody_NP = regNP "everybody" Sg ;
|
||||
every_Det = mkDeterminer Sg "every" ;
|
||||
everything_NP = regNP "everything" Sg ;
|
||||
everywhere_Adv = ss "everywhere" ;
|
||||
few_Det = mkDeterminer Pl "few" ;
|
||||
first_Ord = ss "first" ;
|
||||
from_Prep = ss "from" ;
|
||||
he_NP = pronNounPhrase pronHe ;
|
||||
he_Pron = mkNP "he" "him" "his" Sg P3 ;
|
||||
here_Adv = ss "here" ;
|
||||
here7to_Adv = ss ["to here"] ;
|
||||
here7from_Adv = ss ["from here"] ;
|
||||
how_IAdv = ss "how" ;
|
||||
how8many_IDet = mkDeterminer Pl ["how many"] ;
|
||||
if_Subj = ss "if" ;
|
||||
in8front_Prep = ss ["in front of"] ;
|
||||
i_NP = pronNounPhrase pronI ;
|
||||
i_Pron = mkNP "I" "me" "my" Sg P1 ;
|
||||
in_Prep = ss "in" ;
|
||||
it_NP = pronNounPhrase pronIt ;
|
||||
it_Pron = mkNP "it" "it" "its" Sg P3 ;
|
||||
less_CAdv = ss "less" ;
|
||||
many_Det = mkDeterminer Pl "many" ;
|
||||
most_Det = mkDeterminer Sg "most" ;
|
||||
most8many_Det = mostDet ;
|
||||
much_Det = mkDeterminer Sg ["a lot of"] ; ---
|
||||
must_VV = vvMust ;
|
||||
|
||||
no_Phr = ss "No." ;
|
||||
more_CAdv = ss "more" ;
|
||||
most_Predet = ss "most" ;
|
||||
much_Det = mkDeterminer Sg "much" ;
|
||||
must_VV = {
|
||||
s = table VVForm [["have to"] ; "must" ; ["had to"] ;
|
||||
["having to"] ; ["had to"] ; "mustn't" ; ["hadn't to"]] ; ----
|
||||
isAux = True
|
||||
} ;
|
||||
no_Phr = ss "no" ;
|
||||
on_Prep = ss "on" ;
|
||||
one_Quant = mkDeterminer Sg "one" ;
|
||||
only_Predet = ss "only" ;
|
||||
or_Conj = ss "or" ** {n = Sg} ;
|
||||
otherwise_Adv = ss "otherwise" ;
|
||||
otherwise_PConj = ss "otherwise" ;
|
||||
part_Prep = ss "of" ;
|
||||
please_Voc = ss "please" ;
|
||||
possess_Prep = ss "of" ;
|
||||
quite_Adv = ss "quite" ;
|
||||
she_NP = pronNounPhrase pronShe ;
|
||||
so_Adv = ss "so" ;
|
||||
somebody_NP = nameNounPhrase (nameReg "somebody" human) ;
|
||||
some_Det = mkDeterminer Sg "some" ;
|
||||
some_NDet = mkDeterminerNum "some" ;
|
||||
something_NP = nameNounPhrase (nameReg "something" Neutr) ;
|
||||
she_Pron = mkNP "she" "her" "her" Sg P3 ;
|
||||
so_AdA = ss "so" ;
|
||||
somebody_NP = regNP "somebody" Sg ;
|
||||
someSg_Det = mkDeterminer Sg "some" ;
|
||||
somePl_Det = mkDeterminer Pl "some" ;
|
||||
something_NP = regNP "something" Sg ;
|
||||
somewhere_Adv = ss "somewhere" ;
|
||||
that_Det = mkDeterminer Sg "that" ;
|
||||
that_NP = nameNounPhrase (nameReg "that" Neutr) ;
|
||||
therefore_Adv = ss "therefore" ;
|
||||
these_NDet = mkDeterminerNum "these" ;
|
||||
they8fem_NP = pronNounPhrase pronThey ;
|
||||
they_NP = pronNounPhrase pronThey ;
|
||||
this_Det = mkDeterminer Sg "this" ;
|
||||
this_NP = nameNounPhrase (nameReg "this" Neutr) ;
|
||||
those_NDet = mkDeterminerNum "those" ;
|
||||
thou_NP = pronNounPhrase pronYouSg ;
|
||||
that_Quant = mkQuant "that" "those" ;
|
||||
that_NP = regNP "that" Sg ;
|
||||
there_Adv = ss "there" ;
|
||||
there7to_Adv = ss "there" ;
|
||||
there7from_Adv = ss ["from there"] ;
|
||||
therefore_PConj = ss "therefore" ;
|
||||
these_NP = regNP "these" Pl ;
|
||||
they_Pron = mkNP "they" "them" "their" Pl P3 ;
|
||||
this_Quant = mkQuant "this" "these" ;
|
||||
this_NP = regNP "this" Sg ;
|
||||
those_NP = regNP "those" Pl ;
|
||||
through_Prep = ss "through" ;
|
||||
too_Adv = ss "too" ;
|
||||
too_AdA = ss "too" ;
|
||||
to_Prep = ss "to" ;
|
||||
under_Prep = ss "under" ;
|
||||
very_Adv = ss "very" ;
|
||||
want_VV = verb2aux (verbNoPart (regVerbP3 "want")) ** {isAux = False} ;
|
||||
we_NP = pronNounPhrase pronWe ;
|
||||
what8many_IP = intPronWhat plural ;
|
||||
what8one_IP = intPronWhat singular ;
|
||||
very_AdA = ss "very" ;
|
||||
want_VV = P.mkVV (P.regV "want") ;
|
||||
we_Pron = mkNP "we" "us" "our" Pl P1 ;
|
||||
whatPl_IP = mkIP "what" "what" "what's" Sg ;
|
||||
whatSg_IP = mkIP "what" "what" "what's" Sg ;
|
||||
when_IAdv = ss "when" ;
|
||||
when_Subj = ss "when" ;
|
||||
where_IAdv = ss "where" ;
|
||||
which8many_IDet = mkDeterminer Pl ["which"] ;
|
||||
which8one_IDet = mkDeterminer Sg ["which"] ;
|
||||
who8many_IP = intPronWho plural ;
|
||||
who8one_IP = intPronWho singular ;
|
||||
whichPl_IDet = mkDeterminer Pl ["which"] ;
|
||||
whichSg_IDet = mkDeterminer Sg ["which"] ;
|
||||
whoSg_IP = mkIP "who" "whom" "whose" Sg ;
|
||||
whoPl_IP = mkIP "who" "whom" "whose" Pl ;
|
||||
why_IAdv = ss "why" ;
|
||||
without_Prep = ss "without" ;
|
||||
with_Prep = ss "with" ;
|
||||
ye_NP = pronNounPhrase pronYouPl ;
|
||||
you_NP = pronNounPhrase pronYouSg ;
|
||||
yes_Phr = ss "Yes." ;
|
||||
yes_Phr = ss "yes" ;
|
||||
youSg_Pron = mkNP "you" "you" "your" Sg P2 ;
|
||||
youPl_Pron = mkNP "you" "you" "your" Pl P2 ;
|
||||
youPol_Pron = mkNP "you" "you" "your" Sg P2 ;
|
||||
|
||||
|
||||
oper
|
||||
mkQuant : Str -> Str -> {s : Number => Str} = \x,y -> {
|
||||
s = table Number [x ; y]
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,247 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
concrete SwadeshLexEng of SwadeshLex = CategoriesEng
|
||||
** open ResourceEng, SyntaxEng, ParadigmsEng, VerbsEng,
|
||||
BasicEng, Prelude in {
|
||||
|
||||
lin
|
||||
|
||||
-- Pronouns
|
||||
|
||||
i_NP = i_NP ;
|
||||
thou_NP = thou_NP ;
|
||||
he_NP = he_NP ;
|
||||
we_NP = we_NP ;
|
||||
you_NP = you_NP ;
|
||||
they_NP = they_NP ;
|
||||
who8many_IP = who8many_IP ;
|
||||
who8one_IP = who8one_IP ;
|
||||
what8many_IP = what8many_IP ;
|
||||
what8one_IP = what8one_IP ;
|
||||
|
||||
-- Determiners
|
||||
|
||||
this_Det = this_Det ;
|
||||
that_Det = that_Det ;
|
||||
all_NDet = all_NDet ;
|
||||
many_Det = many_Det ;
|
||||
some_Det = some_Det ;
|
||||
few_Det = mkDeterminer Pl "few" ;
|
||||
other_Det = mkDeterminer Pl "other" ;
|
||||
|
||||
|
||||
-- Adverbs
|
||||
|
||||
here_Adv = here_Adv;
|
||||
there_Adv = there_Adv;
|
||||
where_IAdv = where_IAdv;
|
||||
when_IAdv = when_IAdv;
|
||||
how_IAdv = how_IAdv;
|
||||
|
||||
-- not : Adv ; -- ?
|
||||
|
||||
-- Conjunctions
|
||||
|
||||
and_Conj = and_Conj ;
|
||||
|
||||
-- Prepositions
|
||||
|
||||
at_Prep = ss "at" ;
|
||||
in_Prep = ss "in" ;
|
||||
with_Prep = ss "with" ;
|
||||
|
||||
-- Numerals
|
||||
|
||||
one_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 pot01)))) ;
|
||||
two_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n2))))) ;
|
||||
three_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n3))))) ;
|
||||
four_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n4))))) ;
|
||||
five_Num = UseNumeral (num (pot2as3 (pot1as2 (pot0as1 (pot0 n5))))) ;
|
||||
|
||||
-- Adjectives
|
||||
|
||||
bad_ADeg = bad_ADeg ;
|
||||
big_ADeg = big_ADeg ;
|
||||
black_ADeg = black_ADeg ;
|
||||
cold_ADeg = cold_ADeg ;
|
||||
correct_ADeg = compoundADeg (regA "correct") ;
|
||||
dirty_ADeg = dirty_ADeg ;
|
||||
dry_ADeg = regADeg "dry" ;
|
||||
dull_ADeg = regADeg "dull" ;
|
||||
far_ADeg = mkADeg "far" (variants { "further"; "farther" })
|
||||
(variants { "furthest"; "farthest" }) "far" ;
|
||||
full_ADeg = regADeg "full" ;
|
||||
good_ADeg = good_ADeg ;
|
||||
green_ADeg = green_ADeg ;
|
||||
heavy_ADeg = regADeg "heavy" ;
|
||||
long_ADeg = long_ADeg ;
|
||||
narrow_ADeg = narrow_ADeg ;
|
||||
near_ADeg = regADeg "near" ;
|
||||
new_ADeg = new_ADeg ;
|
||||
old_ADeg = old_ADeg ;
|
||||
red_ADeg = red_ADeg ;
|
||||
rotten_ADeg = compoundADeg (regA "rotten") ;
|
||||
round_ADeg = regADeg "round" ;
|
||||
sharp_ADeg = regADeg "sharp" ;
|
||||
short_ADeg = short_ADeg ;
|
||||
small_ADeg = small_ADeg ;
|
||||
smooth_ADeg = regADeg "smooth" ;
|
||||
straight_ADeg = regADeg "straight" ;
|
||||
thick_ADeg = thick_ADeg ;
|
||||
thin_ADeg = thin_ADeg ;
|
||||
warm_ADeg = warm_ADeg ;
|
||||
wet_ADeg = duplADeg "wet" ;
|
||||
white_ADeg = white_ADeg ;
|
||||
wide_ADeg = regADeg "wide" ;
|
||||
yellow_ADeg = yellow_ADeg ;
|
||||
|
||||
left_A = regA "left" ;
|
||||
right_A = regA "right" ;
|
||||
|
||||
-- Nouns
|
||||
|
||||
animal_N = regN "animal" ;
|
||||
ashes_N = regN "ash" ; -- FIXME: plural only?
|
||||
back_N = regN "back" ;
|
||||
bark_N = regN "bark" ;
|
||||
belly_N = regN "belly" ;
|
||||
bird_N = bird_N;
|
||||
blood_N = regN "blood" ;
|
||||
bone_N = regN "bone" ;
|
||||
breast_N = regN "breast" ;
|
||||
child_N = child_N ;
|
||||
cloud_N = regN "cloud" ;
|
||||
day_N = regN "day" ;
|
||||
dog_N = dog_N ;
|
||||
dust_N = regN "dust" ;
|
||||
ear_N = regN "ear" ;
|
||||
earth_N = regN "earth" ;
|
||||
egg_N = regN "egg" ;
|
||||
eye_N = regN "eye" ;
|
||||
fat_N = regN "fat" ;
|
||||
father_N = UseN2 father_N2 ;
|
||||
feather_N = regN "feather" ;
|
||||
fingernail_N = regN "fingernail" ;
|
||||
fire_N = regN "fire" ;
|
||||
fish_N = fish_N ;
|
||||
flower_N = regN "flower" ;
|
||||
fog_N = regN "fog" ;
|
||||
foot_N = mk2N "foot" "feet" ;
|
||||
forest_N = regN "forest" ;
|
||||
fruit_N = fruit_N ;
|
||||
grass_N = regN "grass" ;
|
||||
guts_N = regN "gut" ; -- FIXME: no singular
|
||||
hair_N = regN "hair" ;
|
||||
hand_N = regN "hand" ;
|
||||
head_N = regN "head" ;
|
||||
heart_N = regN "heart" ;
|
||||
horn_N = regN "horn" ;
|
||||
husband_N = genderN masculine (regN "husband") ;
|
||||
ice_N = regN "ice" ;
|
||||
knee_N = regN "knee" ;
|
||||
lake_N = lake_N ;
|
||||
leaf_N = mk2N "leaf" "leaves" ;
|
||||
leg_N = regN "leg" ;
|
||||
liver_N = regN "liver" ;
|
||||
louse_N = mk2N "louse" "lice" ;
|
||||
man_N = man_N ;
|
||||
meat_N = meat_N ;
|
||||
moon_N = moon_N ;
|
||||
mother_N = UseN2 mother_N2 ;
|
||||
mountain_N = mountain_N ;
|
||||
mouth_N = regN "mouth" ;
|
||||
name_N = regN "name" ;
|
||||
neck_N = regN "neck" ;
|
||||
night_N = regN "night" ;
|
||||
nose_N = regN "nose" ;
|
||||
person_N = genderN human (regN "person") ;
|
||||
rain_N = regN "rain" ;
|
||||
river_N = river_N ;
|
||||
road_N = regN "road" ;
|
||||
root_N = regN "root" ;
|
||||
rope_N = regN "rope" ;
|
||||
salt_N = regN "salt" ;
|
||||
sand_N = regN "sand" ;
|
||||
sea_N = sea_N ;
|
||||
seed_N = regN "seed" ;
|
||||
skin_N = regN "skin" ;
|
||||
sky_N = regN "sky" ;
|
||||
smoke_N = regN "smoke" ;
|
||||
snake_N = snake_N ;
|
||||
snow_N = regN "snow" ;
|
||||
star_N = star_N ;
|
||||
stick_N = regN "stick" ;
|
||||
stone_N = stone_N ;
|
||||
sun_N = sun_N ;
|
||||
tail_N = regN "tail" ;
|
||||
tongue_N = regN "tongue" ;
|
||||
tooth_N = mk2N "tooth" "teeth" ;
|
||||
tree_N = tree_N ;
|
||||
water_N = water_N ;
|
||||
wife_N = genderN feminine (mk2N "wife" "wives") ;
|
||||
wind_N = regN "wind" ;
|
||||
wing_N = regN "wing" ;
|
||||
woman_N = woman_N ;
|
||||
worm_N = regN "worm" ;
|
||||
year_N = regN "year" ;
|
||||
|
||||
-- Verbs
|
||||
|
||||
bite_V = bite_V ;
|
||||
blow_V = blow_V ;
|
||||
breathe_V = regV "breathe" ;
|
||||
burn_V = burn_V ;
|
||||
come_V = come_V ;
|
||||
count_V = regV "count" ;
|
||||
cut_V = cut_V ;
|
||||
die_V = die_V ;
|
||||
dig_V = dig_V ;
|
||||
drink_V = drink_V ;
|
||||
eat_V = eat_V ;
|
||||
fall_V = fall_V ;
|
||||
fear_V = regV "fear" ;
|
||||
fight_V = fight_V ;
|
||||
float_V = regV "float" ;
|
||||
flow_V = regV "flow" ;
|
||||
fly_V = fly_V ;
|
||||
freeze_V = freeze_V ;
|
||||
give_V = give_V ;
|
||||
hear_V = hear_V ;
|
||||
hit_V = hit_V ;
|
||||
hold_V = hold_V ;
|
||||
hunt_V = regV "hunt" ;
|
||||
kill_V = regV "kill" ;
|
||||
know_V = know_V ;
|
||||
laugh_V = regV "laugh" ;
|
||||
lie_V = lie_V ;
|
||||
live_V = live_V ;
|
||||
play_V = UseV2 play_V2 ;
|
||||
pull_V = regV "pull" ;
|
||||
push_V = regV "push" ;
|
||||
rub_V = regDuplV "rub" ;
|
||||
say_V = say_V ;
|
||||
scratch_V = regV "scratch" ;
|
||||
see_V = see_V ;
|
||||
sew_V = sew_V ;
|
||||
sing_V = sing_V ;
|
||||
sit_V = sit_V ;
|
||||
sleep_V = sleep_V ;
|
||||
smell_V = regV "smell" ;
|
||||
spit_V = spit_V ;
|
||||
split_V = split_V ;
|
||||
squeeze_V = regV "squeeze" ;
|
||||
stab_V = regDuplV "stab" ;
|
||||
stand_V = stand_V ;
|
||||
suck_V = regV "suck" ;
|
||||
swell_V = swell_V ;
|
||||
swim_V = swim_V ;
|
||||
think_V = think_V ;
|
||||
throw_V = throw_V ;
|
||||
tie_V = regV "tie" ;
|
||||
turn_V = regV "turn" ;
|
||||
vomit_V = regV "vomit" ;
|
||||
walk_V = walk_V ;
|
||||
wash_V = regV "wash" ;
|
||||
wipe_V = regV "wipe" ;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,31 +0,0 @@
|
||||
concrete TimeEng of Time = NumeralsEng **
|
||||
open Prelude, CategoriesEng, ParadigmsEng, MorphoEng in {
|
||||
|
||||
lincat
|
||||
Date = SS ;
|
||||
Weekday = N ;
|
||||
Hour = SS ;
|
||||
Minute = SS ;
|
||||
Time = SS ;
|
||||
|
||||
lin
|
||||
DayDate day = ss (day.s ! singular ! nominative) ;
|
||||
DayTimeDate day time = ss (day.s ! singular ! nominative ++ "at" ++ time.s) ;
|
||||
|
||||
FormalTime = infixSS ["hundred and"] ;
|
||||
PastTime h m = ss (m.s ++ "past" ++ h.s) ;
|
||||
ToTime h m = ss (m.s ++ "to" ++ h.s) ;
|
||||
ExactTime h = ss (h.s ++ "sharp") ;
|
||||
|
||||
NumHour n = {s = n.s ! NCard} ;
|
||||
NumMinute n = {s = n.s ! NCard} ;
|
||||
|
||||
monday = regN "Monday" ;
|
||||
tuesday = regN "Tuesday" ;
|
||||
wednesday = regN "Wednesday" ;
|
||||
thursday = regN "Thursday" ;
|
||||
friday = regN "Friday" ;
|
||||
saturday = regN "Saturday" ;
|
||||
sunday = regN "Sunday" ;
|
||||
|
||||
} ;
|
||||
@@ -1,112 +0,0 @@
|
||||
--1 English Word Classes and Morphological Parameters
|
||||
--
|
||||
-- This is a resource module for English morphology, defining the
|
||||
-- morphological parameters and word classes of English. It is aimed
|
||||
-- to be complete w.r.t. the description of word forms.
|
||||
-- However, it only includes those parameters that are needed for
|
||||
-- analysing individual words: such parameters are defined in syntax modules.
|
||||
--
|
||||
-- We use the language-independent prelude.
|
||||
|
||||
resource TypesEng = open Prelude in {
|
||||
|
||||
--
|
||||
--2 Enumerated parameter types
|
||||
--
|
||||
-- These types are the ones found in school grammars.
|
||||
-- Their parameter values are atomic.
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Gender = Neutr | Masc | Fem ;
|
||||
Case = Nom | Gen ;
|
||||
Person = P1 | P2 | P3 ;
|
||||
Degree = Pos | Comp | Sup ;
|
||||
|
||||
-- For data abstraction, we define
|
||||
|
||||
oper
|
||||
singular = Sg ;
|
||||
plural = Pl ;
|
||||
|
||||
--2 Word classes and hierarchical parameter types
|
||||
--
|
||||
-- Real parameter types (i.e. ones on which words and phrases depend)
|
||||
-- are often hierarchical. The alternative would be cross-products of
|
||||
-- simple parameters, but this would usually overgenerate.
|
||||
--
|
||||
|
||||
--3 Common nouns
|
||||
--
|
||||
-- Common nouns are inflected in number and case.
|
||||
|
||||
CommonNoun : Type = {s : Number => Case => Str} ;
|
||||
|
||||
|
||||
--
|
||||
--3 Adjectives
|
||||
--
|
||||
-- The major division is between the comparison degrees, but it
|
||||
-- is also good to leave room for adjectives that cannon be compared.
|
||||
-- It is, however, productive to form an adverbial from any adjective.
|
||||
|
||||
param AForm = AAdj | AAdv ;
|
||||
|
||||
oper
|
||||
Adjective : Type = SS1 AForm ;
|
||||
AdjDegr = {s : Degree => AForm => Str} ;
|
||||
|
||||
--3 Verbs
|
||||
--
|
||||
-- We treat the full conjugation now.
|
||||
-- The present tense is made to depend on person, which correspond to forms
|
||||
-- in the singular; plural forms are uniformly equal to the 2nd person singular.
|
||||
|
||||
param
|
||||
VForm = InfImp | Indic Number | Pastt | PPart | PresPart ;
|
||||
|
||||
-- This is for auxiliary verbs, which have special negated indicative forms.
|
||||
|
||||
AuxVerbForm = AInfImp | AIndic Person Bool | APastt Number Bool | APPart | APresPart ;
|
||||
|
||||
|
||||
oper
|
||||
VerbP3 : Type = {s : VForm => Str} ;
|
||||
|
||||
-- A full verb can moreover have a particle.
|
||||
|
||||
Particle : Type = Str ;
|
||||
Verb = VerbP3 ** {s1 : Particle} ;
|
||||
|
||||
AuxVerb = {s : AuxVerbForm => Str} ;
|
||||
|
||||
--
|
||||
--3 Pronouns
|
||||
--
|
||||
-- For pronouns, we need four case forms: "I" - "me" - "my" - "mine".
|
||||
|
||||
param
|
||||
NPForm = NomP | AccP | GenP | GenSP ;
|
||||
|
||||
oper
|
||||
Pronoun : Type =
|
||||
{s : NPForm => Str ; n : Number ; p : Person ; g : Gender} ;
|
||||
|
||||
-- Coercions between pronoun cases and ordinaty cases.
|
||||
|
||||
toCase : NPForm -> Case = \c -> case c of {GenP => Gen ; _ => Nom} ;
|
||||
toNPForm : Case -> NPForm = \c -> case c of {Gen => GenP ; _ => NomP} ; ---
|
||||
|
||||
--3 Proper names
|
||||
--
|
||||
-- Proper names only need two cases.
|
||||
|
||||
ProperName : Type = {s : Case => Str ; g : Gender} ;
|
||||
|
||||
--3 Relative pronouns
|
||||
--
|
||||
-- Relative pronouns are inflected in gender (human/nonhuman), number, and case.
|
||||
|
||||
RelPron : Type = {s : Gender => Number => NPForm => Str} ;
|
||||
} ;
|
||||
|
||||
36
lib/resource/english/VerbEng.gf
Normal file
36
lib/resource/english/VerbEng.gf
Normal file
@@ -0,0 +1,36 @@
|
||||
concrete VerbEng of Verb = CatEng ** open ResEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV = predV ;
|
||||
ComplV2 v np = insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v) ;
|
||||
ComplV3 v np np2 =
|
||||
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ v.c3 ++ np2.s ! Acc) (predV v) ;
|
||||
|
||||
ComplVV v vp = insertObj (\\a => infVP v.isAux vp a) (predVV v) ;
|
||||
|
||||
ComplVS v s = insertObj (\\_ => conjThat ++ s.s) (predV v) ;
|
||||
ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ;
|
||||
|
||||
ComplVA v ap = insertObj (ap.s) (predV v) ;
|
||||
ComplV2A v np ap =
|
||||
insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ;
|
||||
|
||||
UseComp comp = insertObj comp.s (predAux auxBe) ;
|
||||
|
||||
AdvVP vp adv = insertObj (\\_ => adv.s) vp ;
|
||||
|
||||
AdVVP adv vp = insertAdV adv.s vp ;
|
||||
|
||||
ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ;
|
||||
|
||||
PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ;
|
||||
|
||||
UseVS, UseVQ = \vv -> {s = vv.s ; c2 = [] ; isRefl = vv.isRefl} ; -- no "to"
|
||||
|
||||
CompAP ap = ap ;
|
||||
CompNP np = {s = \\_ => np.s ! Acc} ;
|
||||
CompAdv a = {s = \\_ => a.s} ;
|
||||
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
--# -path=.:../abstract:../../prelude
|
||||
|
||||
--1 The Top-Level English Resource Grammar: Combination Rules
|
||||
--
|
||||
-- Aarne Ranta 2002 -- 2003
|
||||
--
|
||||
-- This is the English concrete syntax of the multilingual resource
|
||||
-- grammar. Most of the work is done in the file $syntax.Eng.gf$.
|
||||
-- However, for the purpose of documentation, we make here explicit the
|
||||
-- linearization types of each category, so that their structures and
|
||||
-- dependencies can be seen.
|
||||
-- Another substantial part are the linearization rules of some
|
||||
-- structural words.
|
||||
--
|
||||
-- The users of the resource grammar should not look at this file for the
|
||||
-- linearization rules, which are in fact hidden in the document version.
|
||||
-- They should use $resource.Abs.gf$ to access the syntactic rules.
|
||||
-- This file can be consulted in those, hopefully rare, occasions in which
|
||||
-- one has to know how the syntactic categories are
|
||||
-- implemented. The parameter types are defined in $TypesEng.gf$.
|
||||
|
||||
concrete VerbphraseEng of Verbphrase = CategoriesEng **
|
||||
open Prelude, SyntaxEng in {
|
||||
|
||||
flags optimize=all_subs ;
|
||||
|
||||
lin
|
||||
UseV v = predClauseGroup v (complVerb v) ;
|
||||
UsePassV v = predClauseBeGroup (passVerb v) ;
|
||||
ComplV2 v x = predClauseGroup v (complTransVerb v x) ;
|
||||
ComplReflV2 v = predClauseGroup v (reflTransVerb v) ;
|
||||
ComplV3 v x y = predClauseGroup v (complDitransVerb v x y) ;
|
||||
ComplVS v x = predClauseGroup v (complSentVerb v x) ;
|
||||
ComplVV v x = predClauseGroup (aux2verb v) (complVerbVerb v x) ;
|
||||
ComplVQ v x = predClauseGroup v (complQuestVerb v x) ;
|
||||
ComplVA v x = predClauseGroup v (complAdjVerb v x) ;
|
||||
ComplV2A v x y = predClauseGroup v (complDitransAdjVerb v x y) ;
|
||||
ComplSubjV2V v x y = predClauseGroup v (complDitransVerbVerb False v x y) ;
|
||||
ComplObjV2V v x y = predClauseGroup v (complDitransVerbVerb True v x y) ;
|
||||
ComplV2S v x y = predClauseGroup v (complDitransSentVerb v x y) ;
|
||||
ComplV2Q v x y = predClauseGroup v (complDitransQuestVerb v x y) ;
|
||||
|
||||
PredAP v = predClauseBeGroup v.s ;
|
||||
PredCN v = predClauseBeGroup (complCommNoun v) ;
|
||||
PredNP v = predClauseBeGroup (complNounPhrase v) ;
|
||||
PredAdv v = predClauseBeGroup (complAdverb v) ;
|
||||
|
||||
PredProgVP = progressiveVerbPhrase ;
|
||||
|
||||
-- Use VPs
|
||||
|
||||
PredVP = predVerbGroupClause ;
|
||||
|
||||
RelVP = relVerbPhrase ;
|
||||
IntVP = intVerbPhrase ;
|
||||
|
||||
-- PosVP = predVerbGroup True ;
|
||||
-- NegVP = predVerbGroup False ;
|
||||
UseVP = predVerbGroup ;
|
||||
|
||||
AdvVP = adVerbPhrase ;
|
||||
SubjVP = subjunctVerbPhrase ;
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
-- http://www2.gsu.edu/~wwwesl/egw/verbs.htm
|
||||
awake awoke awoken
|
||||
-- be was, were been
|
||||
bear bore born
|
||||
beat beat beat
|
||||
become became become
|
||||
begin began begun
|
||||
bend bent bent
|
||||
beset beset beset
|
||||
bet bet bet
|
||||
bid bid/bade bid/bidden
|
||||
bind bound bound
|
||||
bite bit bitten
|
||||
bleed bled bled
|
||||
blow blew blown
|
||||
break broke broken
|
||||
breed bred bred
|
||||
bring brought brought
|
||||
broadcast broadcast broadcast
|
||||
build built built
|
||||
burn burned/burnt burned/burnt
|
||||
burst burst burst
|
||||
buy bought bought
|
||||
cast cast cast
|
||||
catch caught caught
|
||||
choose chose chosen
|
||||
cling clung clung
|
||||
come came come
|
||||
cost cost cost
|
||||
creep crept crept
|
||||
cut cut cut
|
||||
deal dealt dealt
|
||||
dig dug dug
|
||||
dive dived/dove dived
|
||||
do did done
|
||||
draw drew drawn
|
||||
dream dreamed/dreamt dreamed/dreamt
|
||||
drive drove driven
|
||||
drink drank drunk
|
||||
eat ate eaten
|
||||
fall fell fallen
|
||||
feed fed fed
|
||||
feel felt felt
|
||||
fight fought fought
|
||||
find found found
|
||||
fit fit fit
|
||||
flee fled fled
|
||||
fling flung flung
|
||||
fly flew flown
|
||||
forbid forbade forbidden
|
||||
forget forgot forgotten
|
||||
-- forego (forgo) forewent foregone
|
||||
forgive forgave forgiven
|
||||
forsake forsook forsaken
|
||||
freeze froze frozen
|
||||
get got gotten
|
||||
give gave given
|
||||
go went gone
|
||||
grind ground ground
|
||||
grow grew grown
|
||||
hang hung hung
|
||||
hear heard heard
|
||||
hide hid hidden
|
||||
hit hit hit
|
||||
hold held held
|
||||
hurt hurt hurt
|
||||
keep kept kept
|
||||
kneel knelt knelt
|
||||
knit knit knit
|
||||
know knew know
|
||||
lay laid laid
|
||||
lead led led
|
||||
leap leaped/lept leaped/lept
|
||||
learn learned/learnt learned/learnt
|
||||
leave left left
|
||||
lend lent lent
|
||||
let let let
|
||||
lie lay lain
|
||||
light lighted/lit lighted
|
||||
lose lost lost
|
||||
make made made
|
||||
mean meant meant
|
||||
meet met met
|
||||
misspell misspelled/misspelt misspelled/misspelt
|
||||
mistake mistook mistaken
|
||||
mow mowed mowed/mown
|
||||
overcome overcame overcome
|
||||
overdo overdid overdone
|
||||
overtake overtook overtaken
|
||||
overthrow overthrew overthrown
|
||||
pay paid paid
|
||||
plead pled pled
|
||||
prove proved proved/proven
|
||||
put put put
|
||||
quit quit quit
|
||||
read read read
|
||||
rid rid rid
|
||||
ride rode ridden
|
||||
ring rang rung
|
||||
rise rose risen
|
||||
run ran run
|
||||
saw sawed sawed/sawn
|
||||
say said said
|
||||
see saw seen
|
||||
seek sought sought
|
||||
sell sold sold
|
||||
send sent sent
|
||||
set set set
|
||||
sew sewed sewed/sewn
|
||||
shake shook shaken
|
||||
shave shaved shaved/shaven
|
||||
shear shore shorn
|
||||
shed shed shed
|
||||
shine shone shone
|
||||
shoe shoed shoed/shod
|
||||
shoot shot shot
|
||||
show showed showed/shown
|
||||
shrink shrank shrunk
|
||||
shut shut shut
|
||||
sing sang sung
|
||||
sink sank sunk
|
||||
sit sat sat
|
||||
sleep slept slept
|
||||
slay slew slain
|
||||
slide slid slid
|
||||
sling slung slung
|
||||
slit slit slit
|
||||
smite smote smitten
|
||||
sow sowed sowed/sown
|
||||
speak spoke spoken
|
||||
speed sped sped
|
||||
spend spent spent
|
||||
spill spilled/spilt spilled/spilt
|
||||
spin spun spun
|
||||
spit spit/spat spit
|
||||
split split split
|
||||
spread spread spread
|
||||
spring sprang/sprung sprung
|
||||
stand stood stood
|
||||
steal stole stolen
|
||||
stick stuck stuck
|
||||
sting stung stung
|
||||
stink stank stunk
|
||||
stride strod stridden
|
||||
strike struck struck
|
||||
string strung strung
|
||||
strive strove striven
|
||||
swear swore sworn
|
||||
sweep swept swept
|
||||
swell swelled swelled/swollen
|
||||
swim swam swum
|
||||
swing swung swung
|
||||
take took taken
|
||||
teach taught taught
|
||||
tear tore torn
|
||||
tell told told
|
||||
think thought thought
|
||||
thrive thrived/throve thrived
|
||||
throw threw thrown
|
||||
thrust thrust thrust
|
||||
tread trod trodden
|
||||
understand understood understood
|
||||
uphold upheld upheld
|
||||
upset upset upset
|
||||
wake woke woken
|
||||
wear wore worn
|
||||
weave weaved/wove weaved/woven
|
||||
wed wed wed
|
||||
weep wept wept
|
||||
wind wound wound
|
||||
win won won
|
||||
withhold withheld withheld
|
||||
withstand withstood withstood
|
||||
wring wrung wrung
|
||||
write wrote written
|
||||
Reference in New Issue
Block a user