diff --git a/lib/next-resource/abstract/Adjective.gf b/lib/next-resource/abstract/Adjective.gf new file mode 100644 index 000000000..4255b7eee --- /dev/null +++ b/lib/next-resource/abstract/Adjective.gf @@ -0,0 +1,30 @@ +--1 Adjective: Adjectives and Adjectival Phrases + +abstract Adjective = Cat ** { + + fun + +-- The principal ways of forming an adjectival phrase are +-- positive, comparative, relational, reflexive-relational, and +-- elliptic-relational. +-- (The superlative use is covered in [Noun Noun.html].$SuperlA$.) + + PositA : A -> AP ; -- warm + ComparA : A -> NP -> AP ; -- warmer than I + ComplA2 : A2 -> NP -> AP ; -- married to her + ReflA2 : A2 -> AP ; -- married to itself + UseA2 : A2 -> A ; -- married + +-- Sentence and question complements defined for all adjectival +-- phrases, although the semantics is only clear for some adjectives. + + SentAP : AP -> SC -> AP ; -- good that she is here + +-- An adjectival phrase can be modified by an *adadjective*, such as "very". + + AdAP : AdA -> AP -> AP ; -- very warm + +-- The formation of adverbs from adjective (e.g. "quickly") is covered +-- in [Adverb Adverb.html]. + +} diff --git a/lib/next-resource/abstract/Adverb.gf b/lib/next-resource/abstract/Adverb.gf new file mode 100644 index 000000000..3199d6888 --- /dev/null +++ b/lib/next-resource/abstract/Adverb.gf @@ -0,0 +1,32 @@ +--1 Adverb: Adverbs and Adverbial Phrases + +abstract Adverb = Cat ** { + + fun + +-- The two main ways of forming adverbs are from adjectives and by +-- prepositions from noun phrases. + + PositAdvAdj : A -> Adv ; -- warmly + PrepNP : Prep -> NP -> Adv ; -- in the house + +-- Comparative adverbs have a noun phrase or a sentence as object of +-- comparison. + + ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more warmly than John + ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs + +-- Adverbs can be modified by 'adadjectives', just like adjectives. + + AdAdv : AdA -> Adv -> Adv ; -- very quickly + +-- Subordinate clauses can function as adverbs. + + SubjS : Subj -> S -> Adv ; -- when she sleeps + +-- Comparison adverbs also work as numeral adverbs. + + AdnCAdv : CAdv -> AdN ; -- less (than five) + + +} diff --git a/lib/next-resource/abstract/Backward.gf b/lib/next-resource/abstract/Backward.gf new file mode 100644 index 000000000..458fb3010 --- /dev/null +++ b/lib/next-resource/abstract/Backward.gf @@ -0,0 +1,63 @@ +--1 Obsolete constructs included for backward-compatibility + +abstract Backward = Cat ** { + + +-- from Cat + +cat + Slash ; + +fun + +-- from Verb 19/4/2008 + + ComplV2 : V2 -> NP -> VP ; -- use it + ComplV3 : V3 -> NP -> NP -> VP ; -- send a message to her + ComplV2V : V2V -> NP -> VP -> VP ; -- cause it to burn + ComplV2S : V2S -> NP -> S -> VP ; -- tell me that it rains + ComplV2Q : V2Q -> NP -> QS -> VP ; -- ask me who came + ComplV2A : V2A -> NP -> AP -> VP ; -- paint it red + + ReflV2 : V2 -> VP ; -- use itself + + UseVQ : VQ -> V2 ; -- ask (a question) + UseVS : VS -> V2 ; -- know (a secret) + + +-- from Sentence 19/4/2008 + + SlashV2 : NP -> V2 -> Slash ; -- (whom) he sees + SlashVVV2 : NP -> VV -> V2 -> Slash; -- (whom) he wants to see + +-- from Noun 19/4/2008 + + NumInt : Int -> Num ; -- 51 + OrdInt : Int -> Ord ; -- 51st (DEPRECATED) + NoOrd : Ord ; + + -- 20/4 + DetSg : Quant -> Ord -> Det ; -- the best man + DetPl : Quant -> Num -> Ord -> Det ; -- the five best men + NoNum : Num ; + + -- 22/4 + DefArt : Quant ; -- the (house), the (houses) + IndefArt : Quant ; -- a (house), (houses) + MassDet : Quant ; -- (beer) + +-- from Structural 19/4/2008 + + that_NP : NP ; + these_NP : NP ; + this_NP : NP ; + those_NP : NP ; + + whichPl_IDet : IDet ; + whichSg_IDet : IDet ; + +-- from Adverb + + AdvSC : SC -> Adv ; -- that he arrives ---- REMOVE? + +} diff --git a/lib/next-resource/abstract/Cat.gf b/lib/next-resource/abstract/Cat.gf new file mode 100644 index 000000000..0a1cebaf4 --- /dev/null +++ b/lib/next-resource/abstract/Cat.gf @@ -0,0 +1,133 @@ +--1 Cat: the Category System + +-- The category system is central to the library in the sense +-- that the other modules ($Adjective$, $Adverb$, $Noun$, $Verb$ etc) +-- communicate through it. This means that a e.g. a function using +-- $NP$s in $Verb$ need not know how $NP$s are constructed in $Noun$: +-- it is enough that both $Verb$ and $Noun$ use the same type $NP$, +-- which is given here in $Cat$. +-- +-- Some categories are inherited from [``Common`` Common.html]. +-- The reason they are defined there is that they have the same +-- implementation in all languages in the resource (typically, +-- just a string). These categories are +-- $AdA, AdN, AdV, Adv, Ant, CAdv, IAdv, PConj, Phr$, +-- $Pol, SC, Tense, Text, Utt, Voc$. +-- +-- Moreover, the list categories $ListAdv, ListAP, ListNP, ListS$ +-- are defined on $Conjunction$ and only used locally there. + + +abstract Cat = Common ** { + + cat + +--2 Sentences and clauses + +-- Constructed in [Sentence Sentence.html], and also in +-- [Idiom Idiom.html]. + + S ; -- declarative sentence e.g. "she lived here" + QS ; -- question e.g. "where did she live" + RS ; -- relative e.g. "in which she lived" + Cl ; -- declarative clause, with all tenses e.g. "she looks at this" + ClSlash;-- clause missing NP (S/NP in GPSG) e.g. "she looks at" + SSlash ;-- sentence missing NP e.g. "she has looked at" + Imp ; -- imperative e.g. "look at this" + +--2 Questions and interrogatives + +-- Constructed in [Question Question.html]. + + QCl ; -- question clause, with all tenses e.g. "why does she walk" + IP ; -- interrogative pronoun e.g. "who" + IComp ; -- interrogative complement of copula e.g. "where" + IDet ; -- interrogative determiner e.g. "how many" + IQuant; -- interrogative quantifier e.g. "which" + +--2 Relative clauses and pronouns + +-- Constructed in [Relative Relative.html]. + + RCl ; -- relative clause, with all tenses e.g. "in which she lives" + RP ; -- relative pronoun e.g. "in which" + +--2 Verb phrases + +-- Constructed in [Verb Verb.html]. + + VP ; -- verb phrase e.g. "is very warm" + Comp ; -- complement of copula, such as AP e.g. "very warm" + VPSlash ; -- verb phrase missing complement e.g. "give to John" + +--2 Adjectival phrases + +-- Constructed in [Adjective Adjective.html]. + + AP ; -- adjectival phrase e.g. "very warm" + +--2 Nouns and noun phrases + +-- Constructed in [Noun Noun.html]. +-- Many atomic noun phrases e.g. "everybody" +-- are constructed in [Structural Structural.html]. +-- The determiner structure is +-- ``` Predet (QuantSg | QuantPl Num) Ord +-- as defined in [Noun Noun.html]. + + CN ; -- common noun (without determiner) e.g. "red house" + NP ; -- noun phrase (subject or object) e.g. "the red house" + Pron ; -- personal pronoun e.g. "she" + Det ; -- determiner phrase e.g. "those seven" + Predet ; -- predeterminer (prefixed Quant) e.g. "all" + Quant ; -- quantifier ('nucleus' of Det) e.g. "this/these" + Num ; -- number determining element e.g. "seven" + Card ; -- cardinal number e.g. "seven" + Ord ; -- ordinal number (used in Det) e.g. "seventh" + +--2 Numerals + +-- Constructed in [Numeral Numeral.html]. + + Numeral ; -- cardinal or ordinal in words e.g. "five/fifth" + Digits ; -- cardinal or ordinal in digits e.g. "1,000/1,000th" + +--2 Structural words + +-- Constructed in [Structural Structural.html]. + + Conj ; -- conjunction e.g. "and" +---b DConj ; -- distributed conjunction e.g. "both - and" + Subj ; -- subjunction e.g. "if" + Prep ; -- preposition, or just case e.g. "in" + +--2 Words of open classes + +-- These are constructed in [Lexicon Lexicon.html] and in +-- additional lexicon modules. + + V ; -- one-place verb e.g. "sleep" + V2 ; -- two-place verb e.g. "love" + V3 ; -- three-place verb e.g. "show" + VV ; -- verb-phrase-complement verb e.g. "want" + VS ; -- sentence-complement verb e.g. "claim" + VQ ; -- question-complement verb e.g. "wonder" + VA ; -- adjective-complement verb e.g. "look" + V2V ; -- verb with NP and V complement e.g. "cause" + V2S ; -- verb with NP and S complement e.g. "tell" + V2Q ; -- verb with NP and Q complement e.g. "ask" + V2A ; -- verb with NP and AP complement e.g. "paint" + + A ; -- one-place adjective e.g. "warm" + A2 ; -- two-place adjective e.g. "divisible" + + N ; -- common noun e.g. "house" + N2 ; -- relational noun e.g. "son" + N3 ; -- three-place relational noun e.g. "connection" + PN ; -- proper name e.g. "Paris" + +-- DEPRECATED: QuantSg, QuantPl +--- QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every" +--- QuantPl ;-- quantifier ('nucleus' of plur. Det) e.g. "many" + +} diff --git a/lib/next-resource/abstract/Common.gf b/lib/next-resource/abstract/Common.gf new file mode 100644 index 000000000..76bfd9cf4 --- /dev/null +++ b/lib/next-resource/abstract/Common.gf @@ -0,0 +1,61 @@ +--1 Common: Structures with Common Implementations. + +-- This module defines the categories that uniformly have the linearization +-- ${s : Str}$ in all languages. + +-- Moreover, this module defines the abstract parameters of tense, polarity, and +-- anteriority, which are used in [``Phrase`` Phrase.html] to generate different +-- forms of sentences. Together they give 4 x 2 x 2 = 16 sentence forms. + +-- These tenses are defined for all languages in the library. More tenses +-- can be defined in the language extensions, e.g. the "passé simple" of +-- Romance languages in [``ExtraRomance`` ../romance/ExtraRomance.gf]. + +abstract Common = { + + cat + +--2 Top-level units + +-- Constructed in [``Text`` Text.html]: $Text$. + + Text ; -- text consisting of several phrases e.g. "He is here. Why?" + +-- Constructed in [``Phrase`` Phrase.html]: + + Phr ; -- phrase in a text e.g. "but be quiet please" + Utt ; -- sentence, question, word... e.g. "be quiet" + Voc ; -- vocative or "please" e.g. "my darling" + PConj ; -- phrase-beginning conjunction e.g. "therefore" + +-- Constructed in [``Sentence`` Sentence.html]: + + SC ; -- embedded sentence or question e.g. "that it rains" + +--2 Adverbs + +-- Constructed in [``Adverb`` Adverb.html]. +-- Many adverbs are constructed in [``Structural`` Structural.html]. + + Adv ; -- verb-phrase-modifying adverb e.g. "in the house" + AdV ; -- adverb directly attached to verb e.g. "always" + AdA ; -- adjective-modifying adverb e.g. "very" + AdN ; -- numeral-modifying adverb e.g. "more than" + IAdv ; -- interrogative adverb e.g. "why" + CAdv ; -- comparative adverb e.g. "more" + +--2 Tense, polarity, and anteriority + + Tense ; -- tense e.g. present, past, future + Pol ; -- polarity e.g. positive, negative + Ant ; -- anteriority e.g. simultaneous, anterior + + fun + PPos, PNeg : Pol ; -- I sleep/don't sleep + + TPres : Tense ; + ASimul : Ant ; + TPast, TFut, TCond : Tense ; -- I slept/will sleep/would sleep --# notpresent + AAnter : Ant ; -- I have slept --# notpresent + +} diff --git a/lib/next-resource/abstract/Conjunction.gf b/lib/next-resource/abstract/Conjunction.gf new file mode 100644 index 000000000..4c2183919 --- /dev/null +++ b/lib/next-resource/abstract/Conjunction.gf @@ -0,0 +1,52 @@ +--1 Conjunction: Coordination + +-- Coordination is defined for many different categories; here is +-- a sample. The rules apply to *lists* of two or more elements, +-- and define two general patterns: +-- - ordinary conjunction: X,...X and X +-- - distributed conjunction: both X,...,X and X +-- +-- +-- $VP$ conjunctions are not covered here, because their applicability +-- depends on language. Some special cases are defined in +-- [``Extra`` ../abstract/Extra.gf]. + + +abstract Conjunction = Cat ** { + +--2 Rules + + fun + ConjS : Conj -> [S] -> S ; -- "he walks and she runs" + ConjAP : Conj -> [AP] -> AP ; -- "cold and warm" + ConjNP : Conj -> [NP] -> NP ; -- "she or we" + ConjAdv : Conj -> [Adv] -> Adv ; -- "here or there" + +---b DConjS : DConj -> [S] -> S ; -- "either he walks or she runs" +---b DConjAP : DConj -> [AP] -> AP ; -- "both warm and cold" +---b DConjNP : DConj -> [NP] -> NP ; -- "either he or she" +---b DConjAdv : DConj -> [Adv] -> Adv; -- "both here and there" + +--2 Categories + +-- These categories are only used in this module. + + cat + [S]{2} ; + [Adv]{2} ; + [NP]{2} ; + [AP]{2} ; + +--2 List constructors + +-- The list constructors are derived from the list notation and therefore +-- not given explicitly. But here are their type signatures: + + -- BaseC : C -> C -> [C] ; -- for C = S, AP, NP, Adv + -- ConsC : C -> [C] -> [C] ; +} + +--. +-- *Note*. This module uses right-recursive lists. If backward +-- compatibility with API 0.9 is needed, use +-- [SeqConjunction SeqConjunction.html]. diff --git a/lib/next-resource/abstract/Extra.gf b/lib/next-resource/abstract/Extra.gf new file mode 100644 index 000000000..b0601019f --- /dev/null +++ b/lib/next-resource/abstract/Extra.gf @@ -0,0 +1,30 @@ +--1 More syntax rules + +-- This module defines syntax rules that are not implemented in all +-- languages, but in more than one, so that it makes sense to offer a +-- common API. + +abstract Extra = Cat ** { + + fun + GenNP : NP -> Quant ; -- this man's + ComplBareVS : VS -> S -> VP ; -- know you go + + StrandRelSlash : RP -> ClSlash -> RCl ; -- that he lives in + EmptyRelSlash : RP -> ClSlash -> RCl ; -- he lives in + StrandQuestSlash : IP -> ClSlash -> QCl ; -- whom does John live with + +-- $VP$ conjunction, which has different fragments implemented in +-- different languages - never a full $VP$, though. + + cat + VPI ; + [VPI] {2} ; + + fun + MkVPI : VP -> VPI ; + ConjVPI : Conj -> [VPI] -> VPI ; + ComplVPIVV : VV -> VPI -> VP ; + + +} diff --git a/lib/next-resource/abstract/Grammar.gf b/lib/next-resource/abstract/Grammar.gf new file mode 100644 index 000000000..a1edd59df --- /dev/null +++ b/lib/next-resource/abstract/Grammar.gf @@ -0,0 +1,22 @@ +--1 Grammar: the Main Module of the Resource Grammar + +-- This grammar is a collection of the different grammar modules, +-- To test the resource, import [``Lang`` Lang.html], which also contains +-- a lexicon. + +abstract Grammar = + Noun, + Verb, + Adjective, + Adverb, + Numeral, + Sentence, + Question, + Relative, + Conjunction, + Phrase, + Text, + Structural, + Idiom ; + + diff --git a/lib/next-resource/abstract/Idiom.gf b/lib/next-resource/abstract/Idiom.gf new file mode 100644 index 000000000..6b012becc --- /dev/null +++ b/lib/next-resource/abstract/Idiom.gf @@ -0,0 +1,22 @@ +--1 Idiom: Idiomatic Expressions + +abstract Idiom = Cat ** { + +-- This module defines constructions that are formed in fixed ways, +-- often different even in closely related languages. + + fun + ImpersCl : VP -> Cl ; -- it is hot + GenericCl : VP -> Cl ; -- one sleeps + + CleftNP : NP -> RS -> Cl ; -- it is I who did it + CleftAdv : Adv -> S -> Cl ; -- it is here she slept + + ExistNP : NP -> Cl ; -- there is a house + ExistIP : IP -> QCl ; -- which houses are there + + ProgrVP : VP -> VP ; -- be sleeping + + ImpPl1 : VP -> Utt ; -- let's go + +} diff --git a/lib/next-resource/abstract/Lang.gf b/lib/next-resource/abstract/Lang.gf new file mode 100644 index 000000000..978d970ad --- /dev/null +++ b/lib/next-resource/abstract/Lang.gf @@ -0,0 +1,13 @@ +--1 Lang: a Test Module for the Resource Grammar + +-- This grammar is for testing the resource as included in the +-- language-independent API, consisting of a grammar and a lexicon. +-- The grammar without a lexicon is [``Grammar`` Grammar.html], +-- which may be more suitable to open in applications. + +abstract Lang = + Grammar, + Lexicon + ** { + flags startcat=Phr ; + } ; diff --git a/lib/next-resource/abstract/Lexicon.gf b/lib/next-resource/abstract/Lexicon.gf new file mode 100644 index 000000000..59b844ec9 --- /dev/null +++ b/lib/next-resource/abstract/Lexicon.gf @@ -0,0 +1,356 @@ +abstract Lexicon = Cat ** { +fun + add_V3 : V3 ; + airplane_N : N ; + already_Adv : Adv ; + animal_N : N ; + answer_V2S : V2S ; + apartment_N : N ; + apple_N : N ; + art_N : N ; + ashes_N : N ; + ask_V2Q : V2Q ; + baby_N : N ; + back_N : N ; + bad_A : A ; + bank_N : N ; + bark_N : N ; + beautiful_A : A ; + become_VA : VA ; + beer_N : N ; + beg_V2V : V2V ; + belly_N : N ; + big_A : A ; + bike_N : N ; + bird_N : N ; + bite_V2 : V2 ; + black_A : A ; + blood_N : N ; + blow_V : V ; + blue_A : A ; + boat_N : N ; + bone_N : N ; + book_N : N ; + boot_N : N ; + boss_N : N ; + boy_N : N ; + bread_N : N ; + break_V2 : V2 ; + breast_N : N ; + breathe_V : V ; + broad_A : A ; + brother_N2 : N2 ; + brown_A : A ; + burn_V : V ; + butter_N : N ; + buy_V2 : V2 ; + camera_N : N ; + cap_N : N ; + car_N : N ; + carpet_N : N ; + cat_N : N ; + ceiling_N : N ; + chair_N : N ; + cheese_N : N ; + child_N : N ; + church_N : N ; + city_N : N ; + clean_A : A ; + clever_A : A ; + close_V2 : V2 ; + cloud_N : N ; + coat_N : N ; + cold_A : A ; + come_V : V ; + computer_N : N ; + correct_A : A ; + country_N : N ; + count_V2 : V2 ; + cousin_N : N ; + cow_N : N ; + cut_V2 : V2 ; + day_N : N ; + die_V : V ; + dig_V : V ; + dirty_A : A ; + distance_N3 : N3 ; + doctor_N : N ; + dog_N : N ; + door_N : N ; + do_V2 : V2 ; + drink_V2 : V2 ; + drink_V2 : V2 ; + dry_A : A ; + dull_A : A ; + dust_N : N ; + ear_N : N ; + earth_N : N ; + easy_A2V : A2 ; + eat_V2 : V2 ; + eat_V2 : V2 ; + egg_N : N ; + empty_A : A ; + enemy_N : N ; + eye_N : N ; + factory_N : N ; + fall_V : V ; + far_Adv : Adv ; + father_N2 : N2 ; + fat_N : N ; + fear_VS : VS ; + fear_V2 : V2 ; + feather_N : N ; + fight_V2 : V2 ; + find_V2 : V2 ; + fingernail_N : N ; + fire_N : N ; + fish_N : N ; + float_V : V ; + floor_N : N ; + flower_N : N ; + flow_V : V ; + fly_V : V ; + fog_N : N ; + foot_N : N ; + forest_N : N ; + forget_V2 : V2 ; + freeze_V : V ; + fridge_N : N ; + friend_N : N ; + fruit_N : N ; + full_A : A ; + fun + fun_AV : A ; + garden_N : N ; + girl_N : N ; + give_V3 : V3 ; + glove_N : N ; + gold_N : N ; + good_A : A ; + go_V : V ; + grammar_N : N ; + grass_N : N ; + green_A : A ; + guts_N : N ; + hair_N : N ; + hand_N : N ; + harbour_N : N ; + hate_V2 : V2 ; + hat_N : N ; + have_V2 : V2 ; + head_N : N ; + heart_N : N ; + hear_V2 : V2 ; + hear_V2 : V2 ; + heavy_A : A ; + hill_N : N ; + hit_V2 : V2 ; + hold_V2 : V2 ; + hope_VS : VS ; + horn_N : N ; + horse_N : N ; + hot_A : A ; + house_N : N ; + hunt_V2 : V2 ; + husband_N : N ; + ice_N : N ; + important_A : A ; + industry_N : N ; + iron_N : N ; + john_PN : PN ; + jump_V : V ; + kill_V2 : V2 ; + king_N : N ; + knee_N : N ; + know_V2 : V2 ; + know_V2 : V2 ; + lake_N : N ; + lamp_N : N ; + language_N : N ; + laugh_V : V ; + leaf_N : N ; + learn_V2 : V2 ; + leather_N : N ; + leave_V2 : V2 ; + left_Ord : Ord ; + leg_N : N ; + lie_V : V ; + like_V2 : V2 ; + listen_V2 : V2 ; + liver_N : N ; + live_V : V ; + long_A : A ; + lose_V2 : V2 ; + louse_N : N ; + love_N : N ; + love_V2 : V2 ; + man_N : N ; + married_A2 : A2 ; + meat_N : N ; + milk_N : N ; + moon_N : N ; + mother_N2 : N2 ; + mountain_N : N ; + mouth_N : N ; + music_N : N ; + name_N : N ; + narrow_A : A ; + near_A : A ; + neck_N : N ; + new_A : A ; + newspaper_N : N ; + night_N : N ; + nose_N : N ; + now_Adv : Adv ; + number_N : N ; + oil_N : N ; + old_A : A ; + open_V2 : V2 ; + paint_V2A : V2A ; + paper_N : N ; + paris_PN : PN ; + peace_N : N ; + pen_N : N ; + person_N : N ; + planet_N : N ; + plastic_N : N ; + play_V2 : V2 ; + play_V : V ; + policeman_N : N ; + priest_N : N ; + probable_AS : A ; + pull_V2 : V2 ; + push_V2 : V2 ; + put_V2 : V2 ; + queen_N : N ; + question_N : N ; + radio_N : N ; + rain_N : N ; + rain_V0 : V ; + read_V2 : V2 ; + ready_A : A ; + reason_N : N ; + red_A : A ; + religion_N : N ; + restaurant_N : N ; + right_Ord : Ord ; + river_N : N ; + road_N : N ; + rock_N : N ; + roof_N : N ; + root_N : N ; + rope_N : N ; + rotten_A : A ; + round_A : A ; + rubber_N : N ; + rub_V2 : V2 ; + rule_N : N ; + run_V : V ; + salt_N : N ; + sand_N : N ; + say_VS : VS ; + school_N : N ; + science_N : N ; + scratch_V2 : V2 ; + sea_N : N ; + seed_N : N ; + seek_V2 : V2 ; + see_V2 : V2 ; + see_V2 : V2 ; + sell_V3 : V3 ; + send_V3 : V3 ; + sew_V : V ; + sharp_A : A ; + sheep_N : N ; + ship_N : N ; + shirt_N : N ; + shoe_N : N ; + shop_N : N ; + short_A : A ; + silver_N : N ; + sing_V : V ; + sister_N : N ; + sit_V : V ; + skin_N : N ; + sky_N : N ; + sleep_V : V ; + small_A : A ; + smell_V : V ; + smoke_N : N ; + smooth_A : A ; + snake_N : N ; + snow_N : N ; + sock_N : N ; + song_N : N ; + speak_V2 : V2 ; + spit_V : V ; + split_V2 : V2 ; + squeeze_V2 : V2 ; + stab_V2 : V2 ; + stand_V : V ; + star_N : N ; + steel_N : N ; + stick_N : N ; + stone_N : N ; + stop_V : V ; + stove_N : N ; + straight_A : A ; + student_N : N ; + stupid_A : A ; + suck_V2 : V2 ; + sun_N : N ; + swell_V : V ; + swim_V : V ; + switch8off_V2 : V2 ; + switch8on_V2 : V2 ; + table_N : N ; + tail_N : N ; + talk_V3 : V3 ; + teacher_N : N ; + teach_V2 : V2 ; + television_N : N ; + thick_A : A ; + thin_A : A ; + think_V : V ; + throw_V2 : V2 ; + tie_V2 : V2 ; + today_Adv : Adv ; + tongue_N : N ; + tooth_N : N ; + train_N : N ; + travel_V : V ; + tree_N : N ; + turn_V : V ; + ugly_A : A ; + uncertain_A : A ; + understand_V2 : V2 ; + university_N : N ; + village_N : N ; + vomit_V : V ; + wait_V2 : V2 ; + walk_V : V ; + warm_A : A ; + war_N : N ; + wash_V2 : V2 ; + watch_V2 : V2 ; + water_N : N ; + wet_A : A ; + white_A : A ; + wide_A : A ; + wife_N : N ; + wind_N : N ; + window_N : N ; + wine_N : N ; + wing_N : N ; + win_V2 : V2 ; + wipe_V2 : V2 ; + woman_N : N ; + wonder_VQ : VQ ; + wood_N : N ; + worm_N : N ; + write_V2 : V2 ; + year_N : N ; + yellow_A : A ; + young_A : A ; + +} diff --git a/lib/next-resource/abstract/Noun.gf b/lib/next-resource/abstract/Noun.gf new file mode 100644 index 000000000..3fdb7964f --- /dev/null +++ b/lib/next-resource/abstract/Noun.gf @@ -0,0 +1,136 @@ +--1 Noun: Nouns, noun phrases, and determiners + +abstract Noun = Cat ** { + + +--2 Noun phrases + +-- The three main types of noun phrases are +-- - common nouns with determiners +-- - proper names +-- - pronouns +-- +-- + fun + DetCN : Det -> CN -> NP ; -- the man + UsePN : PN -> NP ; -- John + UsePron : Pron -> NP ; -- he + +-- Pronouns are defined in the module [``Structural`` Structural.html]. + +-- A noun phrase already formed can be modified by a $Predet$erminer. + + PredetNP : Predet -> NP -> NP; -- only the man + +-- A noun phrase can also be postmodified by the past participle of a +-- verb, by an adverb, or by a relative clause + + PPartNP : NP -> V2 -> NP ; -- the man seen + AdvNP : NP -> Adv -> NP ; -- Paris today + RelNP : NP -> RS -> NP ; -- Paris, which is here + +-- Determiners can form noun phrases directly. + + DetNP : Det -> NP ; -- these five + + +--2 Determiners + +-- The determiner has a fine-grained structure, in which a 'nucleus' +-- quantifier and two optional parts can be discerned: a cardinal and +-- an ordinal numeral. + + DetQuantOrd : Quant -> Num -> Ord -> Det ; -- these five best + DetQuant : Quant -> Num -> Det ; -- these five + +-- Whether the resulting determiner is singular or plural depends on the +-- cardinal. + +-- All parts of the determiner can be empty, except $Quant$, which is +-- the "kernel" of a determiner. It is, however, the $Num$ that determines +-- the inherent number. + + NumSg : Num ; + NumPl : Num ; + NumCard : Card -> Num ; + +-- $Card$ consists of either digits or numeral words. + + NumDigits : Digits -> Card ; -- 51 + NumNumeral : Numeral -> Card ; -- fifty-one + +-- The construction of numerals is defined in [Numeral Numeral.html]. + +-- A $Card$ can be modified by certain adverbs. + + AdNum : AdN -> Card -> Card ; -- almost 51 + +-- An $Ord$ consists of either digits or numeral words. +-- Also superlative forms of adjectives behave syntactically like ordinals. + + OrdDigits : Digits -> Ord ; -- 51st + OrdNumeral : Numeral -> Ord ; -- fifty-first + OrdSuperl : A -> Ord ; -- warmest + +-- Definite and indefinite noun phrases are sometimes realized as +-- neatly distinct words (Spanish "un, unos ; el, los") but also without +-- any particular word (Finnish; Swedish definites). + + IndefArt : Quant ; + DefArt : Quant ; + +-- Nouns can be used without an article as mass nouns. The resource does +-- not distinguish mass nouns from other common nouns, which can result +-- in semantically odd expressions. + + MassNP : CN -> NP ; -- (beer) + +-- Pronouns have possessive forms. Genitives of other kinds +-- of noun phrases are not given here, since they are not possible +-- in e.g. Romance languages. They can be found in $Extra$ modules. + + PossPron : Pron -> Quant ; -- my (house) + +-- Other determiners are defined in [Structural Structural.html]. + + + +--2 Common nouns + +-- Simple nouns can be used as nouns outright. + + UseN : N -> CN ; -- house + +-- Relational nouns take one or two arguments. + + ComplN2 : N2 -> NP -> CN ; -- mother of the king + ComplN3 : N3 -> NP -> N2 ; -- distance from this city (to Paris) + +-- Relational nouns can also be used without their arguments. +-- The semantics is typically derivative of the relational meaning. + + UseN2 : N2 -> CN ; -- mother + Use2N3 : N3 -> N2 ; -- distance (from this city) + Use3N3 : N3 -> N2 ; -- distance (to Paris) + +-- Nouns can be modified by adjectives, relative clauses, and adverbs +-- (the last rule will give rise to many 'PP attachment' ambiguities +-- when used in connection with verb phrases). + + AdjCN : AP -> CN -> CN ; -- big house + RelCN : CN -> RS -> CN ; -- house that John bought + AdvCN : CN -> Adv -> CN ; -- house on the hill + +-- Nouns can also be modified by embedded sentences and questions. +-- For some nouns this makes little sense, but we leave this for applications +-- to decide. Sentential complements are defined in [Verb Verb.html]. + + SentCN : CN -> SC -> CN ; -- question where she sleeps + +--2 Apposition + +-- This is certainly overgenerating. + + ApposCN : CN -> NP -> CN ; -- city Paris (, numbers x and y) + +} ; diff --git a/lib/next-resource/abstract/Numeral.gf b/lib/next-resource/abstract/Numeral.gf new file mode 100644 index 000000000..43c6f8111 --- /dev/null +++ b/lib/next-resource/abstract/Numeral.gf @@ -0,0 +1,60 @@ +--1 Numerals + +-- This grammar defines numerals from 1 to 999999. +-- The implementations are adapted from the +-- [numerals library http://www.cs.chalmers.se/~aarne/GF/examples/numerals/] +-- which defines numerals for 88 languages. +-- The resource grammar implementations add to this inflection (if needed) +-- and ordinal numbers. +-- +-- *Note* 1. Number 1 as defined +-- in the category $Numeral$ here should not be used in the formation of +-- noun phrases, and should therefore be removed. Instead, one should use +-- [Structural Structural.html]$.one_Quant$. This makes the grammar simpler +-- because we can assume that numbers form plural noun phrases. +-- +-- *Note* 2. The implementations introduce spaces between +-- parts of a numeral, which is often incorrect - more work on +-- (un)lexing is needed to solve this problem. + +abstract Numeral = Cat ** { + +cat + Digit ; -- 2..9 + Sub10 ; -- 1..9 + Sub100 ; -- 1..99 + Sub1000 ; -- 1..999 + Sub1000000 ; -- 1..999999 + +fun + num : Sub1000000 -> Numeral ; + + n2, n3, n4, n5, n6, n7, n8, n9 : Digit ; + + pot01 : Sub10 ; -- 1 + pot0 : Digit -> Sub10 ; -- d * 1 + pot110 : Sub100 ; -- 10 + pot111 : Sub100 ; -- 11 + pot1to19 : Digit -> Sub100 ; -- 10 + d + pot0as1 : Sub10 -> Sub100 ; -- coercion of 1..9 + pot1 : Digit -> Sub100 ; -- d * 10 + pot1plus : Digit -> Sub10 -> Sub100 ; -- d * 10 + n + pot1as2 : Sub100 -> Sub1000 ; -- coercion of 1..99 + pot2 : Sub10 -> Sub1000 ; -- m * 100 + pot2plus : Sub10 -> Sub100 -> Sub1000 ; -- m * 100 + n + pot2as3 : Sub1000 -> Sub1000000 ; -- coercion of 1..999 + pot3 : Sub1000 -> Sub1000000 ; -- m * 1000 + pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n + +-- Numerals as sequences of digits have a separate, simpler grammar + + cat + Dig ; -- single digit 0..9 + + fun + IDig : Dig -> Digits ; -- 8 + IIDig : Dig -> Digits -> Digits ; -- 876 + + D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 : Dig ; + +} diff --git a/lib/next-resource/abstract/Phrase.gf b/lib/next-resource/abstract/Phrase.gf new file mode 100644 index 000000000..3606c2d76 --- /dev/null +++ b/lib/next-resource/abstract/Phrase.gf @@ -0,0 +1,44 @@ +--1 Phrase: Phrases and Utterances + +abstract Phrase = Cat ** { + +-- When a phrase is built from an utterance it can be prefixed +-- with a phrasal conjunction (such as "but", "therefore") +-- and suffixing with a vocative (typically a noun phrase). + + fun + PhrUtt : PConj -> Utt -> Voc -> Phr ; -- but come here, my friend + +-- Utterances are formed from sentences, questions, and imperatives. + + UttS : S -> Utt ; -- John walks + UttQS : QS -> Utt ; -- is it good + UttImpSg : Pol -> Imp -> Utt; -- (don't) love yourself + UttImpPl : Pol -> Imp -> Utt; -- (don't) love yourselves + UttImpPol : Pol -> Imp -> Utt ; -- (don't) sleep (polite) + +-- There are also 'one-word utterances'. A typical use of them is +-- as answers to questions. +-- *Note*. This list is incomplete. More categories could be covered. +-- Moreover, in many languages e.g. noun phrases in different cases +-- can be used. + + UttIP : IP -> Utt ; -- who + UttIAdv : IAdv -> Utt ; -- why + UttNP : NP -> Utt ; -- this man + UttAdv : Adv -> Utt ; -- here + UttVP : VP -> Utt ; -- to sleep + +-- The phrasal conjunction is optional. A sentence conjunction +-- can also used to prefix an utterance. + + NoPConj : PConj ; + PConjConj : Conj -> PConj ; -- and + +-- The vocative is optional. Any noun phrase can be made into vocative, +-- which may be overgenerating (e.g. "I"). + + NoVoc : Voc ; + VocNP : NP -> Voc ; -- my friend + +} diff --git a/lib/next-resource/abstract/Question.gf b/lib/next-resource/abstract/Question.gf new file mode 100644 index 000000000..6b2e3c01d --- /dev/null +++ b/lib/next-resource/abstract/Question.gf @@ -0,0 +1,41 @@ +--1 Question: Questions and Interrogative Pronouns + +abstract Question = Cat ** { + +-- A question can be formed from a clause ('yes-no question') or +-- with an interrogative. + + fun + QuestCl : Cl -> QCl ; -- does John walk + QuestVP : IP -> VP -> QCl ; -- who walks + QuestSlash : IP -> ClSlash -> QCl ; -- whom does John love + QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk + QuestIComp : IComp -> NP -> QCl ; -- where is John + +-- Interrogative pronouns can be formed with interrogative +-- determiners, with or without a noun. + + IdetCN : IDet -> CN -> IP ; -- which five songs + IdetIP : IDet -> IP ; -- which five + +-- They can be modified with adverbs. + + AdvIP : IP -> Adv -> IP ; -- who in Paris + +-- Interrogative quantifiers have number forms and can take number modifiers. + + IdetQuant : IQuant -> Num -> IDet ; -- which (five) + +-- Interrogative adverbs can be formed prepositionally. + + PrepIP : Prep -> IP -> IAdv ; -- with whom + +-- Interrogative complements to copulas can be both adverbs and +-- pronouns. + + CompIAdv : IAdv -> IComp ; -- where (is it) + CompIP : IP -> IComp ; -- who (is it) + +-- More $IP$, $IDet$, and $IAdv$ are defined in $Structural$. + +} diff --git a/lib/next-resource/abstract/Relative.gf b/lib/next-resource/abstract/Relative.gf new file mode 100644 index 000000000..6db45d085 --- /dev/null +++ b/lib/next-resource/abstract/Relative.gf @@ -0,0 +1,26 @@ +--1 Relative clauses and pronouns + +abstract Relative = Cat ** { + + fun + +-- The simplest way to form a relative clause is from a clause by +-- a pronoun similar to "such that". + + RelCl : Cl -> RCl ; -- such that John loves her + +-- The more proper ways are from a verb phrase +-- (formed in [``Verb`` Verb.html]) or a sentence +-- with a missing noun phrase (formed in [``Sentence`` Sentence.html]). + + RelVP : RP -> VP -> RCl ; -- who loves John + RelSlash : RP -> ClSlash -> RCl ; -- whom John loves + +-- Relative pronouns are formed from an 'identity element' by prefixing +-- or suffixing (depending on language) prepositional phrases. + + IdRP : RP ; -- which + FunRP : Prep -> NP -> RP -> RP ; -- the mother of whom + +} + diff --git a/lib/next-resource/abstract/Sentence.gf b/lib/next-resource/abstract/Sentence.gf new file mode 100644 index 000000000..1f771e12c --- /dev/null +++ b/lib/next-resource/abstract/Sentence.gf @@ -0,0 +1,95 @@ +--1 Sentence: Sentences, Clauses, and Imperatives + +abstract Sentence = Cat ** { + +--2 Clauses + +-- The $NP VP$ predication rule form a clause whose linearization +-- gives a table of all tense variants, positive and negative. +-- Clauses are converted to $S$ (with fixed tense) with the +-- $UseCl$ function below. + + fun + PredVP : NP -> VP -> Cl ; -- John walks + +-- Using an embedded sentence as a subject is treated separately. +-- This can be overgenerating. E.g. "whether you go" as subject +-- is only meaningful for some verb phrases. + + PredSCVP : SC -> VP -> Cl ; -- that she goes is good + +--2 Clauses missing object noun phrases + +-- This category is a variant of the 'slash category' $S/NP$ of +-- GPSG and categorial grammars, which in turn replaces +-- movement transformations in the formation of questions +-- and relative clauses. Except $SlashV2$, the construction +-- rules can be seen as special cases of function composition, in +-- the style of CCG. +-- *Note* the set is not complete and lacks e.g. verbs with more than 2 places. + + SlashVP : NP -> VPSlash -> ClSlash ; -- (whom) he sees + AdvSlash : ClSlash -> Adv -> ClSlash ; -- (whom) he sees today + SlashPrep : Cl -> Prep -> ClSlash ; -- (with whom) he walks + SlashVS : NP -> VS -> SSlash -> ClSlash ; -- (whom) she says that he loves + +--2 Imperatives + +-- An imperative is straightforwardly formed from a verb phrase. +-- It has variation over positive and negative, singular and plural. +-- To fix these parameters, see [Phrase Phrase.html]. + + ImpVP : VP -> Imp ; -- love yourselves + +--2 Embedded sentences + +-- Sentences, questions, and infinitival phrases can be used as +-- subjects and (adverbial) complements. + + EmbedS : S -> SC ; -- that she goes + EmbedQS : QS -> SC ; -- who goes + EmbedVP : VP -> SC ; -- to go + +--2 Sentences + +-- These are the 2 x 4 x 4 = 16 forms generated by different +-- combinations of tense, polarity, and +-- anteriority, which are defined in [``Common`` Common.html]. + + fun + UseCl : Tense -> Ant -> Pol -> Cl -> S ; + UseQCl : Tense -> Ant -> Pol -> QCl -> QS ; + UseRCl : Tense -> Ant -> Pol -> RCl -> RS ; + UseSlash : Tense -> Ant -> Pol -> ClSlash -> SSlash ; + +-- An adverb can be added to the beginning of a sentence. + + AdvS : Adv -> S -> S ; -- today, I will go home + +-- A sentence can be modified by a relative clause referring to its contents. + + RelS : S -> RS -> S ; -- she sleeps, which is good + +} + +--. + +-- Examples for English $S$/$Cl$: +{- + Pres Simul Pos ODir : he sleeps + Pres Simul Neg ODir : he doesn't sleep + Pres Anter Pos ODir : he has slept + Pres Anter Neg ODir : he hasn't slept + Past Simul Pos ODir : he slept + Past Simul Neg ODir : he didn't sleep + Past Anter Pos ODir : he had slept + Past Anter Neg ODir : he hadn't slept + Fut Simul Pos ODir : he will sleep + Fut Simul Neg ODir : he won't sleep + Fut Anter Pos ODir : he will have slept + Fut Anter Neg ODir : he won't have slept + Cond Simul Pos ODir : he would sleep + Cond Simul Neg ODir : he wouldn't sleep + Cond Anter Pos ODir : he would have slept + Cond Anter Neg ODir : he wouldn't have slept +-} diff --git a/lib/next-resource/abstract/Structural.gf b/lib/next-resource/abstract/Structural.gf new file mode 100644 index 000000000..d616ba9d5 --- /dev/null +++ b/lib/next-resource/abstract/Structural.gf @@ -0,0 +1,111 @@ +--1 Structural: Structural Words +-- +-- Here we have some words belonging to closed classes and appearing +-- in all languages we have considered. +-- Sometimes more distinctions are needed, e.g. $we_Pron$ in Spanish +-- should be replaced by masculine and feminine variants, found in +-- [``ExtraSpa`` ../spanish/ExtraSpa.gf]. + +abstract Structural = Cat ** { + + fun + +-- This is an alphabetical list of structural words + + above_Prep : Prep ; + after_Prep : Prep ; + all_Predet : Predet ; + almost_AdA : AdA ; + almost_AdN : AdN ; + although_Subj : Subj ; + always_AdV : AdV ; + and_Conj : Conj ; + because_Subj : Subj ; + before_Prep : Prep ; + behind_Prep : Prep ; + between_Prep : Prep ; + both7and_DConj : Conj ; -- both...and +---b both7and_DConj : DConj ; + but_PConj : PConj ; + by8agent_Prep : Prep ; -- by (agent) + by8means_Prep : Prep ; -- by (means of) + can8know_VV : VV ; -- can (capacity) + can_VV : VV ; -- can (possibility) + during_Prep : Prep ; + either7or_DConj : Conj ; -- either...or +---b either7or_DConj : DConj ; + every_Det : Det ; + everybody_NP : NP ; -- everybody + everything_NP : NP ; + everywhere_Adv : Adv ; +--- first_Ord : Ord ; DEPRECATED + few_Det : Det ; + for_Prep : Prep ; + from_Prep : Prep ; + he_Pron : Pron ; + here_Adv : Adv ; + here7to_Adv : Adv ; -- to here + here7from_Adv : Adv ; -- from here + how_IAdv : IAdv ; + how8many_IDet : IDet ; + i_Pron : Pron ; + if_Subj : Subj ; + in8front_Prep : Prep ; -- in front of + in_Prep : Prep ; + it_Pron : Pron ; + less_CAdv : CAdv ; + many_Det : Det ; + more_CAdv : CAdv ; + most_Predet : Predet ; + much_Det : Det ; + must_VV : VV ; +---b no_Phr : Phr ; + no_Utt : Utt ; + on_Prep : Prep ; +--- one_Quant : QuantSg ; DEPRECATED + only_Predet : Predet ; + or_Conj : Conj ; + otherwise_PConj : PConj ; + part_Prep : Prep ; + please_Voc : Voc ; + possess_Prep : Prep ; -- of (possessive) + quite_Adv : AdA ; + she_Pron : Pron ; + so_AdA : AdA ; + someSg_Det : Det ; + somePl_Det : Det ; + somebody_NP : NP ; + something_NP : NP ; + somewhere_Adv : Adv ; + that_Quant : Quant ; + there_Adv : Adv ; + there7to_Adv : Adv ; -- to there + there7from_Adv : Adv ; -- from there + therefore_PConj : PConj ; + they_Pron : Pron ; + this_Quant : Quant ; + through_Prep : Prep ; + to_Prep : Prep ; + too_AdA : AdA ; + under_Prep : Prep ; + very_AdA : AdA ; + want_VV : VV ; + we_Pron : Pron ; + whatPl_IP : IP ; -- what (plural) + whatSg_IP : IP ; -- what (singular) + when_IAdv : IAdv ; + when_Subj : Subj ; + where_IAdv : IAdv ; + which_IQuant : IQuant ; + whoPl_IP : IP ; -- who (plural) + whoSg_IP : IP ; -- who (singular) + why_IAdv : IAdv ; + with_Prep : Prep ; + without_Prep : Prep ; +---b yes_Phr : Phr ; + yes_Utt : Utt ; + youSg_Pron : Pron ; -- you (singular) + youPl_Pron : Pron ; -- you (plural) + youPol_Pron : Pron ; -- you (polite) + +} diff --git a/lib/next-resource/abstract/Text.gf b/lib/next-resource/abstract/Text.gf new file mode 100644 index 000000000..d3cfac16f --- /dev/null +++ b/lib/next-resource/abstract/Text.gf @@ -0,0 +1,15 @@ +--1 Text: Texts + +-- Texts are built from an empty text by adding $Phr$ases, +-- using as constructors the punctuation marks ".", "?", and "!". +-- Any punctuation mark can be attached to any kind of phrase. + +abstract Text = Common ** { + + fun + TEmpty : Text ; -- + TFullStop : Phr -> Text -> Text ; -- John walks. ... + TQuestMark : Phr -> Text -> Text ; -- Are they here? ... + TExclMark : Phr -> Text -> Text ; -- Let's go! ... + +} diff --git a/lib/next-resource/abstract/Verb.gf b/lib/next-resource/abstract/Verb.gf new file mode 100644 index 000000000..c1462acc7 --- /dev/null +++ b/lib/next-resource/abstract/Verb.gf @@ -0,0 +1,71 @@ +--1 The construction of verb phrases + +abstract Verb = Cat ** { + +--2 Complementization rules + +-- Verb phrases are constructed from verbs by providing their +-- complements. There is one rule for each verb category. + + fun + UseV : V -> VP ; -- sleep + + ComplVV : VV -> VP -> VP ; -- want to run + ComplVS : VS -> S -> VP ; -- say that she runs + ComplVQ : VQ -> QS -> VP ; -- wonder who runs + ComplVA : VA -> AP -> VP ; -- they become red + + SlashV2a : V2 -> VPSlash ; -- love (it) + Slash2V3 : V3 -> NP -> VPSlash ; -- give it (to her) + Slash3V3 : V3 -> NP -> VPSlash ; -- give (it) to her + + SlashV2V : V2V -> VP -> VPSlash ; -- beg (her) to go + SlashV2S : V2S -> S -> VPSlash ; -- answer (to him) that it is good + SlashV2Q : V2Q -> QS -> VPSlash ; -- ask (him) who came + SlashV2A : V2A -> AP -> VPSlash ; -- paint (it) red + + ComplSlash : VPSlash -> NP -> VP ; -- love it + + SlashVV : VV -> VPSlash -> VPSlash ; -- want to buy + SlashV2VNP : V2V -> NP -> VPSlash -> VPSlash ; -- beg me to buy + +--2 Other ways of forming verb phrases + +-- Verb phrases can also be constructed reflexively and from +-- copula-preceded complements. + + ReflVP : VPSlash -> VP ; -- love himself + UseComp : Comp -> VP ; -- be warm + +-- Passivization of two-place verbs is another way to use +-- them. In many languages, the result is a participle that +-- is used as complement to a copula ("is used"), but other +-- auxiliary verbs are possible (Ger. "wird angewendet", It. +-- "viene usato"), as well as special verb forms (Fin. "käytetään", +-- Swe. "används"). +-- +-- *Note*. the rule can be overgenerating, since the $V2$ need not +-- take a direct object. + + PassV2 : V2 -> VP ; -- be loved + +-- Adverbs can be added to verb phrases. Many languages make +-- a distinction between adverbs that are attached in the end +-- vs. next to (or before) the verb. + + AdvVP : VP -> Adv -> VP ; -- sleep here + AdVVP : AdV -> VP -> VP ; -- always sleep + +-- *Agents of passives* are constructed as adverbs with the +-- preposition [Structural Structural.html]$.8agent_Prep$. + + +--2 Complements to copula + +-- Adjectival phrases, noun phrases, and adverbs can be used. + + CompAP : AP -> Comp ; -- (be) small + CompNP : NP -> Comp ; -- (be) a man + CompAdv : Adv -> Comp ; -- (be) here + +} diff --git a/lib/next-resource/common/CommonX.gf b/lib/next-resource/common/CommonX.gf new file mode 100644 index 000000000..bcaf1e4b9 --- /dev/null +++ b/lib/next-resource/common/CommonX.gf @@ -0,0 +1,31 @@ +concrete CommonX of Common = open (R = ParamX) in { + + lincat + Text = {s : Str} ; --lock_Text : {}} ; + Phr = {s : Str} ; --lock_Phr : {}} ; + Utt = {s : Str} ; --lock_Utt : {}} ; + Voc = {s : Str} ; --lock_Voc : {}} ; + SC = {s : Str} ; --lock_SC : {}} ; + Adv = {s : Str} ; --lock_Adv : {}} ; + AdV = {s : Str} ; --lock_AdV : {}} ; + AdA = {s : Str} ; --lock_AdA : {}} ; + AdN = {s : Str} ; --lock_AdN : {}} ; + IAdv = {s : Str} ; --lock_IAdv : {}} ; + CAdv = {s : Str} ; --lock_CAdv : {}} ; + PConj = {s : Str} ; --lock_PConj : {}} ; + + Tense = {s : Str ; t : R.Tense} ; + Ant = {s : Str ; a : R.Anteriority} ; + Pol = {s : Str ; p : R.Polarity} ; + + lin + PPos = {s = []} ** {p = R.Pos} ; + PNeg = {s = []} ** {p = R.Neg} ; + TPres = {s = []} ** {t = R.Pres} ; + TPast = {s = []} ** {t = R.Past} ; --# notpresent + TFut = {s = []} ** {t = R.Fut} ; --# notpresent + TCond = {s = []} ** {t = R.Cond} ; --# notpresent + ASimul = {s = []} ** {a = R.Simul} ; + AAnter = {s = []} ** {a = R.Anter} ; --# notpresent + +} diff --git a/lib/next-resource/common/ConstructX.gf b/lib/next-resource/common/ConstructX.gf new file mode 100644 index 000000000..ee4decf00 --- /dev/null +++ b/lib/next-resource/common/ConstructX.gf @@ -0,0 +1,19 @@ +--# -path=.:../abstract:prelude + +resource ConstructX = open CommonX in { + + oper + mkText : Str -> Text = \s -> {s = s ; lock_Text = <>} ; + mkPhr : Str -> Phr = \s -> {s = s ; lock_Phr = <>} ; + mkUtt : Str -> Utt = \s -> {s = s ; lock_Utt = <>} ; + mkVoc : Str -> Voc = \s -> {s = s ; lock_Voc = <>} ; + mkSC : Str -> SC = \s -> {s = s ; lock_SC = <>} ; + mkAdv : Str -> Adv = \s -> {s = s ; lock_Adv = <>} ; + mkAdV : Str -> AdV = \s -> {s = s ; lock_AdV = <>} ; + mkAdA : Str -> AdA = \s -> {s = s ; lock_AdA = <>} ; + mkAdN : Str -> AdN = \s -> {s = s ; lock_AdN = <>} ; + mkIAdv : Str -> IAdv = \s -> {s = s ; lock_IAdv = <>} ; + mkCAdv : Str -> CAdv = \s -> {s = s ; lock_CAdv = <>} ; + mkPConj : Str -> PConj = \s -> {s = s ; lock_PConj = <>} ; + +} diff --git a/lib/next-resource/common/Overload.gf b/lib/next-resource/common/Overload.gf new file mode 100644 index 000000000..df7baeab9 --- /dev/null +++ b/lib/next-resource/common/Overload.gf @@ -0,0 +1,101 @@ +incomplete resource Overload = open Grammar in { + + oper + + pred = overload { + pred : NP -> V -> Cl + = \v,np -> PredVP np (UseV v) ; + pred : NP -> V2 -> NP -> Cl + = \v,np,ob -> PredVP np (ComplV2 v ob) ; + pred : NP -> V3 -> NP -> NP -> Cl + = \v,np,ob,ob2 -> + PredVP np (ComplV3 v ob ob2) ; + pred : NP -> A -> Cl + = \a,np -> + PredVP np (UseComp (CompAP (PositA a))) + } ; + + mod = overload { + mod : A -> N -> CN + = \a,n -> AdjCN (PositA a) (UseN n) ; + mod : AP -> N -> CN + = \a,n -> AdjCN a (UseN n) ; + mod : AP -> CN -> CN + = \a,n -> AdjCN a n ; + mod : AdA -> A -> AP + = \m,a -> AdAP m (PositA a) ; + mod : Quant -> N -> NP + = \q,n -> DetCN (DetSg (SgQuant q) + NoOrd) (UseN n) ; + mod : Quant -> CN -> NP + = \q,n -> DetCN (DetSg + (SgQuant q) NoOrd) n ; + mod : Predet -> N -> NP + = \q,n -> PredetNP q (DetCN (DetPl + (PlQuant IndefArt) NoNum NoOrd) (UseN n)) ; + mod : Num -> N -> NP + = \nu,n -> DetCN (DetPl (PlQuant + IndefArt) nu NoOrd) (UseN n) + + } ; + + coord = overload { + coord : Conj -> Adv -> Adv -> Adv + = \c,x,y -> ConjAdv c (BaseAdv x y) ; + coord : Conj -> AP -> AP -> AP + = \c,x,y -> ConjAP c (BaseAP x y) ; + coord : Conj -> NP -> NP -> NP + = \c,x,y -> ConjNP c (BaseNP x y) ; + coord : Conj -> S -> S -> S + = \c,x,y -> ConjS c (BaseS x y) ; + coord : DConj -> Adv -> Adv -> Adv + = \c,x,y -> DConjAdv c (BaseAdv x y) ; + coord : DConj -> AP -> AP -> AP + = \c,x,y -> DConjAP c (BaseAP x y) ; + coord : DConj -> NP -> NP -> NP + = \c,x,y -> DConjNP c (BaseNP x y) ; + coord : DConj -> S -> S -> S + = \c,x,y -> DConjS c (BaseS x y) ; + coord : Conj -> ListAdv -> Adv + = \c,xy -> ConjAdv c xy ; + coord : Conj -> ListAP -> AP + = \c,xy -> ConjAP c xy ; + coord : Conj -> ListNP -> NP + = \c,xy -> ConjNP c xy ; + coord : Conj -> ListS -> S + = \c,xy -> ConjS c xy ; + coord : DConj -> ListAdv -> Adv + = \c,xy -> DConjAdv c xy ; + coord : DConj -> ListAP -> AP + = \c,xy -> DConjAP c xy ; + coord : DConj -> ListNP -> NP + = \c,xy -> DConjNP c xy ; + coord : DConj -> ListS -> S + = \c,xy -> DConjS c xy + } ; + + mkCN = overload { + mkCN : N -> CN + = UseN ; + mkCN : A -> N -> CN + = \a,n -> AdjCN (PositA a) (UseN n) ; + mkCN : AP -> N -> CN + = \a,n -> AdjCN a (UseN n) ; + mkCN : AP -> CN -> CN + = \a,n -> AdjCN a n ; + } ; + + mkNP = overload { + mkNP : NP + = this_NP ; + mkNP : Pron -> NP + = UsePron ; + mkNP : PN -> NP + = UsePN ; + mkNP : Quant -> N -> NP + = \q,n -> DetCN (DetSg (SgQuant q) NoOrd) (UseN n) ; + mkNP : Predet -> N -> NP + = \q,n -> PredetNP q (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) (UseN n)) + } ; + +} diff --git a/lib/next-resource/common/ParamX.gf b/lib/next-resource/common/ParamX.gf new file mode 100644 index 000000000..65901de66 --- /dev/null +++ b/lib/next-resource/common/ParamX.gf @@ -0,0 +1,65 @@ +resource ParamX = open Prelude in { + +---- flags optimize=noexpand ; + + param + Number = Sg | Pl ; + Person = P1 | P2 | P3 ; + Degree = Posit | Compar | Superl ; + + Anteriority = + Simul + | Anter --# notpresent + ; + Tense = + Pres + | Past --# notpresent + | Fut --# notpresent + | Cond --# notpresent + ; + + param + + Polarity = Pos | Neg ; + + QForm = QDir | QIndir ; + +-- Imperatives: True = polite, False = familiar. + + ImpForm = ImpF Number Bool ; + + oper + numImp : ImpForm -> Number = \i -> + case i of { + ImpF n _ => n + } ; + + conjNumber : Number -> Number -> Number = \m,n -> + case m of { + Sg => n ; + _ => Pl + } ; + +-- For persons, we let the latter argument win ("either you or I am absent" +-- but "either I or you are absent"). This is not quite clear. + + conjPerson : Person -> Person -> Person = \_,p -> + p ; + +-- To construct a record with a polarity-dependent table. + + polCases : SS -> SS -> {s : Polarity => Str} = \true,false -> { + s = table { + Pos => true.s ; + Neg => false.s + } + } ; + +-- To count the length of a tail in a sequence of digits, e.g. to put commas +-- as in 1,000,000. + + param + DTail = T1 | T2 | T3 ; + + +} diff --git a/lib/next-resource/common/TenseX.gf b/lib/next-resource/common/TenseX.gf new file mode 100644 index 000000000..665bb146d --- /dev/null +++ b/lib/next-resource/common/TenseX.gf @@ -0,0 +1,18 @@ +concrete TenseX of Tense = open (R = ParamX) in { + + lincat + Tense = {s : Str ; t : R.Tense} ; + Ant = {s : Str ; a : R.Anteriority} ; + Pol = {s : Str ; p : R.Polarity} ; + + lin + PPos = {s = []} ** {p = R.Pos} ; + PNeg = {s = []} ** {p = R.Neg} ; + TPres = {s = []} ** {t = R.Pres} ; + TPast = {s = []} ** {t = R.Past} ; + TFut = {s = []} ** {t = R.Fut} ; + TCond = {s = []} ** {t = R.Cond} ; + ASimul = {s = []} ** {a = R.Simul} ; + AAnter = {s = []} ** {a = R.Anter} ; + +} diff --git a/lib/next-resource/common/TextX.gf b/lib/next-resource/common/TextX.gf new file mode 100644 index 000000000..a5ddebc54 --- /dev/null +++ b/lib/next-resource/common/TextX.gf @@ -0,0 +1,11 @@ +concrete TextX of Text = CommonX ** { + +-- This will work for almost all languages except Spanish. + + lin + TEmpty = {s = []} ; + TFullStop x xs = {s = x.s ++ "." ++ xs.s} ; + TQuestMark x xs = {s = x.s ++ "?" ++ xs.s} ; + TExclMark x xs = {s = x.s ++ "!" ++ xs.s} ; + +} diff --git a/lib/next-resource/danish/AdjectiveDan.gf b/lib/next-resource/danish/AdjectiveDan.gf new file mode 100644 index 000000000..71d3c56c2 --- /dev/null +++ b/lib/next-resource/danish/AdjectiveDan.gf @@ -0,0 +1,2 @@ +concrete AdjectiveDan of Adjective = CatDan ** AdjectiveScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/AdverbDan.gf b/lib/next-resource/danish/AdverbDan.gf new file mode 100644 index 000000000..07bab5be4 --- /dev/null +++ b/lib/next-resource/danish/AdverbDan.gf @@ -0,0 +1,2 @@ +concrete AdverbDan of Adverb = CatDan ** AdverbScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/AllDan.gf b/lib/next-resource/danish/AllDan.gf new file mode 100644 index 000000000..737728417 --- /dev/null +++ b/lib/next-resource/danish/AllDan.gf @@ -0,0 +1,7 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete AllDan of AllDanAbs = + LangDan, + IrregDan - [fly_V], + ExtraDan + ** {} ; diff --git a/lib/next-resource/danish/AllDanAbs.gf b/lib/next-resource/danish/AllDanAbs.gf new file mode 100644 index 000000000..c07422d5f --- /dev/null +++ b/lib/next-resource/danish/AllDanAbs.gf @@ -0,0 +1,5 @@ +abstract AllDanAbs = + Lang, + IrregDanAbs - [fly_V], + ExtraDanAbs + ** {} ; diff --git a/lib/next-resource/danish/CatDan.gf b/lib/next-resource/danish/CatDan.gf new file mode 100644 index 000000000..d3d6eec83 --- /dev/null +++ b/lib/next-resource/danish/CatDan.gf @@ -0,0 +1,2 @@ +concrete CatDan of Cat = CommonX ** CatScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/ConjunctionDan.gf b/lib/next-resource/danish/ConjunctionDan.gf new file mode 100644 index 000000000..d8e9215fd --- /dev/null +++ b/lib/next-resource/danish/ConjunctionDan.gf @@ -0,0 +1,2 @@ +concrete ConjunctionDan of Conjunction = CatDan ** ConjunctionScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/DiffDan.gf b/lib/next-resource/danish/DiffDan.gf new file mode 100644 index 000000000..2309efd3a --- /dev/null +++ b/lib/next-resource/danish/DiffDan.gf @@ -0,0 +1,86 @@ +instance DiffDan of DiffScand = open CommonScand, Prelude in { + +-- Parameters. + + param + Gender = Utr | Neutr ; + + oper + utrum = Utr ; + neutrum = Neutr ; + + gennum : Gender -> Number -> GenNum = \g,n -> + case < : Gender * Number> of { + => SgUtr ; + => SgNeutr ; + _ => Plg + } ; + + detDef : Species = Indef ; + + Verb : Type = { + s : VForm => Str ; + part : Str ; + vtype : VType ; + isVaere : Bool + } ; + + hasAuxBe v = v.isVaere ; + +-- Strings. + + conjThat = "at" ; + conjThan = "end" ; + conjAnd = "og" ; + infMark = "at" ; + compMore = "mere" ; + + subjIf = "hvis" ; + + artIndef : Gender => Str = table { + Utr => "en" ; + Neutr => "et" + } ; + + verbHave = + mkVerb "have" "har" "hav" "havde" "haft" "haven" "havet" "havne" ** + {part = [] ; isVaere = False} ; + verbBe = + mkVerb "være" "er" "var" "var" "været" "væren" "været" "værne" ** + {part = [] ; isVaere = False} ; + verbBecome = + mkVerb "blive" "bliver" "bliv" "blev" "blevet" + "bliven" "blivet" "blivne" ** + {part = [] ; isVaere = True} ; + + auxFut = "vil" ; -- "skal" in ExtDan + auxCond = "ville" ; + + negation : Polarity => Str = table { + Pos => [] ; + Neg => "ikke" + } ; + + genderForms : (x1,x2 : Str) -> Gender => Str = \all,allt -> + table { + Utr => all ; + Neutr => allt + } ; + + relPron : GenNum => RCase => Str = \\gn,c => case c of { + RNom | RPrep False => "som" ; + RGen => "hvis" ; + RPrep _ => gennumForms "hvilken" "hvilket" "hvilke" ! gn + } ; + + pronSuch = gennumForms "sådan" "sådant" "sådanne" ; + + reflPron : Agr -> Str = \a -> case a of { + {gn = Plg ; p = P1} => "oss" ; + {gn = Plg ; p = P2} => "jer" ; + {p = P1} => "mig" ; + {p = P2} => "dig" ; + {p = P3} => "sig" + } ; + +} diff --git a/lib/next-resource/danish/ExtraDan.gf b/lib/next-resource/danish/ExtraDan.gf new file mode 100644 index 000000000..28083b20c --- /dev/null +++ b/lib/next-resource/danish/ExtraDan.gf @@ -0,0 +1,3 @@ +concrete ExtraDan of ExtraDanAbs = ExtraScandDan ** open CommonScand, ResDan in { + +} diff --git a/lib/next-resource/danish/ExtraDanAbs.gf b/lib/next-resource/danish/ExtraDanAbs.gf new file mode 100644 index 000000000..45ac75290 --- /dev/null +++ b/lib/next-resource/danish/ExtraDanAbs.gf @@ -0,0 +1,7 @@ +-- Structures special for Danish. These are not implemented in other +-- Scandinavian languages. + +abstract ExtraDanAbs = ExtraScandAbs ** { + + +} \ No newline at end of file diff --git a/lib/next-resource/danish/ExtraScandDan.gf b/lib/next-resource/danish/ExtraScandDan.gf new file mode 100644 index 000000000..26fa8f390 --- /dev/null +++ b/lib/next-resource/danish/ExtraScandDan.gf @@ -0,0 +1,2 @@ +concrete ExtraScandDan of ExtraScandAbs = CatDan ** ExtraScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/GrammarDan.gf b/lib/next-resource/danish/GrammarDan.gf new file mode 100644 index 000000000..1c2424787 --- /dev/null +++ b/lib/next-resource/danish/GrammarDan.gf @@ -0,0 +1,21 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete GrammarDan of Grammar = + NounDan, + VerbDan, + AdjectiveDan, + AdverbDan, + NumeralDan, + SentenceDan, + QuestionDan, + RelativeDan, + ConjunctionDan, + PhraseDan, + TextX, + IdiomDan, + StructuralDan + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/danish/IdiomDan.gf b/lib/next-resource/danish/IdiomDan.gf new file mode 100644 index 000000000..91c46af12 --- /dev/null +++ b/lib/next-resource/danish/IdiomDan.gf @@ -0,0 +1,38 @@ +concrete IdiomDan of Idiom = CatDan ** + open MorphoDan, ParadigmsDan, IrregDan, Prelude in { + + flags optimize=all_subs ; + + lin + ImpersCl vp = mkClause "det" (agrP3 MorphoDan.neutrum Sg) vp ; + GenericCl vp = mkClause "man" (agrP3 MorphoDan.utrum Sg) vp ; + + CleftNP np rs = mkClause "det" (agrP3 MorphoDan.neutrum Sg) + (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a) (predV verbBe)) ; + + CleftAdv ad s = mkClause "det" (agrP3 MorphoDan.neutrum Sg) + (insertObj (\\_ => ad.s ++ s.s ! Sub) (predV verbBe)) ; + + ExistNP np = + mkClause "det" (agrP3 MorphoDan.neutrum Sg) (insertObj + (\\_ => np.s ! accusative) (predV (depV finde_V))) ; + + ExistIP ip = { + s = \\t,a,p => + let + cls = + (mkClause "det" (agrP3 MorphoDan.neutrum Sg) (predV (depV finde_V))).s ! t ! a ! p ; + who = ip.s ! accusative + in table { + QDir => who ++ cls ! Inv ; + QIndir => who ++ cls ! Sub + } + } ; + + ProgrVP vp = + insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ; + + ImpPl1 vp = {s = ["lad os"] ++ infVP vp {gn = Plg ; p = P1}} ; + +} + diff --git a/lib/next-resource/danish/IrregDan.gf b/lib/next-resource/danish/IrregDan.gf new file mode 100644 index 000000000..31dfebeff --- /dev/null +++ b/lib/next-resource/danish/IrregDan.gf @@ -0,0 +1,72 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +-- http://users.cybercity.dk/~nmb3879/danishgram3.html + +concrete IrregDan of IrregDanAbs = CatDan ** open Prelude, ParadigmsDan in { + + flags optimize=values ; + + lin + + bære_V = irregV "bære" "bar" "båret" ; + bede_V = mkV "bede" "beder" "bedes" "bad" "bedt" "bed" ; + bide_V = irregV "bite" "bed" "bidt" ; + binde_V = irregV "binde" "bandt" "bundet" ; + blive_V = irregV "blive" "blev" "blevet" ; + brænde_V = irregV "brænde" "brandt" "brændt" ;-- + bringe_V = irregV "bringe" "bragte" "bragt" ; + burde_V = irregV "burde" "burde" "burdet" ;-- + dø_V = irregV "dø" "døde" "død" ; + drage_V = irregV "drage" "drog" "draget" ; + drikke_V = irregV "drikke" "drak" "drukket" ; + drive_V = irregV "drive" "drev" "drevet" ; + falde_V = irregV "falde" "faldt" "faldet" ;----er + få_V = irregV "få" "fik" "fået" ; + finde_V = irregV "finde" "fandt" "fundet" ; + flyde_V = irregV "flyde" "flød" "flydt" ; + flyve_V = irregV "flyve" "fløj" "fløjet" ; + forlade_V = irregV "forlade" "forlod" "forladet" ; + forstå_V = irregV "forstå" "forstod" "forstået" ; + fryse_V = irregV "fryse" "frøs" "frosset" ; + gå_V = irregV "gå" "gik" "gået" ;----er + give_V = irregV "give" "gav" "givet" ; + gnide_V = irregV "gnide" "gned" "gnidd" ;-- + gøre_V = irregV "gøre" "gjorde" "gjort" ; + have_V = mkV "have" "har" "havde" "haft" "havd" "hav" ; + hente_V = irregV "hente" "hentet" "hendt" ;-- +-- hete_V = irregV "hete" (variants {"het" ;-- "hette"}) "hett" ;-- +-- hjelpe_V = irregV "hjelpe" "hjalp" "hjulpet" ;-- + holde_V = irregV "holde" "holdt" "holdt" ;-- + komme_V = irregV "komme" "kom" "kommet" ; + kunne_V = irregV "kunne" "kunne" "kunnet" ; + lade_V = irregV "lade" "lod" "ladet" ; + lægge_V = irregV "lægge" "lagde" "lagt" ; + le_V = irregV "le" "lo" "leet" ; + ligge_V = irregV "ligge" "lå" "ligget" ; + løbe_V = irregV "løbe" "løb" "løbet" ; + måtte_V = irregV "måtte" "måtte" "måttet" ; + renne_V = irregV "renne" "rant" "rent" ;-- + sælge_V = irregV "sælge" "solgte" "solgt" ; + sætte_V = irregV "sætte" "satte" "sat" ; + se_V = irregV "se" "så" "set" ; + sidde_V = irregV "sidde" "sad" "siddet" ; + sige_V = irregV "sige" "sagde" "sagt" ; + skære_V = irregV "skære" "skar" "skåret" ;-- + skrive_V = irregV "skrive" "skrev" "skrevet" ; + skulle_V = irregV "skulle" "skulle" "skullet" ; + slå_V = irregV "slå" "slog" "slått" ;-- + sove_V = irregV "sove" "sov" "sovet" ; + spørge_V = irregV "spørge" "spurgte" "spurgt" ; + springe_V = irregV "springe" "sprang" "sprunget" ;-- + stå_V = irregV "stå" "stod" "stået" ; + stikke_V = irregV "stikke" "stakk" "stukket" ;-- + synge_V = irregV "synge" "sang" "sunget" ;-- + tage_V = irregV "tage" "tog" "taget" ; +-- treffe_V = irregV "treffe" "traff" "truffet" ;-- +-- trives_V = irregV "trives" "trivdes" (variants {"trives" ;-- "trivs"}) ;-- + tælle_V = irregV "tælle" "talte" "talt" ; + vide_V = irregV "vide" "vidste" "vidst" ; + +} + +-- readFile "vrbs.tmp" >>= mapM_ (putStrLn . (\ (a:_:b:c:_) -> " " ++ a ++ "_V = irregV \"" ++ a ++ "\" \"" ++ b ++ "\" \"" ++ c ++ "\" ;") . words) . lines diff --git a/lib/next-resource/danish/IrregDanAbs.gf b/lib/next-resource/danish/IrregDanAbs.gf new file mode 100644 index 000000000..5f8942f76 --- /dev/null +++ b/lib/next-resource/danish/IrregDanAbs.gf @@ -0,0 +1,65 @@ +abstract IrregDanAbs = Cat ** { + + fun + + bære_V : V ; + bede_V : V ; + bide_V : V ; + binde_V : V ; + blive_V : V ; + brænde_V : V ; + bringe_V : V ; + burde_V : V ; + dø_V : V ; + drage_V : V ; + drikke_V : V ; + drive_V : V ; + falde_V : V ; + få_V : V ; + finde_V : V ; + flyde_V : V ; + flyve_V : V ; + forlade_V : V ; + forstå_V : V ; + fryse_V : V ; + gå_V : V ; + give_V : V ; +-- gjelde_V : V ; + gnide_V : V ; + gøre_V : V ; + have_V : V ; + hente_V : V ; +-- hete_V : V ; +-- hjelpe_V : V ; + holde_V : V ; + komme_V : V ; + kunne_V : V ; + lade_V : V ; + lægge_V : V ; + le_V : V ; + ligge_V : V ; + løbe_V : V ; + måtte_V : V ; + renne_V : V ; + sælge_V : V ; + sætte_V : V ; + se_V : V ; + sidde_V : V ; + sige_V : V ; + skære_V : V ; + skrive_V : V ; + skulle_V : V ; + slå_V : V ; + sove_V : V ; + spørge_V : V ; + springe_V : V ; + stå_V : V ; + stikke_V : V ; + synge_V : V ; + tage_V : V ; + tælle_V : V ; +-- treffe_V : V ; +-- trives_V : V ; + vide_V : V ; + +} diff --git a/lib/next-resource/danish/LangDan.gf b/lib/next-resource/danish/LangDan.gf new file mode 100644 index 000000000..7a80aded4 --- /dev/null +++ b/lib/next-resource/danish/LangDan.gf @@ -0,0 +1,10 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete LangDan of Lang = + GrammarDan, + LexiconDan + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/danish/LexiconDan.gf b/lib/next-resource/danish/LexiconDan.gf new file mode 100644 index 000000000..055a2c8dd --- /dev/null +++ b/lib/next-resource/danish/LexiconDan.gf @@ -0,0 +1,366 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + + + +concrete LexiconDan of Lexicon = CatDan ** + open Prelude, ParadigmsDan, IrregDan in { + +flags startcat=Phr ; lexer=textlit ; unlexer=text ; + optimize=values ; + +lin + airplane_N = mk2N "fly" "flyet" ; + answer_V2S = mkV2S (regV "svare") (mkPrep "til") ; + apartment_N = mk2N "værelse" "værelsen" ; + apple_N = mk3N "æble" "æblet" "æbler" ; + art_N = mk2N "kunst" "kunsten" ; + ask_V2Q = mkV2Q spørge_V noPrep ; + baby_N = mk2N "baby" "babyen" ; ---- babyen + bad_A = regADeg "dårlig" ; ---- + bank_N = mk2N "bank" "banken" ; + beautiful_A = mk3ADeg "smuk" "smukt" "smukke" ; ---- + become_VA = mkVA blive_V ; + beer_N = mk2N "øl" "ølet" ; + beg_V2V = mkV2V bede_V noPrep (mkPrep "at") ; + big_A = irregADeg "stor" "større" "størst"; + bike_N = mkN "cykel" "cykeln" "cykler" "cyklerne" ; ---- + bird_N = mk2N "fugl" "fuglen" ; + black_A = mk2ADeg "sort" "sort" ; + blue_A = mk2ADeg "blå" "blått"; + boat_N = mk3N "båd" "båden" "både" ; + book_N = mkN "bog" "bogen" "bøger" "bøgene" ; + boot_N = mkN "støvle" "støvlen" "støvler" "støvlerne" ; + boss_N = mk2N "chef" "chefen" ; + boy_N = mk2N "dreng" "drengen" ; + bread_N = mk2N "brød" "brødet" ; + break_V2 = dirV2 (mk2V "knuse" "knuste") ; + broad_A = regADeg "bred" ; + brother_N2 = mkN2 (mk3N "broder" "brodren" "brødre") (mkPrep "til") ; ---- + brown_A = regADeg "brun" ; + butter_N = mk2N "smør" "smøret" ; + buy_V2 = dirV2 (mk2V "købe" "købte") ; ---- + camera_N = mk2N "kamera" "kameraen" ; ---- + cap_N = mk2N "hue" "huen" ; + car_N = mk2N "bil" "bilen" ; + carpet_N = mk2N "tæppe" "tæppen" ; + cat_N = mk3N "kat" "katten" "katte" ; + ceiling_N = mk2N "loft" "loftet" ; + chair_N = mk3N "stol" "stolen" "stole" ; + cheese_N = mk2N "ost" "osten" ; + child_N = mk3N "barn" "barnet" "børn" ; ---- + church_N = mk2N "kirke" "kirken" ; + city_N = mk2N "by" "byen" ; + clean_A = regADeg "ren" ; + clever_A = regADeg "flink" ; + close_V2 = dirV2 (mk2V "lukke" "lukkede") ; + coat_N = mk2N "frakke" "frakken" ; + cold_A = regADeg "kold" ; + come_V = vaereV komme_V ; + computer_N = mk2N "datamaskine" "datamaskinen" ; + country_N = mk2N "land" "landet" ; + cousin_N = mk3N "fætter" "fættren" "fættre" ; ---- + cow_N = mk2N "ku" "kuen" ; ---- + die_V = vaereV dø_V ; + dirty_A = regADeg "smudsig" ; ---- + distance_N3 = mkN3 (regGenN "afstand" utrum) (mkPrep "fra") (mkPrep "til") ; + doctor_N = mk2N "læge" "lægen" ; + dog_N = mk2N "hund" "hunden" ; + door_N = mk2N "dør" "døren" ; + drink_V2 = dirV2 drikke_V ; + easy_A2V = mkA2V (regA "nem") (mkPrep "for") ; ---- + eat_V2 = dirV2 (mk2V "spise" "spiste") ; + empty_A = mkADeg "tøm" "tømt" "tømme" "tømmere" "tømmest" ; ---- + enemy_N = mk2N "fjende" "fjenden" ; + factory_N = mk2N "fabrik" "fabriken" ; + father_N2 = mkN2 ( (mk3N "far" "fadren" "fædre")) (mkPrep "til") ; ---- + fear_VS = mkVS (regV "frygte") ; + find_V2 = dirV2 (irregV "finde" "fand" "fundet") ; ---- + fish_N = mk2N "fisk" "fisken" ; + floor_N = mk2N "gulv" "gulvet" ; + forget_V2 = dirV2 (mkV "glemme" "glemmer" "glemmes" "glemte" "glemt" "glem") ; ---- + fridge_N = mk2N "køleskab" "køleskabet" ; + friend_N = mk3N "ven" "vennen" "venner" ; ---- + fruit_N = mk2N "frugt" "frugten" ; + fun_AV = mkAV (mkA "morsom" "morsomt" "morsomme") ; ---- + garden_N = mk2N "have" "haven" ; + girl_N = mk2N "pige" "pigen" ; + glove_N = mk2N "handske" "handsken" ; + gold_N = mk2N "guld" "guldet" ; + good_A = mkADeg "god" "godt" "gode" "bedre" "bedst" ; ---- + go_V = vaereV gå_V ; + green_A = mk3ADeg "grøn" "grønt" "grønne" ; + harbour_N = mk2N "havn" "havnen" ; + hate_V2 = dirV2 (regV "hade") ; + hat_N = mk3N "hat" "hatten" "hatte" ; + have_V2 = dirV2 have_V ; + hear_V2 = dirV2 (mk2V "høre" "hørte") ; + hill_N = mk2N "høj" "højen" ; + hope_VS = mkVS (regV "håbe") ; + horse_N = mk3N "hest" "hesten" "heste" ; + hot_A = regADeg "hed" ; + house_N = mk3N "hus" "huset" "huse" ; + important_A = regADeg "vigtig" ; + industry_N = mk2N "industri" "industrien" ; + iron_N = mk2N "jern" "jernet" ; + john_PN = mkPN "John" utrum ; + king_N = mk2N "konge" "kongen" ; + know_V2 = dirV2 vide_V ; + lake_N = mk2N "sø" "søen" ; + lamp_N = mk2N "lampe" "lampen" ; + learn_V2 = dirV2 (mk2V "lære" "lærte") ; + leather_N = mk2N "læder" "lædret" ; + leave_V2 = dirV2 forlade_V ; + like_V2 = mkV2 holde_V (mkPrep "af") ; + listen_V2 = dirV2 (regV "lytte") ; + live_V = mk2V "leve" "levde" ; + long_A = irregADeg "lang" "længere" "længst" ; ---- + lose_V2 = dirV2 (regV "tabe") ; + love_N = mk2N "kærlighed" "kærligheden" ; + love_V2 = dirV2 (regV "elske") ; + man_N = mkN "mand" "manden" "mænd" "mændene" ; + married_A2 = mkA2 (mk2A "gift" "gift") (mkPrep "med") ; + meat_N = mk2N "kød" "kødet" ; + milk_N = mk2N "mælk" "mælken" ; + moon_N = mk2N "måne" "månen" ; + mother_N2 = mkN2 (mkN "moder" "moderen" "mødre" "mødrene") (mkPrep "til") ; ---- + mountain_N = mk2N "bjerg" "bjerget" ; + music_N = mk2N "musik" "musiken" ; + narrow_A = regADeg "smal" ; + new_A = mkADeg "ny" "nytt" "nye" "nyere" "nyest" ; + newspaper_N = mk2N "avis" "avisen" ; + oil_N = mk2N "olie" "olien" ; + old_A = mkADeg "gammel" "gammelt" "gamle" "ældre" "ældst" ; ---- + open_V2 = dirV2 (regV "åbne") ; + paint_V2A = mkV2A (regV "male") noPrep ; + paper_N = mk2N "papir" "papiret" ; + paris_PN = mkPN "Paris" neutrum ; + peace_N = mk2N "fred" "freden" ; + pen_N = mk2N "pen" "penen" ; + planet_N = mk2N "planet" "planeten" ; + plastic_N = mk2N "plast" "plasten" ; + play_V2 = dirV2 (mk2V "spille" "spilte") ; + policeman_N = mk2N "politibetjent" "politibetjenten" ; ---- + priest_N = mk2N "præst" "præsten" ; + probable_AS = mkAS (regA "sandsynlig") ; + queen_N = mk2N "dronning" "dronningen" ; + radio_N = mk2N "radio" "radioen" ; + rain_V0 = mkV0 (regV "regne") ; + read_V2 = dirV2 (mk2V "læse" "læste") ; + red_A = regADeg "rød" ; + religion_N = mk2N "religion" "religionen" ; + restaurant_N = mk2N "restaurant" "restauranten" ; + river_N = mk2N "flod" "floden" ; + rock_N = mk2N "sten" "stenen" ; + roof_N = mk2N "tag" "taget" ; + rubber_N = mk2N "gummi" "gummien" ; + run_V = vaereV (regV "løbe") ; + say_VS = mkVS sige_V ; + school_N = mk2N "skole" "skolen" ; + science_N = mk2N "videnskab" "videnskaben" ; + sea_N = mk2N "hav" "havet" ; + see_V2 = dirV2 se_V ; + seek_V2 = mkV2 (mk2V "søge" "søgte") (mkPrep "efter") ; + sell_V3 = dirV3 sælge_V (mkPrep "til") ; + send_V3 = dirV3 (mk2V "sende" "sendte") (mkPrep "til") ; + sheep_N = mk2N "får" "fåret" ; + ship_N = mk2N "skib" "skibet" ; + shirt_N = mk2N "skjorte" "skjorten" ; + shoe_N = mk2N "sko" "skoen" ; + shop_N = mk2N "butik" "butiken" ; + short_A = regADeg "kort" ; + silver_N = mk2N "sølv" "sølvet"; + sister_N = mk3N "søster" "søstren" "søstrer" ; ---- + sleep_V = sove_V ; + small_A = mkADeg "lille" "lille" "små" "mindre" "mindst" ; ---- + snake_N = mk2N "slange" "slangen" ; + sock_N = mk2N "sok" "sokken" ; + speak_V2 = dirV2 (regV "tale") ; ---- + star_N = mk2N "stjerne" "stjernen" ; + steel_N = mk2N "stål" "stålet" ; + stone_N = mk2N "sten" "stenen" ; + stove_N = mk2N "komfur" "komfuren" ; + student_N = mk2N "student" "studenten" ; + stupid_A = mk3ADeg "dum" "dumt" "dumme" ; + sun_N = mk2N "sol" "solen" ; + switch8off_V2 = dirV2 (partV (regV "lukke") "for") ; + switch8on_V2 = dirV2 (partV (regV "lukke") "op") ; + table_N = mk2N "bord" "bordet" ; + talk_V3 = mkV3 (regV "tale") (mkPrep "til") (mkPrep "om") ; + teacher_N = mkN "lærer" "læreren" "lærere" "lærerne" ; + teach_V2 = dirV2 (mk2V "undervise" "underviste") ; + television_N = mk2N "fjernsyn" "fjernsynet" ; + thick_A = mk3ADeg "tyk" "tykt" "tykke" ; + thin_A = mk2ADeg "tynd" "tyndt" ; ---- + train_N = mk2N "tog" "toget" ; + travel_V = vaereV (mk2V "rejse" "rejste") ; + tree_N = mkN "træ" "træet" "træer" "træene" ; ---- + ---- trousers_N = regGenN "trousers" ; ---- pl t ! + ugly_A = mk3ADeg "grim" "grimt" "grimme" ; + understand_V2 = dirV2 (irregV "forstå" "forstod" "forstått") ; + university_N = mk2N "universitet" "universitetet" ; + village_N = mk2N "landsby" "landsbyen" ; + wait_V2 = mkV2 (regV "vente") (mkPrep "på") ; + walk_V = vaereV gå_V ; + warm_A = regADeg "varm" ; + war_N = mk2N "krig" "krigen" ; + watch_V2 = mkV2 se_V (mkPrep "på") ; + water_N = mk2N "vand" "vandet" ; + white_A = regADeg "hvid" ; + window_N = mkN "vindue" "vinduet" "vinduer" "vinduene" ; ---- er? + wine_N = mk2N "vin" "vinen" ; + win_V2 = dirV2 (irregV "vinde" "vand" "vundet") ; + woman_N = mk2N "kvinde" "kvinden" ; + wonder_VQ = mkVQ (depV (regV "undre")) ; + wood_N = mkN "træ" "træet" "træer" "træene" ; ---- + write_V2 = dirV2 (irregV "skrive" "skrev" "skrevet") ; + yellow_A = regADeg "gul" ; + young_A = irregADeg "ung" "yngre" "yngst" ; ---- + + do_V2 = dirV2 gøre_V ; + now_Adv = mkAdv "nu" ; + already_Adv = mkAdv "allerede" ; + song_N = mk2N "sang" "sangen" ; + add_V3 = mkV3 (regV "tilføje") noPrep (mkPrep "til") ; ---- + number_N = mk2N "nummer" "numret" ; ---- + put_V2 = dirV2 sætte_V ; + stop_V = vaereV (regV "standse") ; + jump_V = regV "hoppe" ; + + left_Ord = {s = "venstre" ; isDet = True} ; + right_Ord = {s = "højre" ; isDet = True} ; + far_Adv = mkAdv "fjern" ; + correct_A = regA "rigtig" ; + dry_A = mk3ADeg "tør" "tørt" "tørre" ; + dull_A = regA "sløv" ; + full_A = regA "fuld" ; + heavy_A = irregADeg "tung" "tyngre" "tyngst" ; + near_A = mkADeg "nære" "nære" "nære" "nærmere" "nærmest" ; + rotten_A = mk3ADeg "rådden" "råddent" "rådne" ; ---- + round_A = regA "rund" ; + sharp_A = regA "skarp" ; + smooth_A = regA "jævn" ; + straight_A = mk3ADeg "ret" "rett" "rette" ; ---- + wet_A = regA "våd" ; + wide_A = regA "bred" ; + animal_N = mk2N "dyr" "dyret" ; + ashes_N = mk2N "aske" "asken" ; + back_N = mk2N "ryg" "ryggen" ; ---- + bark_N = mk2N "bark" "barken" ; + belly_N = mk2N "mave" "maven" ; + blood_N = mk2N "blod" "blodet" ; + bone_N = mk2N "ben" "benet" ; + breast_N = mk2N "bryst" "brystet" ; + cloud_N = mk2N "sky" "skyen" ; + day_N = mk3N "dag" "dagen" "dage" ; + dust_N = mk2N "støv" "støvet" ; + ear_N = mk3N "øre" "øret" "ører" ; + earth_N = mk2N "jord" "jorden" ; + egg_N = mk2N "æg" "æget" ; + eye_N = mk3N "øje" "øjet" "øjne" ; + fat_N = mk2N "fedt" "fedtet" ; + feather_N = mk2N "fjer" "fjeren" ; + fingernail_N = mk2N "negl" "neglen" ; + fire_N = mk2N "ild" "ilden" ; + flower_N = mk2N "blomst" "blomsten" ; + fog_N = mk2N "tåge" "tågen" ; + foot_N = mk2N "fod" "føder" ; ---- + forest_N = mk2N "skov" "skoven" ; + grass_N = mk2N "græs" "græset" ; + guts_N = mk2N "tarm" "tarmen" ; ---- indvolde + hair_N = mk2N "hår" "håret" ; + hand_N = mk2N "hånd" "hånden" ; + head_N = mk2N "hoved" "hovedet" ; + heart_N = mk3N "hjerte" "hjertet" "hjerter" ; + horn_N = mk2N "horn" "hornet" ; + husband_N = mk2N "ægtefælle" "ægtefællen" ; ---- + ice_N = mk2N "is" "isen" ; + knee_N = mkN "knæ" "knæt" "knær" "knæne" ; ---- + leaf_N = mk2N "løv" "løvet" ; + leg_N = mk2N "ben" "benet" ; + liver_N = mkN "lever" "leveren" "levrer" "levrene" ; ---- + louse_N = mk3N "lus" "lusen" "lus" ; + mouth_N = mk2N "mund" "munden" ; + name_N = mk2N "navn" "navnet" ; + neck_N = mk2N "hals" "halsen" ; + night_N = mk3N "nat" "natten" "nætter" ; ---- + nose_N = mk2N "næse" "næsen" ; + person_N = mk2N "person" "personen" ; + rain_N = mk2N "regn" "regnet" ; + road_N = mk2N "vej" "vejen" ; + root_N = mk3N "rod" "roden" "røder" ; ---- + rope_N = mk2N "reb" "rebet" ; + salt_N = mk2N "salt" "saltet" ; + sand_N = mk2N "sand" "sanden" ; + seed_N = mk2N "frø" "frøet" ; + skin_N = mk2N "skind" "skindet" ; + sky_N = mk3N "himmel" "himlen" "himler" ; ---- + smoke_N = mk2N "røg" "røgen" ; + snow_N = mk2N "snø" "snøen" ; + stick_N = mk2N "pind" "pinden" ; + tail_N = mk2N "hale" "halen" ; + tongue_N = mk2N "tunge" "tungen" ; + tooth_N = mkN "tand" "tanden" "tænder" "tændene" ; ---- + wife_N = mk2N "kone" "konen" ; + wind_N = mk2N "vind" "vinden" ; + wing_N = mk2N "vinge" "vingen" ; + worm_N = mk2N "orm" "ormen" ; + year_N = mk2N "år" "året" ; + bite_V2 = dirV2 bide_V ; + blow_V = mk2V "blæse" "blæste" ; + burn_V = brænde_V ; + count_V2 = dirV2 tælle_V ; + cut_V2 = dirV2 (skære_V) ; + dig_V = mk2V "grave" "gravde" ; + fall_V = vaereV falde_V ; + fear_V2 = dirV2 (regV "frygte") ; + fight_V2 = dirV2 (regV "kæmpe") ; + float_V = flyde_V ; + flow_V = regV "strømme" ; + fly_V = vaereV flyve_V ; + freeze_V = fryse_V ; + give_V3 = dirV3 give_V (mkPrep "til"); + hit_V2 = dirV2 (slå_V) ; + hold_V2 = dirV2 (holde_V) ; + hunt_V2 = dirV2 (regV "jage") ; + kill_V2 = dirV2 (regV "dræbe") ; + laugh_V = le_V ; + lie_V = ligge_V ; + play_V = regV "spille" ; + pull_V2 = dirV2 (regV "trække") ; + push_V2 = dirV2 (regV "skubbe") ; + rub_V2 = dirV2 (gnide_V) ; + scratch_V2 = dirV2 (regV "kradse") ; + sew_V = mk2V "sy" "sydde" ; + sing_V = synge_V ; + sit_V = sidde_V ; + smell_V = regV "lugte" ; + spit_V = regV "spytte" ; + split_V2 = dirV2 (regV "splitte") ; ---- + squeeze_V2 = dirV2 (regV "presse") ; + stab_V2 = dirV2 (stikke_V) ; + stand_V = vaereV stå_V ; + suck_V2 = dirV2 (regV "sutte") ; ---- + swell_V = regV "svulme" ; + swim_V = regV "svømme" ; + think_V = mk2V "tænke" "tænkte" ; ---- + throw_V2 = dirV2 (regV "kaste") ; + tie_V2 = dirV2 binde_V ; + turn_V = regV "dreje" ; + vomit_V = partV (regV "kaste") "op" ; + wash_V2 = dirV2 (regV "vaske") ; + wipe_V2 = dirV2 (regV "viske") ; + breathe_V = regV "ånde" ; + + grammar_N = regN "grammatik" ; + language_N = mk2N "sprog" "sproget" ; + rule_N = mkN "regel" "regeln" "regler" "reglerne" ; + + question_N = mk2N "spørgsmål" "spørgsmålet" ; + +---- ready_A = regA "färdig" ; +---- reason_N = regN "anledning" ; + today_Adv = mkAdv "idag" ; +---- uncertain_A = mk3A "osäker" "osäkert" "osäkra" ; + +} ; + diff --git a/lib/next-resource/danish/MathDan.gf b/lib/next-resource/danish/MathDan.gf new file mode 100644 index 000000000..11d87f5d9 --- /dev/null +++ b/lib/next-resource/danish/MathDan.gf @@ -0,0 +1,2 @@ +concrete MathDan of Math = CatDan ** MathScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/MorphoDan.gf b/lib/next-resource/danish/MorphoDan.gf new file mode 100644 index 000000000..a5ee90a48 --- /dev/null +++ b/lib/next-resource/danish/MorphoDan.gf @@ -0,0 +1,164 @@ +--1 A Simple Danish Resource Morphology +-- +-- Aarne Ranta 2002 +-- +-- This resource morphology contains definitions needed in the resource +-- syntax. It moreover contains copies of the most usual inflectional patterns +-- as defined in functional morphology (in the Haskell file $RulesSw.hs$). +-- +-- We use the parameter types and word classes defined for morphology. + +resource MorphoDan = CommonScand, ResDan ** open Prelude, Predef in { + +oper + +-- type synonyms + + Subst : Type = {s : Number => Species => Case => Str} ; + Adj = Adjective ; + +-- nouns + + mkSubstantive : (_,_,_,_ : Str) -> Subst = + \dreng, drengen, drenger, drengene -> + {s = nounForms dreng drengen drenger drengene} ; + + extNGen : Str -> Gender = \s -> case last s of { + "n" => Utr ; + _ => Neutr + } ; + + nDreng : Str -> Subst = \dreng -> + mkSubstantive dreng (dreng + "en") (dreng + "e") (dreng + "ene") ** + {h1 = Utr} ; + + nBil : Str -> Subst = \bil -> + mkSubstantive bil (bil + "en") (bil + "er") (bil + "erne") ** + {h1 = Utr} ; + + nUge : Str -> Subst = \uge -> + mkSubstantive uge (uge + "n") (uge + "r") (uge + "rne") ** + {h1 = Utr} ; + + nHus : Str -> Subst = \hus -> + mkSubstantive hus (hus + "et") hus (hus + "ene") ** + {h1 = Neutr} ; + +-- adjectives + + mkAdject : (_,_,_,_,_ : Str) -> Adj = + \stor,stort,store,storre,storst -> {s = table { + AF (APosit (Strong SgUtr )) c => mkCase c stor ; + AF (APosit (Strong SgNeutr)) c => mkCase c stort ; + AF (APosit _) c => mkCase c store ; + AF ACompar c => mkCase c storre ; + AF (ASuperl SupStrong) c => mkCase c storst ; + AF (ASuperl SupWeak) c => mkCase c (storst + "e") + } + } ; + + aRod : Str -> Adj = \rod -> + mkAdject rod (rod + "t") (rod + "e") (rod + "ere") (rod + "est") ; + + aAbstrakt : Str -> Adj = \abstrakt -> + mkAdject abstrakt abstrakt (abstrakt + "e") (abstrakt + "ere") (abstrakt + "est") ; + + aRask : Str -> Adj = \rask -> + mkAdject rask rask (rask + "e") (rask + "ere") (rask + "est") ; + + +-- verbs + + Verbum : Type = {s : VForm => Str} ; + + mkVerb6 : (_,_,_,_,_,_ : Str) -> Verbum = + \spise,spiser,spises,spiste,spist,spis -> {s = table { + VI (VInfin v) => mkVoice v spise ; + VF (VPres Act) => spiser ; + VF (VPres Pass) => spises ; + VF (VPret v) => mkVoice v spiste ; --# notpresent + VI (VSupin v) => mkVoice v spist ; --# notpresent + VI (VPtPret (Strong (SgUtr | SgNeutr)) c) => mkCase c spist ; + VI (VPtPret _ c) => mkCase c (spist + "e") ; + VF (VImper v) => mkVoice v spis + } + } ; + + irregVerb : (drikke,drakk,drukket : Str) -> Verbum = + \drikke,drakk,drukket -> + let + drikk = init drikke ; + drikker = case last (init drikke) of { + "r" => drikk ; + _ => drikke + "r" + } + in + mkVerb6 drikke drikker (drikke + "s") drakk drukket (mkImper drikk) ; + + regVerb : Str -> Str -> Verbum = \spise, spiste -> + let + spis = init spise ; + te = Predef.dp 2 spiste + in + case te of { + "te" => vSpis spis ; + "de" => case last spise of { + "e" => vHusk spis ; + _ => vBo spise + } ; + _ => vHusk spis + } ; + + vHusk : Str -> Verbum = \husk -> + mkVerb6 (husk + "e") (husk + "er") (husk + "es") (husk + "ede") (husk + "et") + (mkImper husk) ; + + vSpis : Str -> Verbum = \spis -> + mkVerb6 (spis + "e") (spis + "er") (spis + "es") (spis + "te") (spis + "t") + (mkImper spis) ; + + vBo : Str -> Verbum = \bo -> + mkVerb6 bo (bo + "r") (bo + "es") (bo + "ede") (bo + "et") (mkImper bo) ; + +-- Remove consonant duplication: "passe - pas" + + mkImper : Str -> Str = \s -> + if_then_Str (pbool2bool (Predef.eqStr (last s) (last (init s)))) (init s) s ; + +-- For $Numeral$. + +param DForm = ental | ton | tiotal ; + +oper + LinDigit = {s : DForm => CardOrd => Str} ; + + cardOrd : Str -> Str -> CardOrd => Str = \tre,tredje -> + table { + NCard _ => tre ; + NOrd a => tredje ---- a + } ; + + cardReg : Str -> CardOrd => Str = \syv -> + cardOrd syv (syv + case last syv of { + "n" => "de" ; + "e" => "nde" ; + _ => "ende" + }) ; + + + mkTal : (x1,_,_,_,x5 : Str) -> LinDigit = + \två, tolv, tjugo, andra, tyvende -> + {s = table { + ental => cardOrd två andra ; + ton => cardReg tolv ; + tiotal => cardOrd tjugo tyvende + } + } ; + + numPl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \n -> + {s = n ; n = Pl} ; + + invNum : CardOrd = NCard Neutr ; + + +} diff --git a/lib/next-resource/danish/NounDan.gf b/lib/next-resource/danish/NounDan.gf new file mode 100644 index 000000000..8005b0d30 --- /dev/null +++ b/lib/next-resource/danish/NounDan.gf @@ -0,0 +1,2 @@ +concrete NounDan of Noun = CatDan ** NounScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/NumeralDan.gf b/lib/next-resource/danish/NumeralDan.gf new file mode 100644 index 000000000..b8846c8ef --- /dev/null +++ b/lib/next-resource/danish/NumeralDan.gf @@ -0,0 +1,83 @@ +concrete NumeralDan of Numeral = CatDan ** open MorphoDan in { + + +-- AR 12/10/2002 following www.geocities.com/tsca.geo/dansk/dknummer.html + +lincat + Digit = {s : DForm => CardOrd => Str} ; + Sub10 = {s : DForm => CardOrd => Str ; n : Number} ; + Sub100, Sub1000, Sub1000000 = + {s : CardOrd => Str ; n : Number} ; + +lin num x = x ; + +lin n2 = mkTal "to" "tolv" "tyve" "anden" "tyvende" ; +lin n3 = mkTal "tre" "tretten" "tredive" "tredje" "tredivte" ; +lin n4 = mkTal "fire" "fjorten" "fyrre" "fjerde" "fyrretyvende" ; +lin n5 = mkTal "fem" "femten" "halvtreds" "femte" "halvtredsindstyvende" ; +lin n6 = mkTal "seks" "seksten" "tres" "sjette" "tredsindstyvende" ; +lin n7 = mkTal "syv" "sytten" "halvfjerds" "syvende""halvfjerdsindstyvende" ; +lin n8 = mkTal "otte" "atten" "firs" "ottende""firsindstyvende" ; +lin n9 = mkTal "ni" "nitten" "halvfems" "niende" "halvfemsindstyvende" ; + + pot01 = { + s = \\f => table { + NCard g => case g of {Neutr => "et" ; _ => "en"} ; + _ => "første" + } ; + n = Sg + } ; + pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ; + pot110 = numPl (cardReg "ti") ; + pot111 = numPl (cardOrd "elleve" "elvte") ; + pot1to19 d = numPl (d.s ! ton) ; + pot0as1 n = {s = n.s ! ental ; n = n.n} ; + pot1 d = numPl (d.s ! tiotal) ; + + pot1plus d e = { + s = \\g => e.s ! ental ! invNum ++ "og" ++ d.s ! tiotal ! g ; n = Pl} ; + pot1as2 n = n ; + pot2 d = numPl (\\_ => d.s ! ental ! invNum ++ "hundrede") ; + pot2plus d e = + {s = \\g => d.s ! ental ! invNum ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ; + pot2as3 n = n ; + pot3 n = numPl (\\g => n.s ! invNum ++ cardOrd "tusind" "tusinde" ! g) ; + pot3plus n m = {s = \\g => n.s ! invNum ++ "tusind" ++ "og" ++ m.s ! g ; n =Pl} ; + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard neutrum ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1:e" Sg ; + D_2 = mk2Dig "2" "2:e" ; + D_3 = mkDig "3" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":e") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ => o} ; + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + +} diff --git a/lib/next-resource/danish/ParadigmsDan.gf b/lib/next-resource/danish/ParadigmsDan.gf new file mode 100644 index 000000000..ce488ddee --- /dev/null +++ b/lib/next-resource/danish/ParadigmsDan.gf @@ -0,0 +1,517 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +--1 Danish Lexical Paradigms +-- +-- Aarne Ranta 2005 - 2006 +-- +-- 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. +-- +-- Closed categories (determiners, pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural.gf$. +-- +-- The main difference with $MorphoDan.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 structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- 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 [``IrregDan`` ../../danish/IrregDan.gf], +-- which haves a list of irregular verbs. + +resource ParadigmsDan = + open + (Predef=Predef), + Prelude, + CommonScand, + ResDan, + MorphoDan, + CatDan in { + +--2 Parameters +-- +-- To abstract over gender names, we define the following identifiers. + +oper + Gender : Type ; + + utrum : Gender ; + neutrum : 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 ; + +-- Prepositions used in many-argument functions are just strings. + + mkPrep : Str -> Prep ; + noPrep : Prep ; -- empty string + +--2 Nouns + + mkN : overload { + +-- The regular function takes the singular indefinite form +-- and computes the other forms and the gender by a heuristic. +-- The heuristic is that all nouns are $utrum$ with the +-- plural ending "er" or "r". + + mkN : (bil : Str) -> N ; + +-- Giving gender manually makes the heuristic more reliable. + + mkN : (hus : Str) -> Gender -> N ; + +-- This function takes the singular indefinite and definite forms; the +-- gender is computed from the definite form. + + mkN : (bil,bilen : Str) -> N ; + +-- This function takes the singular indefinite and definite and the plural +-- indefinite + + mkN : (bil,bilen,biler : Str) -> N ; + +-- Worst case: give all four forms. The gender is computed from the +-- last letter of the second form (if "n", then $utrum$, otherwise $neutrum$). + + mkN : (dreng,drengen,drenge,drengene : Str) -> N ; + } ; + + + + +--3 Compound nouns +-- +-- All the functions above work quite as well to form compound nouns, +-- such as "fodbold". + + +--3 Relational nouns +-- +-- Relational nouns ("datter til x") need a preposition. + + mkN2 : N -> Prep -> N2 ; + +-- The most common preposition is "af", and the following is a +-- shortcut for regular relational nouns with "af". + + regN2 : Str -> Gender -> N2 ; + +-- Use the function $mkPrep$ or see the section on prepositions below to +-- form other prepositions. +-- +-- Three-place relational nouns ("forbindelse fra x til y") +-- need two prepositions. + + mkN3 : N -> Prep -> Prep -> N3 ; + + +--3 Relational common noun phrases +-- +-- In some cases, you may want to make a complex $CN$ into a +-- relational noun (e.g. "tidligere kone til"). However, $N2$ and +-- $N3$ are purely lexical categories. But you can use the $AdvCN$ +-- and $PrepNP$ constructions to build phrases like this. + +-- +--3 Proper names and noun phrases +-- +-- Proper names, with a regular genitive, are formed as follows + + mkPN : overload { + mkPN : Str -> PN ; -- utrum + mkPN : Str -> Gender -> PN ; + mkPN : N -> PN ; + } ; + + +--2 Adjectives + +-- The regular pattern works for many adjectives, e.g. those ending +-- with "ig". Two, five, or at worst five forms are sometimes needed. + + mkA : overload { + mkA : (fin : Str) -> A ; + mkA : (fin,fint : Str) -> A ; + mkA : (galen,galet,galne : Str) -> A ; + mkA : (stor,stort,store,storre,storst : Str) -> A ; + +-- If comparison is formed by "mer", "mest", as in general for +-- long adjective, the following pattern is used: + + mkA : A -> A ; -- -/mer/mest norsk + } ; + +--3 Two-place adjectives +-- +-- Two-place adjectives need a preposition for their second argument. + + mkA2 : A -> Prep -> A2 ; + + + +--2 Adverbs + +-- Adverbs are not inflected. Most lexical ones have position +-- after the verb. Some can be close to the verb like the negation +-- "ikke" (e.g. "altid"). + + mkAdv : Str -> Adv ; + mkAdV : Str -> AdV ; + +-- Adverbs modifying adjectives and sentences can also be formed. + + mkAdA : Str -> AdA ; + + +--2 Verbs +-- + + mkV : overload { + +-- The 'regular verb' function is the first conjugation. + + mkV : (snakke : Str) -> V ; + +-- The almost regular verb function needs the infinitive and the preteritum. + + mkV : (leve,levde : Str) -> V ; + +-- There is an extensive list of irregular verbs in the module $IrregDan$. +-- In practice, it is enough to give three forms, as in school books. + + mkV : (drikke, drakk, drukket : Str) -> V ; + +-- The worst case needs six forms. + + mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; + + +--3 Verbs with a particle. +-- +-- The particle, such as in "lukke op", is given as a string. + + mkV : V -> Str -> V ; + } ; + + + +--3 Verbs with 'være' as auxiliary +-- +-- By default, the auxiliary is "have". This function changes it to "være". + + vaereV : V -> V ; + + + + +--3 Deponent verbs +-- +-- Some words are used in passive forms only, e.g. "undres", some as +-- reflexive e.g. "forestille sig". + + depV : V -> V ; + reflV : V -> V ; + + +--3 Two-place verbs +-- +-- Two-place verbs need a preposition, except the special case with direct object. +-- (transitive verbs). Notice that, if a particle is needed, it comes from the $V$. + + mkV2 : overload { + mkV2 : Str -> V2 ; + mkV2 : V -> V2 ; + mkV2 : V -> Prep -> V2 ; + } ; + + +--3 Three-place verbs +-- +-- Three-place (ditransitive) verbs need two prepositions, of which +-- the first one or both can be absent. + + mkV3 : V -> Prep -> Prep -> V3 ; -- snakke, med, om + dirV3 : V -> Prep -> V3 ; -- give,_,til + dirdirV3 : V -> V3 ; -- give,_,_ + +--3 Other complement patterns +-- +-- Verbs and adjectives can take complements such as sentences, +-- questions, verb phrases, and adjectives. + + mkV0 : V -> V0 ; + mkVS : V -> VS ; + mkV2S : V -> Prep -> V2S ; + mkVV : V -> VV ; + mkV2V : V -> Prep -> Prep -> V2V ; + mkVA : V -> VA ; + mkV2A : V -> Prep -> V2A ; + mkVQ : V -> VQ ; + mkV2Q : V -> Prep -> V2Q ; + + mkAS : A -> AS ; + mkA2S : A -> Prep -> A2S ; + mkAV : A -> AV ; + mkA2V : A -> Prep -> A2V ; + +-- Notice: categories $AS, A2S, AV, A2V$ are just $A$, +-- and the second argument is given as an adverb.. +-- $V0$ is just $V$. + + V0 : Type ; + AS, A2S, AV, A2V : Type ; + +--. + +--2 Definitions of the paradigms +-- +-- The definitions should not bother the user of the API. So they are +-- hidden from the document. + + + Gender = MorphoDan.Gender ; + Number = MorphoDan.Number ; + Case = MorphoDan.Case ; + utrum = Utr ; + neutrum = Neutr ; + singular = Sg ; + plural = Pl ; + nominative = Nom ; + genitive = Gen ; + + Preposition : Type = Str ; -- obsolete + + mkPreposition : Str -> Prep ; -- obsolete + mkPreposition = mkPrep ; + + mkPrep p = {s = p ; lock_Prep = <>} ; + noPrep = mkPrep [] ; + + mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ; + + regN x = regGenN x Utr ; + + regGenN x g = case last x of { + "e" => case g of { + Utr => mk4N x (x + "n") (x + "r") (x + "rne") ; + Neutr => mk4N x (x + "t") (x + "r") (init x + "ene") + } ; + _ => case g of { + Utr => mk4N x (x + "en") (x + "er") (x + "erne") ; + Neutr => mk4N x (x + "et") (x + "") (x + "ene") + } + } ; + + + mk2N x y = case last y of { + "n" => mk3N x y (init y + "r") ; + _ => mk3N x y x + } ; + + mk3N x y z = let u = ifTok Str x z "ene" "ne" in mk4N x y z (z + u) ; + + mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = mkComplement p.s} ; + regN2 n g = mkN2 (regGenN n g) (mkPreposition "av") ; + mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = mkComplement p.s ; c3 = mkComplement q.s} ; + + mk2PN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ; + regPN n = mk2PN n utrum ; + nounPN n = {s = n.s ! singular ! Indef ; g = n.g ; lock_PN = <>} ; + +-- To form a noun phrase that can also be plural and have an irregular +-- genitive, you can use the worst-case function. + + makeNP : Str -> Str -> Number -> Gender -> NP ; + makeNP x y n g = + {s = table {NPPoss _ => x ; _ => y} ; a = agrP3 g n ; + lock_NP = <>} ; + + mk3A = mk3ADeg ; + mk2A a b = mk3A a b (a + "e") ; + regA a = (regADeg a) ** {lock_A = <>} ; + + mkA2 a p = a ** {c2 = mkComplement p.s ; lock_A2 = <>} ; + + mkADeg a b c d e = mkAdject a b c d e ** {isComp = False ; lock_A = <>} ; + + regADeg a = case Predef.dp 2 a of { + "sk" => aRask a ; + _ => case last a of { + "t" => aAbstrakt a ; + _ => aRod a + }} ** {isComp = False ; lock_A = <>} ; + + irregADeg a b c = mkAdject a (a + "t") (a + "e") b c ** + {isComp = False ; lock_A = <>} ; + mk3ADeg a b c = mkAdject a b c (c + "re") (c + "st") ** + {isComp = False ; lock_A = <>} ; + mk2ADeg a b = mkAdject a b (a + "e") (a + "ere") (a + "est") ** + {isComp = False ; lock_A = <>} ; + + compoundA adj = {s = adj.s ; isComp = True ; lock_A = <>} ; + + mkAdv x = ss x ** {lock_Adv = <>} ; + mkAdV x = ss x ** {lock_AdV = <>} ; + mkAdA x = ss x ** {lock_AdA = <>} ; + + mk6V a b c d e f = mkVerb6 a b c d e f ** + {part = [] ; vtype = VAct ; lock_V = <> ; isVaere = False} ; + + regV a = case last a of { + "e" => vHusk (init a) ; + _ => vBo a + } ** {part = [] ; vtype = VAct ; isVaere = False ; lock_V = <>} ; + + mk2V a b = regVerb a b ** + {part = [] ; vtype = VAct ; isVaere = False ; lock_V = <>} ; + + irregV = + \drikke,drakk,drukket -> + let + drikk = case last drikke of { + "e" => init drikke ; + _ => drikke + } ; + drikker = case last (init drikke) of { + "r" => init drikke ; + _ => drikke + "r" + } + in + mk6V drikke drikker (drikke + "s") drakk drukket (mkImper drikk) ; + + vaereV v = { + s = v.s ; + part = [] ; + vtype = v.vtype ; + isVaere = True ; + lock_V = <> + } ; + + partV v p = { + s = v.s ; + part = p ; + vtype = v.vtype ; + isVaere = v.isVaere ; + lock_V = <> + } ; + + depV v = { + s = v.s ; part = v.part ; vtype = VPass ; isVaere = False ; lock_V = <> + } ; + reflV v = { + s = v.s ; part = v.part ; vtype = VRefl ; isVaere = False ; lock_V = <> + } ; + + mk2V2 v p = v ** {c2 = mkComplement p.s ; lock_V2 = <>} ; + dirV2 v = mk2V2 v (mkPrep []) ; + + mkV3 v p q = v ** {c2 = mkComplement p.s ; c3 = mkComplement 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 = mk2V2 v p ** {lock_V2S = <>} ; + mkVV v = v ** {c2 = mkComplement "at" ; lock_VV = <>} ; + mkV2V v p t = mk2V2 v p ** {c3 = mkComplement "at" ; lock_V2V = <>} ; + mkVA v = v ** {lock_VA = <>} ; + mkV2A v p = mk2V2 v p ** {lock_V2A = <>} ; + mkVQ v = v ** {lock_VQ = <>} ; + mkV2Q v p = mk2V2 v p ** {lock_V2Q = <>} ; + + 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_A = <>} ; + + V0 : Type = V ; + AS, A2S, AV : Type = A ; + A2V : Type = A2 ; + +--------------- + + mkN = overload { + mkN : Str -> N = regN ; + mkN : Str -> Gender -> N = regGenN ; + mkN : (bil,bilen : Str) -> N = mk2N ; + mkN : (bil,bilen,biler : Str) -> N = mk3N ; + mkN : (dreng,drengen,drenge,drengene : Str) -> N = mk4N ; + } ; + + + regN : Str -> N ; + regGenN : Str -> Gender -> N ; + mk2N : (bil,bilen : Str) -> N ; + mk3N : (bil,bilen,biler : Str) -> N ; + mk4N : (dreng,drengen,drenge,drengene : Str) -> N ; + + mkPN = overload { + mkPN : Str -> PN = regPN ; -- masculine + mkPN : Str -> Gender -> PN = mk2PN ; + mkPN : N -> PN = nounPN ; + } ; + + regPN : Str -> PN ; -- utrum + mk2PN : Str -> Gender -> PN ; + nounPN : N -> PN ; + + mkA = overload { + mkA : (fin : Str) -> A = regADeg ; + mkA : (fin,fint : Str) -> A = mk2ADeg ; + mkA : (galen,galet,galne : Str) -> A = mk3ADeg ; + mkA : (stor,stort,store,storre,storst : Str) -> A = mkADeg ; + mkA : A -> A = compoundA ; -- -/mer/mest norsk + } ; + + mk3A : (galen,galet,galne : Str) -> A ; + regA : Str -> A ; + mk2A : (stor,stort : Str) -> A ; + mkADeg : (stor,stort,store,storre,storst : Str) -> A ; + regADeg : Str -> A ; + irregADeg : (tung,tyngre,tyngst : Str) -> A ; + mk3ADeg : (galen,galet,galne : Str) -> A ; + mk2ADeg : (bred,bredt : Str) -> A ; + compoundA : A -> A ; -- -/mer/mest norsk + + mkV = overload { + mkV : (snakke : Str) -> V = regV ; + mkV : (leve,levde : Str) -> V = mk2V ; + mkV : (drikke, drakk, drukket : Str) -> V = irregV ; + mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V = mk6V ; + mkV : V -> Str -> V = partV ; + } ; + + + regV : (snakke : Str) -> V ; + mk2V : (leve,levde : Str) -> V ; + irregV : (drikke, drakk, drukket : Str) -> V ; + mk6V : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; + partV : V -> Str -> V ; + + mkV2 = overload { + mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; + mkV2 : V -> V2 = dirV2 ; + mkV2 : V -> Prep -> V2 = mk2V2 ; + } ; + + mk2V2 : V -> Prep -> V2 ; + dirV2 : V -> V2 ; + +} ; diff --git a/lib/next-resource/danish/PhraseDan.gf b/lib/next-resource/danish/PhraseDan.gf new file mode 100644 index 000000000..86a9789bf --- /dev/null +++ b/lib/next-resource/danish/PhraseDan.gf @@ -0,0 +1,2 @@ +concrete PhraseDan of Phrase = CatDan ** PhraseScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/QuestionDan.gf b/lib/next-resource/danish/QuestionDan.gf new file mode 100644 index 000000000..3dee9e7c7 --- /dev/null +++ b/lib/next-resource/danish/QuestionDan.gf @@ -0,0 +1,2 @@ +concrete QuestionDan of Question = CatDan ** QuestionScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/RelativeDan.gf b/lib/next-resource/danish/RelativeDan.gf new file mode 100644 index 000000000..361169b16 --- /dev/null +++ b/lib/next-resource/danish/RelativeDan.gf @@ -0,0 +1,2 @@ +concrete RelativeDan of Relative = CatDan ** RelativeScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/ResDan.gf b/lib/next-resource/danish/ResDan.gf new file mode 100644 index 000000000..5e761c268 --- /dev/null +++ b/lib/next-resource/danish/ResDan.gf @@ -0,0 +1,3 @@ +instance ResDan of ResScand = DiffDan ** open CommonScand, Prelude in { +} ; + diff --git a/lib/next-resource/danish/SentenceDan.gf b/lib/next-resource/danish/SentenceDan.gf new file mode 100644 index 000000000..542fffac4 --- /dev/null +++ b/lib/next-resource/danish/SentenceDan.gf @@ -0,0 +1,2 @@ +concrete SentenceDan of Sentence = CatDan ** SentenceScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/danish/StructuralDan.gf b/lib/next-resource/danish/StructuralDan.gf new file mode 100644 index 000000000..f401bfdd4 --- /dev/null +++ b/lib/next-resource/danish/StructuralDan.gf @@ -0,0 +1,129 @@ +concrete StructuralDan of Structural = CatDan ** + open MorphoDan, ParadigmsDan, Prelude in { + + flags optimize=all ; + + lin + above_Prep = ss "ovenfor" ; + after_Prep = ss "efter" ; + by8agent_Prep = ss "af" ; + all_Predet = {s = gennumForms "all" "alt" "alle"} ; + almost_AdA, almost_AdN = ss "næsten" ; + although_Subj = ss ["selv om"] ; + always_AdV = ss "altid" ; + and_Conj = {s1 = [] ; s2 = "og" ; n = Pl} ; + because_Subj = ss "fordi" ; + before_Prep = ss "før" ; + behind_Prep = ss "bag" ; + between_Prep = ss "mellem" ; + both7and_DConj = sd2 "både" "og" ** {n = Pl} ; + but_PConj = ss "men" ; + by8means_Prep = ss "med" ; + can8know_VV, can_VV = + mkV "kunne" "kan" "kan" "kunne" "kunnet" "kan" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + during_Prep = ss "under" ; + either7or_DConj = sd2 "enten" "eller" ** {n = Sg} ; + everybody_NP = regNP "alle" "alles" Plg ; + every_Det = {s = \\_,_ => "hver" ; n = Sg ; det = DDef Indef} ; + everything_NP = regNP "alt" "alts" SgNeutr ; + everywhere_Adv = ss "overalt" ; + few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ; +--- first_Ord = {s = "første" ; isDet = True} ; + for_Prep = ss "for" ; + from_Prep = ss "fra" ; + he_Pron = MorphoDan.mkNP "han" "ham" "hans" "hans" "hans" SgUtr P3 ; + here_Adv = ss "her" ; + here7to_Adv = ss "hit" ; + here7from_Adv = ss "herfra" ; + how_IAdv = ss "hvor" ; + how8many_IDet = {s = \\_ => ["hur mange"] ; n = Pl ; det = DDef Indef} ; + if_Subj = ss "hvis" ; + in8front_Prep = ss "foran" ; + i_Pron = + MorphoDan.mkNP "jeg" "mig" "min" "mit" "mine" SgUtr P1 ; + in_Prep = ss "i" ; + it_Pron = MorphoDan.regNP "det" "dets" SgNeutr ; + less_CAdv = ss "mindre" ; + many_Det = {s = \\_,_ => "mange" ; n = Pl ; det = DDef Indef} ; + more_CAdv = ss "mer" ; + most_Predet = {s = gennumForms ["den meste"] ["det meste"] ["de fleste"]} ; + much_Det = {s = \\_,_ => "meget" ; n = Pl ; det = DDef Indef} ; + must_VV = + mkV "måtte" "må" "må" "måtte" "måttet" "mått" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + no_Utt = ss ["nej"] ; + on_Prep = ss "på" ; +--- one_Quant = {s = \\_ => genderForms ["en"] ["et"] ; n = Sg ; det = DIndef} ; --- ei + only_Predet = {s = \\_ => "kun"} ; + or_Conj = {s1 = [] ; s2 = "eller" ; n = Pl} ; + otherwise_PConj = ss "anderledes" ; + part_Prep = ss "af" ; + please_Voc = ss "tak" ; --- + possess_Prep = ss "af" ; + quite_Adv = ss "temmelig" ; + she_Pron = MorphoDan.mkNP "hun" "hende" "hendes" "hendes" "hendes" SgUtr P3 ; + so_AdA = ss "så" ; + someSg_Det = {s = \\_ => genderForms "nogen" "noget" ; n = Sg ; det = DIndef} ; + somePl_Det = {s = \\_,_ => "nogle" ; n = Pl ; det = DIndef} ; + somebody_NP = regNP "nogen" "nogens" SgUtr ; + something_NP = regNP "noget" "nogets" SgNeutr ; + somewhere_Adv = ss ["et eller annet sted"] ; ---- ? + that_Quant = + {s = table { + Sg => \\_,_ => genderForms ["den der"] ["det der"] ; + Pl => \\_,_,_ => ["de der"] + } ; + det = DDef Indef + } ; + there_Adv = ss "der" ; + there7to_Adv = ss "dit" ; + there7from_Adv = ss "derfra" ; + therefore_PConj = ss "derfor" ; + they_Pron = MorphoDan.mkNP "de" "dem" "deres" "deres" "deres" Plg P1 ; + this_Quant = + {s = table { + Sg => \\_,_ => genderForms ["denne"] ["dette"] ; + Pl => \\_,_,_ => ["disse"] + } ; + det = DDef Indef + } ; + through_Prep = ss "gennem" ; + too_AdA = ss "for" ; + to_Prep = ss "til" ; + under_Prep = ss "under" ; + very_AdA = ss "meget" ; + want_VV = + mkV "ville" "vil" "vil" "ville" "villet" "villed" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + we_Pron = MorphoDan.mkNP "vi" "os" "vores" "vores" "vores" Plg P1 ; + whatSg_IP = {s = \\_ => "hvad" ; gn = SgUtr} ; ---- infl + whatPl_IP = {s = \\_ => "hvilke" ; gn = Plg} ; ---- infl + when_IAdv = ss "hvornår" ; + when_Subj = ss "når" ; + where_IAdv = ss "hver" ; + which_IQuant = { + s = table { + Sg => genderForms "hvilken" "hvilket" ; + Pl => \\_ => "hvilke" + } ; + det = DIndef + } ; + whoSg_IP = {s = vem.s ; gn = SgUtr} ; + whoPl_IP = {s = \\_ => "hvilke" ; gn = Plg} ; + why_IAdv = ss "hvorfor" ; + without_Prep = ss "uden" ; + with_Prep = ss "med" ; + yes_Utt = ss ["ja"] ; + youSg_Pron = + MorphoDan.mkNP "du" "dig" "din" "dit" "dine" SgUtr P2 ; ---- + youPl_Pron = MorphoDan.mkNP "i" "jer" "jeres" "jeres" "jeres" Plg P2 ; + youPol_Pron = MorphoDan.mkNP "Dere" "Dere" "Deres" "Deres" "Deres" SgUtr P2 ; --- wrong in refl + +-- Auxiliaries that are used repeatedly. + + oper + vem = MorphoDan.mkNP "hvem" "hvem" "hvis" "hvis" "hvis" SgUtr P3 ; + +} + diff --git a/lib/next-resource/danish/VerbDan.gf b/lib/next-resource/danish/VerbDan.gf new file mode 100644 index 000000000..90d1b8bcd --- /dev/null +++ b/lib/next-resource/danish/VerbDan.gf @@ -0,0 +1,2 @@ +concrete VerbDan of Verb = CatDan ** VerbScand with + (ResScand = ResDan) ; diff --git a/lib/next-resource/english/AdjectiveEng.gf b/lib/next-resource/english/AdjectiveEng.gf new file mode 100644 index 000000000..19dd5dddc --- /dev/null +++ b/lib/next-resource/english/AdjectiveEng.gf @@ -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 ; + +} diff --git a/lib/next-resource/english/AdverbEng.gf b/lib/next-resource/english/AdverbEng.gf new file mode 100644 index 000000000..ec7d46321 --- /dev/null +++ b/lib/next-resource/english/AdverbEng.gf @@ -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 ; +---b AdvSC s = s ; --- this rule give stack overflow in ordinary parsing + + AdnCAdv cadv = {s = cadv.s ++ "than"} ; + +} diff --git a/lib/next-resource/english/AllEng.gf b/lib/next-resource/english/AllEng.gf new file mode 100644 index 000000000..88b6e21f6 --- /dev/null +++ b/lib/next-resource/english/AllEng.gf @@ -0,0 +1,9 @@ +--# -path=.:../abstract:../common:prelude + +concrete AllEng of AllEngAbs = + 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 + ** {} ; diff --git a/lib/next-resource/english/AllEngAbs.gf b/lib/next-resource/english/AllEngAbs.gf new file mode 100644 index 000000000..687d573a5 --- /dev/null +++ b/lib/next-resource/english/AllEngAbs.gf @@ -0,0 +1,9 @@ +--# -path=.:../abstract:../common:prelude + +abstract AllEngAbs = + 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 + ** {} ; diff --git a/lib/next-resource/english/BackwardEng.gf b/lib/next-resource/english/BackwardEng.gf new file mode 100644 index 000000000..630626f0b --- /dev/null +++ b/lib/next-resource/english/BackwardEng.gf @@ -0,0 +1,76 @@ +concrete BackwardEng of Backward = CatEng ** open ResEng in { + + flags optimize=all_subs ; + + lin + +-- A repository of obsolete constructs, needed for backward compatibility. +-- They create spurious ambiguities if used in combination with Lang. + +-- from Verb 19/4/2008 + + 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) ; + ComplV2V v np vp = + insertObj (\\a => infVP v.isAux vp a) + (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; + ComplV2S v np s = + insertObj (\\_ => conjThat ++ s.s) + (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; + ComplV2Q v np q = + insertObj (\\_ => q.s ! QIndir) + (insertObj (\\_ => v.c2 ++ np.s ! Acc) (predV v)) ; + ComplV2A v np ap = + insertObj (\\_ => v.c2 ++ np.s ! Acc ++ ap.s ! np.a) (predV v) ; + + ReflV2 v = insertObj (\\a => v.c2 ++ reflPron ! a) (predV v) ; + +-- from Sentence 19/4/2008 + + 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} ; + +-- from Noun 19/4/2008 + + NumInt n = {s = n.s ; n = Pl} ; + OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED + + DetSg quant ord = { + s = quant.s ! Sg ++ ord.s ; + n = Sg + } ; + + DetPl quant num ord = { + s = quant.s ! num.n ++ num.s ++ ord.s ; + n = num.n + } ; + + NoNum = {s = []; n = Pl } ; + + DefArt = {s = \\_ => artDef} ; + + IndefArt = { + s = table { + Sg => artIndef ; + Pl => [] + } + } ; + + MassDet = {s = \\_ => []} ; + + + +-- from Structural 19/4/2008 + + that_NP = regNP "that" Sg ; + these_NP = regNP "these" Pl ; + this_NP = regNP "this" Sg ; + those_NP = regNP "those" Pl ; + +} diff --git a/lib/next-resource/english/CatEng.gf b/lib/next-resource/english/CatEng.gf new file mode 100644 index 000000000..d90d3ffea --- /dev/null +++ b/lib/next-resource/english/CatEng.gf @@ -0,0 +1,89 @@ +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 + SSlash = {s : Str ; c2 : Str} ; + +-- Sentence + + Cl = {s : ResEng.Tense => Anteriority => CPolarity => Order => Str} ; + ClSlash = { + s : ResEng.Tense => Anteriority => CPolarity => Order => Str ; + c2 : Str + } ; + Imp = {s : CPolarity => ImpForm => Str} ; + +-- Question + + QCl = {s : ResEng.Tense => Anteriority => CPolarity => QForm => Str} ; + IP = {s : Case => Str ; n : Number} ; + IComp = {s : Str} ; + IDet = {s : Str ; n : Number} ; + IQuant = {s : Number => Str} ; + +-- Relative + + RCl = { + s : ResEng.Tense => Anteriority => CPolarity => Agr => Str ; + c : Case + } ; + RP = {s : RCase => Str ; a : RAgr} ; + +-- Verb + + VP = ResEng.VP ; + VPSlash = ResEng.VP ** {c2 : Str} ; + Comp = {s : Agr => Str} ; + +-- Adjective + + AP = {s : Agr => Str ; isPre : Bool} ; + +-- Noun + + CN = {s : Number => Case => Str ; g : Gender} ; + NP = {s : Case => Str ; a : Agr} ; + Pron = {s : Case => Str ; sp : Str ; a : Agr} ; + Det = {s,sp : Str ; n : Number} ; + Predet, Ord = {s : Str} ; + Num = {s : Str ; n : Number ; hasCard : Bool} ; + Card = {s : Str ; n : Number} ; + Quant = {s,sp : Bool => Number => Str} ; + +-- Numeral + + Numeral = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ; + +-- Structural + + Conj = {s1,s2 : Str ; n : Number} ; +---b Conj = {s : Str ; n : Number} ; +---b 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, V2Q, V2S = Verb ** {c2 : Str} ; + V3 = Verb ** {c2, c3 : Str} ; + VV = {s : VVForm => Str ; isAux : Bool} ; + V2V = Verb ** {c2 : Str ; isAux : Bool} ; + + A = {s : AForm => Str} ; + A2 = {s : AForm => Str ; c2 : Str} ; + + N = {s : Number => Case => Str ; g : Gender} ; + N2 = {s : Number => Case => Str ; g : Gender} ** {c2 : Str} ; + N3 = {s : Number => Case => Str ; g : Gender} ** {c2,c3 : Str} ; + PN = {s : Case => Str ; g : Gender} ; + +} diff --git a/lib/next-resource/english/ConjunctionEng.gf b/lib/next-resource/english/ConjunctionEng.gf new file mode 100644 index 000000000..269ae5f80 --- /dev/null +++ b/lib/next-resource/english/ConjunctionEng.gf @@ -0,0 +1,60 @@ +concrete ConjunctionEng of Conjunction = + CatEng ** open ResEng, Coordination, Prelude in { + + flags optimize=all_subs ; + + lin + + ConjS = conjunctDistrSS ; + + ConjAdv = conjunctDistrSS ; + + ConjNP conj ss = conjunctDistrTable Case conj ss ** { + a = conjAgr (agrP3 conj.n) ss.a + } ; + + ConjAP conj ss = conjunctDistrTable Agr conj ss ** { + isPre = ss.isPre + } ; + +{---b + + ConjS = conjunctSS ; + DConjS = conjunctDistrSS ; + + ConjAdv = conjunctSS ; + DConjAdv = conjunctDistrSS ; + + ConjNP conj ss = conjunctTable Case conj ss ** { + a = conjAgr (agrP3 conj.n) ss.a + } ; + DConjNP conj ss = conjunctDistrTable Case conj ss ** { + a = conjAgr (agrP3 conj.n) ss.a + } ; + + 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} ; + +} diff --git a/lib/next-resource/english/ExtraEng.gf b/lib/next-resource/english/ExtraEng.gf new file mode 100644 index 000000000..7f6b3fde3 --- /dev/null +++ b/lib/next-resource/english/ExtraEng.gf @@ -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,ag => + rp.s ! RC (fromAgr ag).g 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} ; + + lin + BaseVPI = twoTable2 VPIForm Agr ; + ConsVPI = consrTable2 VPIForm Agr comma ; + + MkVPI vp = { + s = \\v,a => vp.ad ++ vp.inf ++ vp.s2 ! a + } ; + ConjVPI = conjunctDistrTable2 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 ! ImpF Sg False} ; + UncNegImpPl imp = {s = imp.s ! neg ! ImpF Pl False} ; + + CompoundCN a b = {s = \\n,c => a.s ! Sg ! Nom ++ b.s ! n ! c ; g = b.g} ; + + + oper + neg = CNeg False ; + +} diff --git a/lib/next-resource/english/ExtraEngAbs.gf b/lib/next-resource/english/ExtraEngAbs.gf new file mode 100644 index 000000000..9ee849627 --- /dev/null +++ b/lib/next-resource/english/ExtraEngAbs.gf @@ -0,0 +1,16 @@ +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 + +-- freely compounded nouns + + CompoundCN : CN -> CN -> CN ; -- rock album + +} diff --git a/lib/next-resource/english/GrammarEng.gf b/lib/next-resource/english/GrammarEng.gf new file mode 100644 index 000000000..932dd9821 --- /dev/null +++ b/lib/next-resource/english/GrammarEng.gf @@ -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 ; + +} ; diff --git a/lib/next-resource/english/IdiomEng.gf b/lib/next-resource/english/IdiomEng.gf new file mode 100644 index 000000000..87fb03136 --- /dev/null +++ b/lib/next-resource/english/IdiomEng.gf @@ -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 (fromAgr 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 (AgP1 Pl)} ; + +} + diff --git a/lib/next-resource/english/IrregEng.gf b/lib/next-resource/english/IrregEng.gf new file mode 100644 index 000000000..2b90da1c4 --- /dev/null +++ b/lib/next-resource/english/IrregEng.gf @@ -0,0 +1,181 @@ +--# -path=.:prelude:../abstract:../common + +concrete IrregEng of IrregEngAbs = CatEng ** open ParadigmsEng in { + +flags optimize=values ; + + lin + awake_V = irregV "awake" "awoke" "awoken" ; + bear_V = irregV "bear" "bore" "born" ; + beat_V = irregV "beat" "beat" "beat" ; + become_V = irregV "become" "became" "become" ; + begin_V = irregV "begin" "began" "begun" ; + bend_V = irregV "bend" "bent" "bent" ; + beset_V = irregV "beset" "beset" "beset" ; + bet_V = irregDuplV "bet" "bet" "bet" ; + bid_V = irregDuplV "bid" (variants {"bid" ; "bade"}) (variants {"bid" ; "bidden"}) ; + bind_V = irregV "bind" "bound" "bound" ; + bite_V = irregV "bite" "bit" "bitten" ; + bleed_V = irregV "bleed" "bled" "bled" ; + blow_V = irregV "blow" "blew" "blown" ; + break_V = irregV "break" "broke" "broken" ; + breed_V = irregV "breed" "bred" "bred" ; + bring_V = irregV "bring" "brought" "brought" ; + broadcast_V = irregV "broadcast" "broadcast" "broadcast" ; + build_V = irregV "build" "built" "built" ; + burn_V = irregV "burn" (variants {"burned" ; "burnt"}) (variants {"burned" ; "burnt"}) ; + burst_V = irregV "burst" "burst" "burst" ; + buy_V = irregV "buy" "bought" "bought" ; + cast_V = irregV "cast" "cast" "cast" ; + catch_V = irregV "catch" "caught" "caught" ; + choose_V = irregV "choose" "chose" "chosen" ; + cling_V = irregV "cling" "clung" "clung" ; + come_V = irregV "come" "came" "come" ; + cost_V = irregV "cost" "cost" "cost" ; + creep_V = irregV "creep" "crept" "crept" ; + cut_V = irregDuplV "cut" "cut" "cut" ; + deal_V = irregV "deal" "dealt" "dealt" ; + dig_V = irregDuplV "dig" "dug" "dug" ; + dive_V = irregV "dive" (variants {"dived" ; "dove"}) "dived" ; + do_V = mk5V "do" "does" "did" "done" "doing" ; + draw_V = irregV "draw" "drew" "drawn" ; + dream_V = irregV "dream" (variants {"dreamed" ; "dreamt"}) (variants {"dreamed" ; "dreamt"}) ; + drive_V = irregV "drive" "drove" "driven" ; + drink_V = irregV "drink" "drank" "drunk" ; + eat_V = irregV "eat" "ate" "eaten" ; + fall_V = irregV "fall" "fell" "fallen" ; + feed_V = irregV "feed" "fed" "fed" ; + feel_V = irregV "feel" "felt" "felt" ; + fight_V = irregV "fight" "fought" "fought" ; + find_V = irregV "find" "found" "found" ; + fit_V = irregDuplV "fit" "fit" "fit" ; + flee_V = irregV "flee" "fled" "fled" ; + fling_V = irregV "fling" "flung" "flung" ; + fly_V = irregV "fly" "flew" "flown" ; + forbid_V = irregDuplV "forbid" "forbade" "forbidden" ; + forget_V = irregDuplV "forget" "forgot" "forgotten" ; + forgive_V = irregV "forgive" "forgave" "forgiven" ; + forsake_V = irregV "forsake" "forsook" "forsaken" ; + freeze_V = irregV "freeze" "froze" "frozen" ; + get_V = irregDuplV "get" "got" "gotten" ; + give_V = irregV "give" "gave" "given" ; + go_V = mk5V "go" "goes" "went" "gone" "going" ; + grind_V = irregV "grind" "ground" "ground" ; + grow_V = irregV "grow" "grew" "grown" ; + hang_V = irregV "hang" "hung" "hung" ; + have_V = mk5V "have" "has" "had" "had" "having" ; + hear_V = irregV "hear" "heard" "heard" ; + hide_V = irregV "hide" "hid" "hidden" ; + hit_V = irregDuplV "hit" "hit" "hit" ; + hold_V = irregV "hold" "held" "held" ; + hurt_V = irregV "hurt" "hurt" "hurt" ; + keep_V = irregV "keep" "kept" "kept" ; + kneel_V = irregV "kneel" "knelt" "knelt" ; + knit_V = irregDuplV "knit" "knit" "knit" ; + know_V = irregV "know" "knew" "know" ; + lay_V = irregV "lay" "laid" "laid" ; + lead_V = irregV "lead" "led" "led" ; + leap_V = irregV "leap" (variants {"leaped" ; "lept"}) (variants {"leaped" ; "lept"}) ; + learn_V = irregV "learn" (variants {"learned" ; "learnt"}) (variants {"learned" ; "learnt"}) ; + leave_V = irregV "leave" "left" "left" ; + lend_V = irregV "lend" "lent" "lent" ; + let_V = irregDuplV "let" "let" "let" ; + lie_V = irregV "lie" "lay" "lain" ; + light_V = irregV "light" (variants {"lighted" ; "lit"}) "lighted" ; + lose_V = irregV "lose" "lost" "lost" ; + make_V = irregV "make" "made" "made" ; + mean_V = irregV "mean" "meant" "meant" ; + meet_V = irregV "meet" "met" "met" ; + misspell_V = irregV "misspell" (variants {"misspelled" ; "misspelt"}) (variants {"misspelled" ; "misspelt"}) ; + mistake_V = irregV "mistake" "mistook" "mistaken" ; + mow_V = irregV "mow" "mowed" (variants {"mowed" ; "mown"}) ; + overcome_V = irregV "overcome" "overcame" "overcome" ; + overdo_V = mk5V "overdo" "overdoes" "overdid" "overdone" "overdoing" ; + overtake_V = irregV "overtake" "overtook" "overtaken" ; + overthrow_V = irregV "overthrow" "overthrew" "overthrown" ; + pay_V = irregV "pay" "paid" "paid" ; + plead_V = irregV "plead" "pled" "pled" ; + prove_V = irregV "prove" "proved" (variants {"proved" ; "proven"}) ; + put_V = irregDuplV "put" "put" "put" ; + quit_V = irregDuplV "quit" "quit" "quit" ; + read_V = irregV "read" "read" "read" ; + rid_V = irregDuplV "rid" "rid" "rid" ; + ride_V = irregV "ride" "rode" "ridden" ; + ring_V = irregV "ring" "rang" "rung" ; + rise_V = irregV "rise" "rose" "risen" ; + run_V = irregDuplV "run" "ran" "run" ; + saw_V = irregV "saw" "sawed" (variants {"sawed" ; "sawn"}) ; + say_V = irregV "say" "said" "said" ; + see_V = irregV "see" "saw" "seen" ; + seek_V = irregV "seek" "sought" "sought" ; + sell_V = irregV "sell" "sold" "sold" ; + send_V = irregV "send" "sent" "sent" ; + set_V = irregDuplV "set" "set" "set" ; + sew_V = irregV "sew" "sewed" (variants {"sewed" ; "sewn"}) ; + shake_V = irregV "shake" "shook" "shaken" ; + shave_V = irregV "shave" "shaved" (variants {"shaved" ; "shaven"}) ; + shear_V = irregV "shear" "shore" "shorn" ; + shed_V = irregDuplV "shed" "shed" "shed" ; + shine_V = irregV "shine" "shone" "shone" ; + shoe_V = irregV "shoe" "shoed" (variants {"shoed" ; "shod"}) ; + shoot_V = irregV "shoot" "shot" "shot" ; + show_V = irregV "show" "showed" (variants {"showed" ; "shown"}) ; + shrink_V = irregV "shrink" "shrank" "shrunk" ; + shut_V = irregDuplV "shut" "shut" "shut" ; + sing_V = irregV "sing" "sang" "sung" ; + sink_V = irregV "sink" "sank" "sunk" ; + sit_V = irregDuplV "sit" "sat" "sat" ; + sleep_V = irregV "sleep" "slept" "slept" ; + slay_V = irregV "slay" "slew" "slain" ; + slide_V = irregV "slide" "slid" "slid" ; + sling_V = irregV "sling" "slung" "slung" ; + slit_V = irregDuplV "slit" "slit" "slit" ; + smite_V = irregV "smite" "smote" "smitten" ; + sow_V = irregV "sow" "sowed" (variants {"sowed" ; "sown"}) ; + speak_V = irregV "speak" "spoke" "spoken" ; + speed_V = irregV "speed" "sped" "sped" ; + spend_V = irregV "spend" "spent" "spent" ; + spill_V = irregV "spill" (variants {"spilled" ; "spilt"}) (variants {"spilled" ; "spilt"}) ; + spin_V = irregDuplV "spin" "spun" "spun" ; + spit_V = irregDuplV "spit" (variants {"spit" ; "spat"}) "spit" ; + split_V = irregDuplV "split" "split" "split" ; + spread_V = irregV "spread" "spread" "spread" ; + spring_V = irregV "spring" (variants {"sprang" ; "sprung"}) "sprung" ; + stand_V = irregV "stand" "stood" "stood" ; + steal_V = irregV "steal" "stole" "stolen" ; + stick_V = irregV "stick" "stuck" "stuck" ; + sting_V = irregV "sting" "stung" "stung" ; + stink_V = irregV "stink" "stank" "stunk" ; + stride_V = irregV "stride" "strod" "stridden" ; + strike_V = irregV "strike" "struck" "struck" ; + string_V = irregV "string" "strung" "strung" ; + strive_V = irregV "strive" "strove" "striven" ; + swear_V = irregV "swear" "swore" "sworn" ; + sweep_V = irregV "sweep" "swept" "swept" ; + swell_V = irregV "swell" "swelled" (variants {"swelled" ; "swollen"}) ; + swim_V = irregDuplV "swim" "swam" "swum" ; + swing_V = irregV "swing" "swung" "swung" ; + take_V = irregV "take" "took" "taken" ; + teach_V = irregV "teach" "taught" "taught" ; + tear_V = irregV "tear" "tore" "torn" ; + tell_V = irregV "tell" "told" "told" ; + think_V = irregV "think" "thought" "thought" ; + thrive_V = irregV "thrive" (variants {"thrived" ; "throve"}) "thrived" ; + throw_V = irregV "throw" "threw" "thrown" ; + thrust_V = irregV "thrust" "thrust" "thrust" ; + tread_V = irregV "tread" "trod" "trodden" ; + understand_V = irregV "understand" "understood" "understood" ; + uphold_V = irregV "uphold" "upheld" "upheld" ; + upset_V = irregDuplV "upset" "upset" "upset" ; + wake_V = irregV "wake" "woke" "woken" ; + wear_V = irregV "wear" "wore" "worn" ; + weave_V = irregV "weave" (variants {"weaved" ; "wove"}) (variants {"weaved" ; "woven"}) ; + wed_V = irregDuplV "wed" "wed" "wed" ; + weep_V = irregV "weep" "wept" "wept" ; + wind_V = irregV "wind" "wound" "wound" ; + win_V = irregDuplV "win" "won" "won" ; + withhold_V = irregV "withhold" "withheld" "withheld" ; + withstand_V = irregV "withstand" "withstood" "withstood" ; + wring_V = irregV "wring" "wrung" "wrung" ; + write_V = irregV "write" "wrote" "written" ; +} diff --git a/lib/next-resource/english/IrregEngAbs.gf b/lib/next-resource/english/IrregEngAbs.gf new file mode 100644 index 000000000..103fe3278 --- /dev/null +++ b/lib/next-resource/english/IrregEngAbs.gf @@ -0,0 +1,176 @@ +abstract IrregEngAbs = Cat ** { +fun + awake_V : V ; + bear_V : V ; + beat_V : V ; + become_V : V ; + begin_V : V ; + bend_V : V ; + beset_V : V ; + bet_V : V ; + bid_V : V ; + bind_V : V ; + bite_V : V ; + bleed_V : V ; + blow_V : V ; + break_V : V ; + breed_V : V ; + bring_V : V ; + broadcast_V : V ; + build_V : V ; + burn_V : V ; + burst_V : V ; + buy_V : V ; + cast_V : V ; + catch_V : V ; + choose_V : V ; + cling_V : V ; + come_V : V ; + cost_V : V ; + creep_V : V ; + cut_V : V ; + deal_V : V ; + dig_V : V ; + dive_V : V ; + do_V : V ; + draw_V : V ; + dream_V : V ; + drive_V : V ; + drink_V : V ; + eat_V : V ; + fall_V : V ; + feed_V : V ; + feel_V : V ; + fight_V : V ; + find_V : V ; + fit_V : V ; + flee_V : V ; + fling_V : V ; + fly_V : V ; + forbid_V : V ; + forget_V : V ; + forgive_V : V ; + forsake_V : V ; + freeze_V : V ; + get_V : V ; + give_V : V ; + go_V : V ; + grind_V : V ; + grow_V : V ; + hang_V : V ; + have_V : V ; + hear_V : V ; + hide_V : V ; + hit_V : V ; + hold_V : V ; + hurt_V : V ; + keep_V : V ; + kneel_V : V ; + knit_V : V ; + know_V : V ; + lay_V : V ; + lead_V : V ; + leap_V : V ; + learn_V : V ; + leave_V : V ; + lend_V : V ; + let_V : V ; + lie_V : V ; + light_V : V ; + lose_V : V ; + make_V : V ; + mean_V : V ; + meet_V : V ; + misspell_V : V ; + mistake_V : V ; + mow_V : V ; + overcome_V : V ; + overdo_V : V ; + overtake_V : V ; + overthrow_V : V ; + pay_V : V ; + plead_V : V ; + prove_V : V ; + put_V : V ; + quit_V : V ; + read_V : V ; + rid_V : V ; + ride_V : V ; + ring_V : V ; + rise_V : V ; + run_V : V ; + saw_V : V ; + say_V : V ; + see_V : V ; + seek_V : V ; + sell_V : V ; + send_V : V ; + set_V : V ; + sew_V : V ; + shake_V : V ; + shave_V : V ; + shear_V : V ; + shed_V : V ; + shine_V : V ; + shoe_V : V ; + shoot_V : V ; + show_V : V ; + shrink_V : V ; + shut_V : V ; + sing_V : V ; + sink_V : V ; + sit_V : V ; + sleep_V : V ; + slay_V : V ; + slide_V : V ; + sling_V : V ; + slit_V : V ; + smite_V : V ; + sow_V : V ; + speak_V : V ; + speed_V : V ; + spend_V : V ; + spill_V : V ; + spin_V : V ; + spit_V : V ; + split_V : V ; + spread_V : V ; + spring_V : V ; + stand_V : V ; + steal_V : V ; + stick_V : V ; + sting_V : V ; + stink_V : V ; + stride_V : V ; + strike_V : V ; + string_V : V ; + strive_V : V ; + swear_V : V ; + sweep_V : V ; + swell_V : V ; + swim_V : V ; + swing_V : V ; + take_V : V ; + teach_V : V ; + tear_V : V ; + tell_V : V ; + think_V : V ; + thrive_V : V ; + throw_V : V ; + thrust_V : V ; + tread_V : V ; + understand_V : V ; + uphold_V : V ; + upset_V : V ; + wake_V : V ; + wear_V : V ; + weave_V : V ; + wed_V : V ; + weep_V : V ; + wind_V : V ; + win_V : V ; + withhold_V : V ; + withstand_V : V ; + wring_V : V ; + write_V : V ; +} diff --git a/lib/next-resource/english/LangEng.gf b/lib/next-resource/english/LangEng.gf new file mode 100644 index 000000000..966308a2b --- /dev/null +++ b/lib/next-resource/english/LangEng.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common:prelude + +concrete LangEng of Lang = + GrammarEng, + LexiconEng + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/english/LexiconEng.gf b/lib/next-resource/english/LexiconEng.gf new file mode 100644 index 000000000..a92058c90 --- /dev/null +++ b/lib/next-resource/english/LexiconEng.gf @@ -0,0 +1,375 @@ +--# -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" "worse" "worst" "badly" ; + bank_N = regN "bank" ; + beautiful_A = compoundADeg (regA "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 = mkN human (regN "boss") ; + boy_N = mkN masculine (regN "boy") ; + bread_N = regN "bread" ; + break_V2 = dirV2 (irregV "break" "broke" "broken") ; + broad_A = regADeg "broad" ; + brother_N2 = mkN2 (mkN masculine (mkN "brother")) (mkPrep "of") ; + 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 = mkN human (regN "cousin") ; + cow_N = regN "cow" ; + die_V = (regV "die") ; + dirty_A = regADeg "dirty" ; + distance_N3 = mkN3 (regN "distance") fromP toP ; + doctor_N = mkN human (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 = mkN2 (mkN masculine (mkN "father")) (mkPrep "of") ; + 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 = mkN human (regN "friend") ; + fruit_N = regN "fruit" ; + fun_AV = mkAV (regA "fun") ; + garden_N = regN "garden" ; + girl_N = mkN feminine (regN "girl") ; + glove_N = regN "glove" ; + gold_N = regN "gold" ; + good_A = mkADeg "good" "better" "best" "well" ; + go_V = mk5V "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 (mk5V "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 = mkN masculine (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 = prepV2 (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 = mkN masculine (mk2N "man" "men") ; + married_A2 = mkA2 (regA "married") toP ; + meat_N = regN "meat" ; + milk_N = regN "milk" ; + moon_N = regN "moon" ; + mother_N2 = mkN2 (mkN feminine (mkN "mother")) (mkPrep "of") ; + 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 = mkPN (mkN nonhuman (mkN "Paris")) ; + peace_N = regN "peace" ; + pen_N = regN "pen" ; + planet_N = regN "planet" ; + plastic_N = regN "plastic" ; + play_V2 = dirV2 (regV "play") ; + policeman_N = mkN masculine (mkN "policeman" "policemen") ; + priest_N = mkN human (regN "priest") ; + probable_AS = mkAS (regA "probable") ; + queen_N = mkN feminine (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 = mkN2 (mkN feminine (mkN "sister")) (mkPrep "of") ; + 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 = mkN human (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 = mkN human (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 = prepV2 (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 = mkN feminine (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 (mk5V "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 = prepV2 (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 = mkN 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 = mkN 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 = mkN feminine (mk2N "wife" "wives") ; + wind_N = regN "wind" ; + wing_N = regN "wing" ; + worm_N = regN "worm" ; + year_N = regN "year" ; + blow_V = IrregEng.blow_V ; + breathe_V = dirV2 (regV "breathe") ; + burn_V = IrregEng.burn_V ; + dig_V = IrregEng.dig_V ; + fall_V = IrregEng.fall_V ; + float_V = regV "float" ; + flow_V = regV "flow" ; + fly_V = IrregEng.fly_V ; + freeze_V = IrregEng.freeze_V ; + give_V3 = dirV3 give_V toP ; + laugh_V = regV "laugh" ; + lie_V = IrregEng.lie_V ; + play_V = regV "play" ; + sew_V = IrregEng.sew_V ; + sing_V = IrregEng.sing_V ; + sit_V = IrregEng.sit_V ; + smell_V = regV "smell" ; + spit_V = IrregEng.spit_V ; + stand_V = IrregEng.stand_V ; + swell_V = IrregEng.swell_V ; + swim_V = IrregEng.swim_V ; + think_V = IrregEng.think_V ; + turn_V = regV "turn" ; + vomit_V = regV "vomit" ; + + bite_V2 = dirV2 IrregEng.bite_V ; + count_V2 = dirV2 (regV "count") ; + cut_V2 = dirV2 IrregEng.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" ; + +-- added 4/6/2007 + john_PN = mkPN (mkN masculine (mkN "John")) ; + question_N = regN "question" ; + ready_A = regA "ready" ; + reason_N = regN "reason" ; + today_Adv = mkAdv "today" ; + uncertain_A = regA "uncertain" ; + +oper + aboutP = mkPrep "about" ; + atP = mkPrep "at" ; + forP = mkPrep "for" ; + fromP = mkPrep "from" ; + inP = mkPrep "in" ; + onP = mkPrep "on" ; + toP = mkPrep "to" ; + +} ; diff --git a/lib/next-resource/english/MorphoEng.gf b/lib/next-resource/english/MorphoEng.gf new file mode 100644 index 000000000..4c11bbd35 --- /dev/null +++ b/lib/next-resource/english/MorphoEng.gf @@ -0,0 +1,197 @@ +--# -path=.:../../prelude + +--1 A Simple English Resource Morphology +-- +-- Aarne Ranta 2002 -- 2005 +-- +-- This resource morphology contains definitions needed in the resource +-- syntax. To build a lexicon, it is better to use $ParadigmsEng$, which +-- gives a higher-level access to this module. + +resource MorphoEng = ResEng ** open Prelude, (Predef=Predef) in { + + flags optimize=all ; + +--2 Phonology +-- +-- To regulate the use of endings for both nouns, adjectives, and verbs: + +oper + y2ie : Str -> Str -> Str = \fly,s -> + let y = last (init fly) in + case y of { + "a" => fly + s ; + "e" => fly + s ; + "o" => fly + s ; + "u" => fly + s ; + _ => init fly + "ie" + s + } ; + + +--2 Nouns +-- +-- For conciseness and abstraction, we define a worst-case macro for +-- noun inflection. It is used for defining special case that +-- only need one string as argument. + +oper + CommonNoun : Type = {s : Number => Case => Str} ; + + nounGen : Str -> CommonNoun = \dog -> case last dog of { + "y" => nounY "dog" ; + "s" => nounS (init "dog") ; + _ => 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 -> {s : Case => Str} = \john,g -> + {s = table {Gen => john + "'s" ; _ => john} ; g = g} ; + +--2 Determiners + + mkDeterminer : Number -> Str -> {s,sp : Str ; n : Number} = \n,s -> + {s,sp = s ; n = n} ; + +--2 Pronouns +-- +-- Here we define personal pronouns. +-- +-- We record the form "mine" and the gender for later use. + + Pronoun : Type = + {s : Case => Str ; a : Agr} ; + + mkPronoun : (_,_,_,_ : Str) -> Number -> Person -> Gender -> Pronoun = + \I,me,my,mine,n,p,g -> + {s = table {Nom => I ; Acc => me ; Gen => my} ; + a = toAgr n p 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 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 ; + + pronWe = mkPronoun "we" "us" "our" "ours" Pl P1 human ; + pronYouPl = mkPronoun "you" "you" "your" "yours" Pl P2 human ; + pronThey = mkPronoun "they" "them" "their" "theirs" Pl P3 human ; --- + + +--2 Adjectives +-- +-- To form the adjectival and the adverbial forms, two strings are needed +-- in the worst case. (First without degrees.) + + 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 + 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 -> Adjective = \ridiculous -> + mkAdjective + ridiculous + ("more" ++ ridiculous) + ("most" ++ ridiculous) + ((regAdjective ridiculous).s ! AAdv) ; + + +--3 Verbs +-- +-- The worst case needs five forms. (The verb "be" is treated separately.) + + mkVerb4 : (_,_,_,_: Str) -> Verb = \go,goes,went,gone -> + let going = case last go of { + "e" => init go + "ing" ; + _ => go + "ing" + } + in + mkVerb go goes went gone going ; + +-- This is what we use to derive the irregular forms in almost all cases + + mkVerbIrreg : (_,_,_ : Str) -> Verb = \bite,bit,bitten -> + let bites = case last bite of { + "y" => y2ie bite "s" ; + "s" => init bite + "es" ; + _ => bite + "s" + } + in mkVerb4 bite bites bit bitten ; + +-- This is used to derive regular forms. + + mkVerbReg : Str -> Verb = \soak -> + let + soaks = case last soak of { + "y" => y2ie soak "s" ; + "s" => init soak + "es" ; + _ => soak + "s" + } ; + soaked = case last soak of { + "e" => init soak + "s" ; + _ => soak + "ed" + } + in + mkVerb4 soak soaks soaked soaked ; + + verbGen : Str -> Verb = \kill -> case last kill of { + "y" => verbP3y (init kill) ; + "e" => verbP3e (init kill) ; + "s" => verbP3s (init kill) ; + _ => regVerbP3 kill + } ; + +-- These are just auxiliary to $verbGen$. + + 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") ; + +--- The particle always appears right after the verb. + + verbPart : Verb -> Str -> Verb = \v,p -> + {s = \\f => v.s ! f ++ p ; isRefl = v.isRefl} ; + + verbNoPart : Verb -> Verb = \v -> verbPart v [] ; + + +} ; + diff --git a/lib/next-resource/english/NounEng.gf b/lib/next-resource/english/NounEng.gf new file mode 100644 index 000000000..18ceeaa22 --- /dev/null +++ b/lib/next-resource/english/NounEng.gf @@ -0,0 +1,135 @@ +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 = agrgP3 det.n cn.g + } ; + + UsePN pn = pn ** {a = agrgP3 Sg pn.g} ; + 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 + } ; + + RelNP np rs = { + s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; + a = np.a + } ; + + AdvNP np adv = { + s = \\c => np.s ! c ++ adv.s ; + a = np.a + } ; + + DetQuantOrd quant num ord = { + s = quant.s ! num.hasCard ! num.n ++ num.s ++ ord.s ; + sp = quant.sp ! num.hasCard ! num.n ++ num.s ++ ord.s ; + n = num.n + } ; + + DetQuant quant num = { + s = quant.s ! num.hasCard ! num.n ++ num.s ; + sp = quant.sp ! num.hasCard ! num.n ++ num.s ; + n = num.n + } ; + + DetNP det = { + s = \\c => det.sp ; ---- case + a = agrP3 det.n + } ; + + PossPron p = { + s = \\_,_ => p.s ! Gen ; + sp = \\_,_ => p.sp + } ; + + NumSg = {s = []; n = Sg ; hasCard = False} ; + NumPl = {s = []; n = Pl ; hasCard = False} ; +---b NoOrd = {s = []} ; + + NumCard n = n ** {hasCard = True} ; + + NumDigits n = {s = n.s ! NCard ; n = n.n} ; + OrdDigits n = {s = n.s ! NOrd} ; + + NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ; + OrdNumeral numeral = {s = numeral.s ! NOrd} ; + + AdNum adn num = {s = adn.s ++ num.s ; n = num.n} ; + + OrdSuperl a = {s = a.s ! AAdj Superl} ; + + DefArt = { + s = \\c,n => artDef ; + sp = \\c,n => case of { + => "it" ; + => "they" ; + _ => artDef + } + } ; + + IndefArt = { + s = \\c,n => case of { + => artIndef ; + _ => [] + } ; + sp = \\c,n => case of { + => "one" ; + => "ones" ; + _ => [] + } + } ; + + MassNP cn = { + s = cn.s ! Sg ; + a = agrP3 Sg + } ; + + UseN n = n ; + UseN2 n = n ; +---b UseN3 n = n ; + + Use2N3 f = { + s = \\n,c => f.s ! n ! Nom ; + g = f.g ; + c2 = f.c2 + } ; + + Use3N3 f = { + s = \\n,c => f.s ! n ! Nom ; + g = f.g ; + c2 = f.c3 + } ; + + ComplN2 f x = {s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; g = f.g} ; + ComplN3 f x = { + s = \\n,c => f.s ! n ! Nom ++ f.c2 ++ x.s ! c ; + g = f.g ; + c2 = f.c3 + } ; + + AdjCN ap cn = { + s = \\n,c => preOrPost ap.isPre (ap.s ! agrgP3 n cn.g) (cn.s ! n ! c) ; + g = cn.g + } ; + RelCN cn rs = { + s = \\n,c => cn.s ! n ! c ++ rs.s ! agrgP3 n cn.g ; + g = cn.g + } ; + AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s ; g = cn.g} ; + + SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s ; g = cn.g} ; + + ApposCN cn np = {s = \\n,c => cn.s ! n ! Nom ++ np.s ! c ; g = cn.g} ; + +} diff --git a/lib/next-resource/english/NumeralEng.gf b/lib/next-resource/english/NumeralEng.gf new file mode 100644 index 000000000..2f7c8e553 --- /dev/null +++ b/lib/next-resource/english/NumeralEng.gf @@ -0,0 +1,95 @@ +concrete NumeralEng of Numeral = CatEng ** open ResEng in { + +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} ; + Sub1000000 = {s : CardOrd => Str ; n : Number} ; + +lin num x = x ; +lin n2 = let two = mkNum "two" "twelve" "twenty" "second" in + {s = \\f,c => case of { + => "twelfth" ; + _ => two.s ! f ! c + } + } ; + +lin n3 = mkNum "three" "thirteen" "thirty" "third" ; +lin n4 = mkNum "four" "fourteen" "forty" "fourth" ; +lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ; +lin n6 = regNum "six" ; +lin n7 = regNum "seven" ; +lin n8 = mkNum "eight" "eighteen" "eighty" "eighth" ; +lin n9 = mkNum "nine" "nineteen" "ninety" "ninth" ; + +lin pot01 = mkNum "one" "eleven" "ten" "first" ** {n = Sg} ; +lin pot0 d = d ** {n = Pl} ; +lin pot110 = regCardOrd "ten" ** {n = Pl} ; +lin pot111 = regCardOrd "eleven" ** {n = Pl} ; +lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ; +lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ; +lin pot1 d = {s = d.s ! ten} ** {n = Pl} ; +lin pot1plus d e = { + s = \\c => d.s ! ten ! NCard ++ "-" ++ e.s ! unit ! c ; n = Pl} ; +lin pot1as2 n = n ; +lin pot2 d = {s = \\c => d.s ! unit ! NCard ++ mkCard c "hundred"} ** {n = Pl} ; +lin pot2plus d e = { + s = \\c => d.s ! unit ! NCard ++ "hundred" ++ "and" ++ e.s ! c ; n = Pl} ; +lin pot2as3 n = n ; +lin pot3 n = { + s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ; +lin pot3plus n m = { + s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ; + +-- numerals as sequences of digits + + lincat + Dig = TDigit ; + + lin + IDig d = d ** {tail = T1} ; + + IIDig d i = { + s = \\o => d.s ! NCard ++ commaIf i.tail ++ i.s ! o ; + n = Pl ; + tail = inc i.tail + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1st" Sg ; + D_2 = mk2Dig "2" "2nd" ; + D_3 = mk2Dig "3" "3rd" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + commaIf : DTail -> Str = \t -> case t of { + T3 => "," ; + _ => [] + } ; + + inc : DTail -> DTail = \t -> case t of { + T1 => T2 ; + T2 => T3 ; + T3 => T1 + } ; + + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard => c ; NOrd => o} ; + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + +} diff --git a/lib/next-resource/english/OverloadEng.gf b/lib/next-resource/english/OverloadEng.gf new file mode 100644 index 000000000..90d365c7b --- /dev/null +++ b/lib/next-resource/english/OverloadEng.gf @@ -0,0 +1 @@ +resource OverloadEng = Overload with (Grammar = GrammarEng) ; diff --git a/lib/next-resource/english/ParadigmsEng.gf b/lib/next-resource/english/ParadigmsEng.gf new file mode 100644 index 000000000..9ce081457 --- /dev/null +++ b/lib/next-resource/english/ParadigmsEng.gf @@ -0,0 +1,577 @@ +--# -path=.:../abstract:../../prelude:../common + +--1 English Lexical Paradigms +-- +-- Aarne Ranta 2003--2005 +-- +-- 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. +-- +-- 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 structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- 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 [``IrregEng`` ../../english/IrregEng.gf], +-- which covers irregular verbss. + +resource ParadigmsEng = open + (Predef=Predef), + Prelude, + MorphoEng, + CatEng + in { +--2 Parameters +-- +-- To abstract over gender names, we define the following identifiers. + +oper + Gender : Type ; + + human : Gender ; + nonhuman : Gender ; + masculine : Gender ; + feminine : 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 ; + +-- Prepositions are used in many-argument functions for rection. +-- The resource category $Prep$ is used. + + + +--2 Nouns + +-- Nouns are constructed by the function $mkN$, which takes a varying +-- number of arguments. + + mkN : overload { + +-- The regular function captures the variants for nouns ending with +-- "s","sh","x","z" or "y": "kiss - kisses", "flash - flashes"; +-- "fly - flies" (but "toy - toys"), + + mkN : (flash : Str) -> N ; + +-- In practice the worst case is to give singular and plural nominative. + + mkN : (man,men : Str) -> N ; + +-- The theoretical worst case: give all four forms. + + mkN : (man,men,man's,men's : Str) -> N ; + +-- Change gender from the default $nonhuman$. + + mkN : Gender -> N -> N ; + +--3 Compound nouns +-- +-- A compound noun is an uninflected string attached to an inflected noun, +-- such as "baby boom", "chief executive officer". + + mkN : Str -> N -> N + } ; + + +--3 Relational nouns +-- +-- Relational nouns ("daughter of x") need a preposition. + + mkN2 : N -> Prep -> N2 ; + +-- The most common preposition is "of", and the following is a +-- shortcut for regular relational nouns with "of". + + regN2 : Str -> N2 ; + +-- 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 -> Prep -> Prep -> N3 ; + + + +--3 Proper names and noun phrases +-- +-- Proper names, with a regular genitive, are formed from strings. + + mkPN : overload { + + mkPN : Str -> PN ; + +-- Sometimes a common noun can be reused as a proper name, e.g. "Bank" + + mkPN : N -> PN + } ; + + +--2 Adjectives + + mkA : overload { + +-- For regular adjectives, the adverbial and comparison forms are derived. This holds +-- even for cases with the variations "happy - happily - happier - happiest", +-- "free - freely - freer - freest", and "rude - rudest". + + mkA : (happy : Str) -> A ; + +-- However, the duplication of the final consonant cannot be predicted, +-- but a separate case is used to give the comparative + + mkA : (fat,fatter : Str) -> A ; + +-- As many as four forms may be needed. + + mkA : (good,better,best,well : Str) -> A + } ; + +-- To force comparison to be formed by "more - most", +-- the following function is used: + + compoundA : A -> A ; -- -/more/most ridiculous + + + +--3 Two-place adjectives +-- +-- Two-place adjectives need a preposition for their second argument. + + mkA2 : A -> Prep -> A2 ; + + + +--2 Adverbs + +-- Adverbs are not inflected. Most lexical ones have position +-- after the verb. Some can be preverbal (e.g. "always"). + + mkAdv : Str -> Adv ; + mkAdV : Str -> AdV ; + +-- Adverbs modifying adjectives and sentences can also be formed. + + mkAdA : Str -> AdA ; + +--2 Prepositions +-- +-- A preposition as used for rection in the lexicon, as well as to +-- build $PP$s in the resource API, just requires a string. + + mkPrep : Str -> Prep ; + noPrep : Prep ; + +-- (These two functions are synonyms.) + +--2 Verbs +-- + +-- Verbs are constructed by the function $mkV$, which takes a varying +-- number of arguments. + + mkV : overload { + +-- The regular verb function recognizes the special cases where the last +-- character is "y" ("cry-cries" but "buy-buys") or a sibilant +-- ("kiss-"kisses", "jazz-jazzes", "rush-rushes", "munch - munches", +-- "fix - fixes"). + + mkV : (cry : Str) -> V ; + +-- Give the present and past forms for regular verbs where +-- the last letter is duplicated in some forms, +-- e.g. "rip - ripped - ripping". + + mkV : (stop, stopped : Str) -> V ; + +-- There is an extensive list of irregular verbs in the module $IrregularEng$. +-- In practice, it is enough to give three forms, +-- e.g. "drink - drank - drunk". + + mkV : (drink, drank, drunk : Str) -> V ; + +-- Irregular verbs with duplicated consonant in the present participle. + + mkV : (run, ran, run, running : Str) -> V ; + +-- Except for "be", the worst case needs five forms: the infinitive and +-- the third person singular present, the past indicative, and the +-- past and present participles. + + mkV : (go, goes, went, gone, going : Str) -> V + }; + +-- Verbs with a particle. +-- The particle, such as in "switch on", is given as a string. + + partV : V -> Str -> V ; + +-- 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 : overload { + mkV2 : V -> Prep -> V2 ; -- believe in + mkV2 : V -> V2 -- kill + }; + +--3 Three-place verbs +-- +-- Three-place (ditransitive) verbs need two prepositions, of which +-- the first one or both can be absent. + + mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about + dirV3 : V -> Prep -> V3 ; -- give,_,to + dirdirV3 : V -> V3 ; -- give,_,_ + +--3 Other complement patterns +-- +-- Verbs and adjectives can take complements such as sentences, +-- questions, verb phrases, and adjectives. + + mkV0 : V -> V0 ; + mkVS : V -> VS ; + mkV2S : V -> Prep -> V2S ; + mkVV : V -> VV ; + mkV2V : V -> Prep -> Prep -> V2V ; + mkVA : V -> VA ; + mkV2A : V -> Prep -> V2A ; + mkVQ : V -> VQ ; + mkV2Q : V -> Prep -> V2Q ; + + mkAS : A -> AS ; + mkA2S : A -> Prep -> A2S ; + mkAV : A -> AV ; + mkA2V : A -> Prep -> A2V ; + +-- Notice: Categories $V0, AS, A2S, AV, A2V$ are just $A$. +-- $V0$ is just $V$; the second argument is treated as adverb. + + V0 : 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 = MorphoEng.Gender ; + Number = MorphoEng.Number ; + Case = MorphoEng.Case ; + human = Masc ; + nonhuman = Neutr ; + masculine = Masc ; + feminine = Fem ; + singular = Sg ; + plural = Pl ; + nominative = Nom ; + genitive = Gen ; + + Preposition : Type = Str ; -- obsolete + + regN = \ray -> + let rays = add_s ray + in + mk2N ray rays ; + + + add_s : Str -> Str = \w -> case w of { + _ + ("io" | "oo") => w + "s" ; -- radio, bamboo + _ + ("s" | "z" | "x" | "sh" | "ch" | "o") => w + "es" ; -- bus, hero + _ + ("a" | "o" | "u" | "e") + "y" => w + "s" ; -- boy + x + "y" => x + "ies" ; -- fly + _ => w + "s" -- car + } ; + + mk2N = \man,men -> + let mens = case last men of { + "s" => men + "'" ; + _ => men + "'s" + } + in + mk4N man men (man + "'s") mens ; + + mk4N = \man,men,man's,men's -> + mkNoun man man's men men's ** {g = Neutr ; lock_N = <>} ; + + genderN g man = {s = man.s ; g = g ; lock_N = <>} ; + + compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ; + + mkPN = overload { + mkPN : Str -> PN = regPN ; + mkPN : N -> PN = nounPN + } ; + + + 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} ; + +--3 Relational common noun phrases +-- +-- In some cases, you may want to make a complex $CN$ into a +-- relational noun (e.g. "the old town hall of"). + + cnN2 : CN -> Prep -> N2 ; + cnN3 : CN -> Prep -> Prep -> N3 ; + +-- This is obsolete. + 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 ** {g = g ; lock_PN = <>} ; + nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ; + + mk2A a b = mkAdjective a a a b ** {lock_A = <>} ; + regA a = regADeg a ** {lock_A = <>} ; + + mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ; + + ADeg = A ; ---- + + mkADeg a b c d = mkAdjective a b c d ** {lock_A = <>} ; + + regADeg happy = + let + happ = init happy ; + y = last happy ; + happie = case y of { + "y" => happ + "ie" ; + "e" => happy ; + _ => happy + "e" + } ; + happily : Str = case happy of { + _ + "y" => happ + "ily" ; + _ + "ll" => happy + "y" ; + _ => happy + "ly" + } ; + in mkADeg happy (happie + "r") (happie + "st") happily ; + + 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 = <>} ; + + mkPrep p = ss p ** {lock_Prep = <>} ; + noPrep = mkPrep [] ; + + mk5V a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ; + + regV cry = + let + cr = init cry ; + y = last cry ; + cries = (regN cry).s ! Pl ! Nom ; -- ! + crie = init cries ; + cried = case last crie of { + "e" => crie + "d" ; + _ => crie + "ed" + } ; + crying = case y of { + "e" => case last cr of { + "e" => cry + "ing" ; + _ => cr + "ing" + } ; + _ => cry + "ing" + } + in mk5V cry cries cried cried crying ; + + reg2V fit fitted = + let fitt = Predef.tk 2 fitted ; + in mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ; + + regDuplV fit = + case last fit of { + ("a" | "e" | "i" | "o" | "u" | "y") => + Predef.error (["final duplication makes no sense for"] ++ fit) ; + t => + let fitt = fit + t in + mk5V fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") + } ; + + irregV x y z = let reg = (regV x).s in + mk5V x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ; + + irreg4V x y z w = let reg = (regV x).s in + mk5V x (reg ! VPres) y z w ** {s1 = [] ; lock_V = <>} ; + + irregDuplV fit y z = + let + fitting = (regDuplV fit).s ! VPresPart + in + mk5V fit (fit + "s") y z fitting ; + + partV v p = verbPart v p ** {lock_V = <>} ; + reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ; + + prepV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; lock_V2 = <>} ; + dirV2 v = prepV2 v noPrep ; + + 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 ; + + mkVS v = v ** {lock_VS = <>} ; + 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 : Type = V2 ; + AS, A2S, AV : Type = A ; + A2V : Type = A2 ; + + mkV0 v = v ** {lock_V = <>} ; + mkV2S v p = prepV2 v p ** {lock_V2S = <>} ; + mkV2V v p t = prepV2 v p ** {isAux = False ; lock_V2V = <>} ; + mkVA v = v ** {lock_VA = <>} ; + mkV2A v p = prepV2 v p ** {lock_V2A = <>} ; + mkV2Q v p = prepV2 v p ** {lock_V2Q = <>} ; + + 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 = <>} ; + + +-- pre-overload API and overload definitions + + mk4N : (man,men,man's,men's : Str) -> N ; + regN : Str -> N ; + mk2N : (man,men : Str) -> N ; + genderN : Gender -> N -> N ; + compoundN : Str -> N -> N ; + + mkN = overload { + mkN : (man,men,man's,men's : Str) -> N = mk4N ; + mkN : Str -> N = regN ; + mkN : (man,men : Str) -> N = mk2N ; + mkN : Gender -> N -> N = genderN ; + mkN : Str -> N -> N = compoundN + } ; + + + mk2A : (free,freely : Str) -> A ; + regA : Str -> A ; + + mkA = overload { + mkA : Str -> A = regA ; + mkA : (fat,fatter : Str) -> A = \fat,fatter -> + mkAdjective fat fatter (init fatter + "st") (fat + "ly") ** {lock_A = <>} ; + mkA : (good,better,best,well : Str) -> A = \a,b,c,d -> + mkAdjective a b c d ** {lock_A = <>} + } ; + + compoundA = compoundADeg ; + + + mk5V : (go, goes, went, gone, going : Str) -> V ; + regV : (cry : Str) -> V ; + reg2V : (stop, stopped : Str) -> V; + irregV : (drink, drank, drunk : Str) -> V ; + irreg4V : (run, ran, run, running : Str) -> V ; + + -- Use reg2V instead + regDuplV : Str -> V ; + -- Use irreg4V instead + irregDuplV : (get, got, gotten : Str) -> V ; + + mkV = overload { + mkV : (cry : Str) -> V = regV ; + mkV : (stop, stopped : Str) -> V = reg2V ; + mkV : (drink, drank, drunk : Str) -> V = irregV ; + mkV : (run, ran, run, running : Str) -> V = irreg4V ; + mkV : (go, goes, went, gone, going : Str) -> V = mk5V + }; + + prepV2 : V -> Prep -> V2 ; + dirV2 : V -> V2 ; + + mkV2 = overload { + mkV2 : V -> Prep -> V2 = prepV2; + mkV2 : V -> V2 = dirV2 + }; + + +---- obsolete + +-- Comparison adjectives may two more forms. + + ADeg : Type ; + + mkADeg : (good,better,best,well : Str) -> ADeg ; + +-- The regular pattern recognizes two common variations: +-- "-e" ("rude" - "ruder" - "rudest") and +-- "-y" ("happy - happier - happiest - happily") + + regADeg : Str -> ADeg ; -- long, longer, longest + +-- However, the duplication of the final consonant is nor predicted, +-- but a separate pattern is used: + + duplADeg : Str -> ADeg ; -- fat, fatter, fattest + +-- If comparison is formed by "more", "most", as in general for +-- long adjective, the following pattern is used: + + compoundADeg : A -> ADeg ; -- -/more/most ridiculous + +-- From a given $ADeg$, it is possible to get back to $A$. + + adegA : ADeg -> A ; + + + regPN : Str -> PN ; + regGenPN : Str -> Gender -> PN ; -- John, John's + +-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". + + nounPN : N -> PN ; + + + +} ; diff --git a/lib/next-resource/english/PhraseEng.gf b/lib/next-resource/english/PhraseEng.gf new file mode 100644 index 000000000..c635d4b98 --- /dev/null +++ b/lib/next-resource/english/PhraseEng.gf @@ -0,0 +1,24 @@ +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 ! ImpF Sg False} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Pl False} ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! contrNeg True pol.p ! ImpF Sg True} ; + + UttIP ip = {s = ip.s ! Nom} ; --- Acc also + UttIAdv iadv = iadv ; + UttNP np = {s = np.s ! Nom} ; + UttVP vp = {s = infVP False vp (agrP3 Sg)} ; + UttAdv adv = adv ; + + NoPConj = {s = []} ; + PConjConj conj = {s = conj.s2} ; --- + + NoVoc = {s = []} ; + VocNP np = {s = "," ++ np.s ! Nom} ; + +} diff --git a/lib/next-resource/english/QuestionEng.gf b/lib/next-resource/english/QuestionEng.gf new file mode 100644 index 000000000..2fc894932 --- /dev/null +++ b/lib/next-resource/english/QuestionEng.gf @@ -0,0 +1,55 @@ +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) (agrP3 qp.n) 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 ! Acc} ; + + AdvIP ip adv = { + s = \\c => ip.s ! c ++ adv.s ; + n = ip.n + } ; + + IdetCN idet cn = { + s = \\c => idet.s ++ cn.s ! idet.n ! c ; + n = idet.n + } ; + + IdetIP idet = { + s = \\c => idet.s ; + n = idet.n + } ; + + IdetQuant idet num = { + s = idet.s ! num.n ++ num.s ; + n = num.n + } ; + + CompIAdv a = a ; + CompIP p = ss (p.s ! Nom) ; + +} diff --git a/lib/next-resource/english/RelativeEng.gf b/lib/next-resource/english/RelativeEng.gf new file mode 100644 index 000000000..1ec1fc10a --- /dev/null +++ b/lib/next-resource/english/RelativeEng.gf @@ -0,0 +1,54 @@ +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 (fromAgr agr).g 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,agr => + slash.c2 ++ rp.s ! RPrep (fromAgr agr).g ++ slash.s ! t ! a ! p ! ODir ; + c = Acc + } ; + + FunRP p np rp = { + s = \\c => np.s ! Acc ++ p.s ++ rp.s ! RPrep (fromAgr np.a).g ; + a = RAg np.a + } ; + + IdRP = + let varr : Str -> Str = \x -> variants {x ; "that"} --- for bwc + in { + s = table { + RC _ Gen => "whose" ; + RC Neutr _ => varr "which" ; + RC _ Acc => varr "whom" ; + RC _ Nom => varr "who" ; + RPrep Neutr => "which" ; + RPrep _ => "whom" + } ; + a = RNoAg + } ; + +} diff --git a/lib/next-resource/english/ResEng.gf b/lib/next-resource/english/ResEng.gf new file mode 100644 index 000000000..b3f5f2071 --- /dev/null +++ b/lib/next-resource/english/ResEng.gf @@ -0,0 +1,485 @@ +--# -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$ has 8 values. $Gender$ is needed for "who"/"which" and +-- for "himself"/"herself"/"itself". + + param + Agr = AgP1 Number | AgP2 Number | AgP3Sg Gender | AgP3Pl ; + + 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 Agr ; + RCase = RPrep Gender | RC Gender Case ; + +--2 For $Numeral$ + + CardOrd = NCard | NOrd ; + DForm = unit | teen | ten ; + +--2 Transformations between parameter types + + oper + toAgr : Number -> Person -> Gender -> Agr = \n,p,g -> + case p of { + P1 => AgP1 n ; + P2 => AgP2 n ; + P3 => case n of { + Sg => AgP3Sg g ; + Pl => AgP3Pl + } + } ; + + fromAgr : Agr -> {n : Number ; p : Person ; g : Gender} = \a -> case a of { + AgP1 n => {n = n ; p = P1 ; g = Masc} ; + AgP2 n => {n = n ; p = P2 ; g = Masc} ; + AgP3Pl => {n = Pl ; p = P3 ; g = Masc} ; + AgP3Sg g => {n = Sg ; p = P3 ; g = g} + } ; + + agrP3 : Number -> Agr = \n -> agrgP3 n Neutr ; + + agrgP3 : Number -> Gender -> Agr = \n,g -> toAgr n P3 g ; + + conjAgr : Agr -> Agr -> Agr = \a0,b0 -> + let a = fromAgr a0 ; b = fromAgr b0 + in + toAgr + (conjNumber a.n b.n) + (conjPerson a.p b.p) a.g ; + +-- 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 Neutr in { + s = who.s ; + n = n + } ; + + mkPron : (i,me,my,mine : Str) -> Number -> Person -> Gender -> + {s : Case => Str ; sp : Str ; a : Agr} = + \i,me,my,mine,n,p,g -> { + s = table { + Nom => i ; + Acc => me ; + Gen => my + } ; + a = toAgr n p g ; + sp = mine + } ; + + mkNP : (i,me,my : Str) -> Number -> Person -> Gender -> + {s : Case => Str ; a : Agr} = + \i,me,my,n,p,g -> mkPron i me my me n p g ; + +-- 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 Neutr ; + +-- 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 => + {aux, adv, fin, inf : Str} ; -- would, not, sleeps, slept + + VP : Type = { + s : VerbForms ; + prp : Str ; -- present participle + inf : Str ; -- the infinitive form ; VerbForms would be the logical place + ad : Str ; -- sentence adverb + s2 : Agr => Str -- complement + } ; + + + SlashVP = VP ** {c2 : Str} ; + + predVc : (Verb ** {c2 : Str}) -> SlashVP = \verb -> + predV verb ** {c2 = verb.c2} ; + + 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 of { + => vff fin [] ; + => vf (does agr) inf ; + => vf (have agr) part ; --# notpresent + => vfn c (have agr) (havent agr) part ; --# notpresent + => vff (verb.s ! VPast) [] ; --# notpresent + => vf "did" inf ; --# notpresent + => vfn c "did" "didn't" inf ; --# notpresent + => vf "had" part ; --# notpresent + => vfn c "had" "hadn't" part ; --# notpresent + => vf "will" inf ; --# notpresent + => vfn c "will" "won't" inf ; --# notpresent + => vf "will" ("have" ++ part) ; --# notpresent + => vfn c "will" "won't"("have" ++ part) ; --# notpresent + => vf "would" inf ; --# notpresent + => vfn c "would" "wouldn't" inf ; --# notpresent + => vf "would" ("have" ++ part) ; --# notpresent + => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent + => 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 of { + => vf (have agr) part ; --# notpresent + => vfn c (have agr) (havent agr) part ; --# notpresent + => vf (verb.past ! b ! agr) [] ; --# notpresent + => vfn c (verb.past!Pos!agr)(verb.past!Neg!agr) [] ; --# notpresent + => vf "had" part ; --# notpresent + => vfn c "had" "hadn't" part ; --# notpresent + => vf "will" inf ; --# notpresent + => vfn c "will" "won't" inf ; --# notpresent + => vf "will" ("have" ++ part) ; --# notpresent + => vfn c "will" "won't"("have" ++ part) ; --# notpresent + => vf "would" inf ; --# notpresent + => vfn c "would" "wouldn't" inf ; --# notpresent + => vf "would" ("have" ++ part) ; --# notpresent + => vfn c "would" "wouldn't" ("have" ++ part) ; --# notpresent + => vf fin [] ; + => vfn c finp fin [] + } ; + prp = verb.prpart ; + inf = verb.inf ; + ad = [] ; + s2 = \\_ => [] + } ; + + vff : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> + {aux = [] ; adv = [] ; fin = x ; inf = y} ; + + vf : Str -> Str -> {aux, adv, fin, inf : Str} = \x,y -> vfn True x x y ; + + vfn : Bool -> Str -> Str -> Str -> {aux, fin, adv, inf : Str} = + \contr,x,y,z -> + case contr of { + True => {aux = y ; adv = [] ; fin = [] ; inf = z} ; + False => {aux = x ; adv = "not" ; fin = [] ; inf = 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 + } ; + + insertObjPre : (Agr => Str) -> VP -> VP = \obj,vp -> { + s = vp.s ; + prp = vp.prp ; + inf = vp.inf ; + ad = vp.ad ; + s2 = \\a => obj ! a ++ vp.s2 ! a + } ; + + insertObjc : (Agr => Str) -> SlashVP -> SlashVP = \obj,vp -> + insertObj obj vp ** {c2 = vp.c2} ; + +--- The adverb should be before the finite verb. + + insertAdV : Str -> VP -> VP = \ad,vp -> { + s = vp.s ; + prp = vp.prp ; + inf = vp.inf ; + ad = vp.ad ++ ad ; + 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 ++ + case isAux of {True => [] ; False => "to"} ++ + vp.inf ++ vp.s2 ! a ; + + agrVerb : Str -> Str -> Agr -> Str = \has,have,agr -> + case agr of { + AgP3Sg _ => 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 of { + => "am" ; + => ["am not"] ; --- am not I + _ => agrVerb (posneg b "is") (posneg b "are") a + } ; + past = \\b,a => case a of { --# notpresent + AgP1 Sg | AgP3Sg _ => 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 { + AgP1 Sg => "myself" ; + AgP2 Sg => "yourself" ; + AgP3Sg Masc => "himself" ; + AgP3Sg Fem => "herself" ; + AgP3Sg Neutr => "itself" ; + AgP1 Pl => "ourselves" ; + AgP2 Pl => "yourselves" ; + AgP3Pl => "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.aux ++ verb.adv ++ vp.ad ++ verb.fin ++ verb.inf ++ compl ; + OQuest => verb.aux ++ subj ++ verb.adv ++ vp.ad ++ verb.fin ++ 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 + } + } ; + +-- for VP conjunction + + param + VPIForm = VPIInf | VPIPPart ; + + +} diff --git a/lib/next-resource/english/SentenceEng.gf b/lib/next-resource/english/SentenceEng.gf new file mode 100644 index 000000000..f643300ea --- /dev/null +++ b/lib/next-resource/english/SentenceEng.gf @@ -0,0 +1,67 @@ +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 = AgP2 (numImp n) ; + verb = infVP True vp agr ; + dont = case pol of { + CNeg True => "don't" ; + CNeg False => "do" ++ "not" ; + _ => [] + } + in + dont ++ verb + } ; + + SlashVP np vp = + mkClause (np.s ! Nom) np.a vp ** {c2 = vp.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} ; + + SlashVS np vs slash = + mkClause (np.s ! Nom) np.a + (insertObj (\\_ => conjThat ++ slash.s) (predV vs)) ** + {c2 = slash.c2} ; + + 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 + } ; + UseSlash t a p cl = { + s = t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! ctr p.p ! ODir ; + c2 = cl.c2 + } ; + + AdvS a s = {s = a.s ++ "," ++ s.s} ; + + RelS s r = {s = s.s ++ "," ++ r.s ! agrP3 Sg} ; + + oper + ctr = contrNeg True ; -- contracted negations + +} + diff --git a/lib/next-resource/english/StructuralEng.gf b/lib/next-resource/english/StructuralEng.gf new file mode 100644 index 000000000..b79f90098 --- /dev/null +++ b/lib/next-resource/english/StructuralEng.gf @@ -0,0 +1,131 @@ +concrete StructuralEng of Structural = CatEng ** + open MorphoEng, (P = ParadigmsEng), Prelude in { + + flags optimize=all ; + + lin + above_Prep = ss "above" ; + after_Prep = ss "after" ; + all_Predet = ss "all" ; + almost_AdA, almost_AdN = ss "almost" ; + although_Subj = ss "although" ; + always_AdV = ss "always" ; + and_Conj = sd2 [] "and" ** {n = Pl} ; +---b and_Conj = ss "and" ** {n = Pl} ; + because_Subj = ss "because" ; + before_Prep = ss "before" ; + behind_Prep = ss "behind" ; + between_Prep = ss "between" ; + both7and_DConj = sd2 "both" "and" ** {n = Pl} ; + but_PConj = ss "but" ; + by8agent_Prep = ss "by" ; + by8means_Prep = ss "by" ; + can8know_VV, can_VV = { + s = table { + VVF VInf => ["be able to"] ; + VVF VPres => "can" ; + VVF VPPart => ["been able to"] ; + VVF VPresPart => ["being able to"] ; + VVF VPast => "could" ; --# notpresent + VVPastNeg => "couldn't" ; --# notpresent + VVPresNeg => "can't" + } ; + isAux = True + } ; + during_Prep = ss "during" ; + 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" ; DEPRECATED + for_Prep = ss "for" ; + from_Prep = ss "from" ; + he_Pron = mkPron "he" "him" "his" "his" Sg P3 Masc ; + 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_Pron = mkPron "I" "me" "my" "mine" Sg P1 Masc ; + in_Prep = ss "in" ; + it_Pron = mkPron "it" "it" "its" "its" Sg P3 Neutr ; + less_CAdv = ss "less" ; + many_Det = mkDeterminer Pl "many" ; + more_CAdv = ss "more" ; + most_Predet = ss "most" ; + much_Det = mkDeterminer Sg "much" ; + must_VV = { + s = table { + VVF VInf => ["have to"] ; + VVF VPres => "must" ; + VVF VPPart => ["had to"] ; + VVF VPresPart => ["having to"] ; + VVF VPast => ["had to"] ; --# notpresent + VVPastNeg => ["hadn't to"] ; --# notpresent + VVPresNeg => "mustn't" + } ; + isAux = True + } ; +---b no_Phr = ss "no" ; + no_Utt = ss "no" ; + on_Prep = ss "on" ; +---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED + only_Predet = ss "only" ; + or_Conj = sd2 [] "or" ** {n = Sg} ; + otherwise_PConj = ss "otherwise" ; + part_Prep = ss "of" ; + please_Voc = ss "please" ; + possess_Prep = ss "of" ; + quite_Adv = ss "quite" ; + she_Pron = mkPron "she" "her" "her" "hers" Sg P3 Fem ; + 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_Quant = mkQuant "that" "those" ; + there_Adv = ss "there" ; + there7to_Adv = ss "there" ; + there7from_Adv = ss ["from there"] ; + therefore_PConj = ss "therefore" ; + they_Pron = mkPron "they" "them" "their" "theirs" Pl P3 Masc ; ---- + this_Quant = mkQuant "this" "these" ; + through_Prep = ss "through" ; + too_AdA = ss "too" ; + to_Prep = ss "to" ; + under_Prep = ss "under" ; + very_AdA = ss "very" ; + want_VV = P.mkVV (P.regV "want") ; + we_Pron = mkPron "we" "us" "our" "ours" Pl P1 Masc ; + whatPl_IP = mkIP "what" "what" "what's" Pl ; + whatSg_IP = mkIP "what" "what" "what's" Sg ; + when_IAdv = ss "when" ; + when_Subj = ss "when" ; + where_IAdv = ss "where" ; + which_IQuant = {s = \\_ => "which"} ; +---b whichPl_IDet = mkDeterminer Pl ["which"] ; +---b whichSg_IDet = mkDeterminer Sg ["which"] ; + whoPl_IP = mkIP "who" "whom" "whose" Pl ; + whoSg_IP = mkIP "who" "whom" "whose" Sg ; + why_IAdv = ss "why" ; + without_Prep = ss "without" ; + with_Prep = ss "with" ; +---b yes_Phr = ss "yes" ; + yes_Utt = ss "yes" ; + youSg_Pron = mkPron "you" "you" "your" "yours" Sg P2 Masc ; + youPl_Pron = mkPron "you" "you" "your" "yours" Pl P2 Masc ; + youPol_Pron = mkPron "you" "you" "your" "yours" Sg P2 Masc ; + + +oper + mkQuant : Str -> Str -> {s,sp : Bool => Number => Str} = \x,y -> { + s,sp = \\_ => table Number [x ; y] + } ; + +} + diff --git a/lib/next-resource/english/VerbEng.gf b/lib/next-resource/english/VerbEng.gf new file mode 100644 index 000000000..b78f6e258 --- /dev/null +++ b/lib/next-resource/english/VerbEng.gf @@ -0,0 +1,50 @@ +concrete VerbEng of Verb = CatEng ** open ResEng in { + + flags optimize=all_subs ; + + lin + UseV = predV ; + + SlashV2a v = predVc v ; + Slash2V3 v np = + insertObjc (\\_ => v.c2 ++ np.s ! Acc) (predV v ** {c2 = v.c3}) ; + Slash3V3 v np = + insertObjc (\\_ => v.c3 ++ np.s ! Acc) (predVc 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) ; + + SlashV2V v vp = insertObjc (\\a => infVP v.isAux vp a) (predVc v) ; + SlashV2S v s = insertObjc (\\_ => conjThat ++ s.s) (predVc v) ; + SlashV2Q v q = insertObjc (\\_ => q.s ! QIndir) (predVc v) ; + SlashV2A v ap = insertObjc (\\a => ap.s ! a) (predVc v) ; ---- + + ComplSlash vp np = insertObjPre (\\_ => vp.c2 ++ np.s ! Acc) vp ; + + SlashVV vv vp = + insertObj (\\a => infVP vv.isAux vp a) (predVV vv) ** + {c2 = vp.c2} ; + SlashV2VNP vv np vp = + insertObjPre (\\_ => vv.c2 ++ np.s ! Acc) + (insertObjc (\\a => infVP vv.isAux vp a) (predVc vv)) ** + {c2 = vp.c2} ; + + UseComp comp = insertObj comp.s (predAux auxBe) ; + + AdvVP vp adv = insertObj (\\_ => adv.s) vp ; + + AdVVP adv vp = insertAdV adv.s vp ; + + ReflVP v = insertObjPre (\\a => v.c2 ++ reflPron ! a) v ; + + PassV2 v = insertObj (\\_ => v.s ! VPPart) (predAux auxBe) ; + +---b 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} ; + +} diff --git a/lib/next-resource/norwegian/AdjectiveNor.gf b/lib/next-resource/norwegian/AdjectiveNor.gf new file mode 100644 index 000000000..e1c722b36 --- /dev/null +++ b/lib/next-resource/norwegian/AdjectiveNor.gf @@ -0,0 +1,2 @@ +concrete AdjectiveNor of Adjective = CatNor ** AdjectiveScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/AdverbNor.gf b/lib/next-resource/norwegian/AdverbNor.gf new file mode 100644 index 000000000..09244f110 --- /dev/null +++ b/lib/next-resource/norwegian/AdverbNor.gf @@ -0,0 +1,2 @@ +concrete AdverbNor of Adverb = CatNor ** AdverbScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/AllNor.gf b/lib/next-resource/norwegian/AllNor.gf new file mode 100644 index 000000000..cf84e6768 --- /dev/null +++ b/lib/next-resource/norwegian/AllNor.gf @@ -0,0 +1,7 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete AllNor of AllNorAbs = + LangNor, + IrregNor - [fly_V], + ExtraNor + ** {} ; diff --git a/lib/next-resource/norwegian/AllNorAbs.gf b/lib/next-resource/norwegian/AllNorAbs.gf new file mode 100644 index 000000000..a252fd6f2 --- /dev/null +++ b/lib/next-resource/norwegian/AllNorAbs.gf @@ -0,0 +1,5 @@ +abstract AllNorAbs = + Lang, + IrregNorAbs - [fly_V], + ExtraNorAbs + ** {} ; diff --git a/lib/next-resource/norwegian/CatNor.gf b/lib/next-resource/norwegian/CatNor.gf new file mode 100644 index 000000000..bfc4b5390 --- /dev/null +++ b/lib/next-resource/norwegian/CatNor.gf @@ -0,0 +1,2 @@ +concrete CatNor of Cat = CommonX ** CatScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/ConjunctionNor.gf b/lib/next-resource/norwegian/ConjunctionNor.gf new file mode 100644 index 000000000..85357dffd --- /dev/null +++ b/lib/next-resource/norwegian/ConjunctionNor.gf @@ -0,0 +1,2 @@ +concrete ConjunctionNor of Conjunction = CatNor ** ConjunctionScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/DiffNor.gf b/lib/next-resource/norwegian/DiffNor.gf new file mode 100644 index 000000000..3723369f2 --- /dev/null +++ b/lib/next-resource/norwegian/DiffNor.gf @@ -0,0 +1,90 @@ +instance DiffNor of DiffScand = open CommonScand, Prelude in { + +-- Parameters. + + param + Gender = Utr Sex | Neutr ; + Sex = Masc | Fem ; + + oper + utrum = Utr Masc ; + neutrum = Neutr ; + + gennum : Gender -> Number -> GenNum = \g,n -> + case < : Gender * Number> of { + => SgUtr ; + => SgNeutr ; + _ => Plg + } ; + + detDef : Species = Def ; + + Verb : Type = { + s : VForm => Str ; + part : Str ; + vtype : VType ; + isVaere : Bool + } ; + + hasAuxBe v = v.isVaere ; + +-- Strings. + + conjThat = "at" ; + conjThan = "enn" ; + conjAnd = "og" ; + compMore = "mere" ; + infMark = "å" ; + + subjIf = "hvis" ; + + artIndef : Gender => Str = table { + Utr Masc => "en" ; + Utr Fem => "ei" ; + Neutr => "et" + } ; + + verbHave = + mkVerb "ha" "har" "ha" "hadde" "hatt" "haven" "havet" "havne" + ** {part = [] ; isVaere = False} ; + verbBe = + mkVerb "være" "er" "var" "var" "vært" "væren" "været" "værne" + ** {part = [] ; isVaere = False} ; + verbBecome = + mkVerb "bli" "blir" "bli" "ble" "blitt" "bliven" "blivet" "blivne" + ** {part = [] ; isVaere = True} ; + + -- auxiliary + noPart = {part = []} ; + + auxFut = "vil" ; -- "skal" in ExtNor + auxCond = "ville" ; + + negation : Polarity => Str = table { + Pos => [] ; + Neg => "ikke" + } ; + + genderForms : (x1,x2 : Str) -> Gender => Str = \all,allt -> + table { + Utr _ => all ; + Neutr => allt + } ; + + relPron : GenNum => RCase => Str = \\gn,c => case c of { + RNom | RPrep False => "som" ; + RGen => "hvis" ; + RPrep _ => gennumForms "hvilken" "hvilket" "hvilke" ! gn + } ; + + pronSuch = gennumForms "sådan" "sådant" "sådanne" ; + + reflPron : Agr -> Str = \a -> case a of { + {gn = Plg ; p = P1} => "oss" ; + {gn = Plg ; p = P2} => "jer" ; + {p = P1} => "meg" ; + {p = P2} => "deg" ; + {p = P3} => "seg" + } ; + +} diff --git a/lib/next-resource/norwegian/ExtraNor.gf b/lib/next-resource/norwegian/ExtraNor.gf new file mode 100644 index 000000000..1cfd1008b --- /dev/null +++ b/lib/next-resource/norwegian/ExtraNor.gf @@ -0,0 +1,8 @@ +concrete ExtraNor of ExtraNorAbs = ExtraScandNor ** open CommonScand, ResNor in { + + lin + PossNP np pro = { + s = \\c => np.s ! NPNom ++ pro.s ! NPPoss np.a.gn ; ---- c + a = np.a + } ; +} diff --git a/lib/next-resource/norwegian/ExtraNorAbs.gf b/lib/next-resource/norwegian/ExtraNorAbs.gf new file mode 100644 index 000000000..21c03ae7e --- /dev/null +++ b/lib/next-resource/norwegian/ExtraNorAbs.gf @@ -0,0 +1,9 @@ +-- Structures special for Norwegian. These are not implemented in other +-- Scandinavian languages. + +abstract ExtraNorAbs = ExtraScandAbs ** { + + fun + PossNP : NP -> Pron -> NP ; -- bilen min + +} \ No newline at end of file diff --git a/lib/next-resource/norwegian/ExtraScandNor.gf b/lib/next-resource/norwegian/ExtraScandNor.gf new file mode 100644 index 000000000..5f988fe7e --- /dev/null +++ b/lib/next-resource/norwegian/ExtraScandNor.gf @@ -0,0 +1,2 @@ +concrete ExtraScandNor of ExtraScandAbs = CatNor ** ExtraScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/GrammarNor.gf b/lib/next-resource/norwegian/GrammarNor.gf new file mode 100644 index 000000000..ed36ad496 --- /dev/null +++ b/lib/next-resource/norwegian/GrammarNor.gf @@ -0,0 +1,21 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete GrammarNor of Grammar = + NounNor, + VerbNor, + AdjectiveNor, + AdverbNor, + NumeralNor, + SentenceNor, + QuestionNor, + RelativeNor, + ConjunctionNor, + PhraseNor, + TextX, + IdiomNor, + StructuralNor + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/norwegian/IdiomNor.gf b/lib/next-resource/norwegian/IdiomNor.gf new file mode 100644 index 000000000..998d8fa8d --- /dev/null +++ b/lib/next-resource/norwegian/IdiomNor.gf @@ -0,0 +1,40 @@ +concrete IdiomNor of Idiom = CatNor ** + open MorphoNor, ParadigmsNor, IrregNor, Prelude in { + + flags optimize=all_subs ; + + lin + + ImpersCl vp = mkClause "det" (agrP3 ParadigmsNor.neutrum Sg) vp ; + GenericCl vp = mkClause "man" (agrP3 utrum Sg) vp ; + + CleftNP np rs = mkClause "det" (agrP3 ParadigmsNor.neutrum Sg) + (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a) (predV verbBe)) ; + + CleftAdv ad s = mkClause "det" (agrP3 ParadigmsNor.neutrum Sg) + (insertObj (\\_ => ad.s ++ s.s ! Sub) (predV verbBe)) ; + + ExistNP np = + mkClause "det" (agrP3 ParadigmsNor.neutrum Sg) (insertObj + (\\_ => np.s ! accusative) (predV (depV finne_V))) ; + + ExistIP ip = { + s = \\t,a,p => + let + cls = + (mkClause "det" (agrP3 ParadigmsNor.neutrum Sg) (predV (depV finne_V))).s ! t ! a ! p ; + who = ip.s ! accusative + in table { + QDir => who ++ cls ! Inv ; + QIndir => who ++ cls ! Sub + } + } ; + + ProgrVP vp = + insertObj (\\a => ["ved å"] ++ infVP vp a) (predV verbBe) ; + + ImpPl1 vp = {s = ["lat oss"] ++ infVP vp {gn = Plg ; p = P1}} ; + + +} + diff --git a/lib/next-resource/norwegian/IrregNor.gf b/lib/next-resource/norwegian/IrregNor.gf new file mode 100644 index 000000000..ba734148b --- /dev/null +++ b/lib/next-resource/norwegian/IrregNor.gf @@ -0,0 +1,72 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +-- see: http://frodo.bruderhof.com/norskklassen/commonverbs.htm + +concrete IrregNor of IrregNorAbs = CatNor ** open ParadigmsNor in { + + flags optimize=values ; + + lin be_V = mkV "be" "ber" "bes" "bad" "bedt" "be" ; + lin bite_V = irregV "bite" (variants {"bet" ; "beit"}) "bitt" ; + lin bli_V = irregV "bli" (variants {"ble" ; "blei"}) "blitt" ; + lin brenne_V = irregV "brenne" (variants {"brant" ; "brente"}) "brent" ; + lin bringe_V = irregV "bringe" "brakte" "brakt" ; + lin burde_V = irregV "burde" "burde" "burdet" ; + lin bære_V = irregV "bære" "bar" "båret" ; + lin dra_V = mkV "dra" "drar" "dras" "drog" (variants {"dradd" ; "dratt"}) "dra" ; + lin drikke_V = irregV "drikke" "drakk" "drukket" ; + lin drive_V = irregV "drive" (variants {"drev" ; "dreiv"}) "drevet" ; + lin dø_V = irregV "dø" (variants {"dødde" ; "døde"}) "dødd" ; + lin eie_V = irregV "eie" (variants {"eide" ; "åtte"}) (variants {"eid" ; "ått"}) ; + lin falle_V = irregV "falle" "falt" "falt" ; + lin finne_V = irregV "finne" "fant" "funnet" ; + lin fly_V = irregV "fly" (variants {"fløy" ; "flaug"}) (variants {"fløyet";"flydd"}) ; + lin flyte_V = irregV "flyte" (variants {"fløte" ; "flaut"}) "flytt" ; + lin foretrekke_V = irregV "foretrekke" "foretrakk" "foretrukket" ; + lin forlate_V = irregV "forlate" "forlot" "forlatt" ; + lin forstå_V = irregV "forstå" "forstod" "forstått" ; + lin fortelle_V = irregV "fortelle" "fortalte" "fortalt" ; + lin fryse_V = irregV "fryse" "frøs" "frosset" ; + lin få_V = irregV "få" "fikk" "fått" ; + lin gi_V = irregV "gi" "gav" "gitt" ; + lin gjelde_V = irregV "gjelde" (variants {"gjaldt" ; "galdt"}) "gjeldt" ; + lin gjøre_V = irregV "gjøre" "gjorde" "gjort" ; + lin gni_V = irregV "gni" (variants {"gned" ; "gnei" ; "gnidde"}) "gnidd" ; + lin gå_V = irregV "gå" "gikk" "gått" ; + lin ha_V = irregV "ha" "hadde" "hatt" ; + lin hente_V = irregV "hente" "hentet" "hendt" ; + lin hete_V = irregV "hete" (variants {"het" ; "hette"}) "hett" ; + lin hjelpe_V = irregV "hjelpe" "hjalp" "hjulpet" ; + lin holde_V = irregV "holde" "holdt" "holdt" ; + lin komme_V = irregV "komme" "kom" "kommet" ; + lin kunne_V = irregV "kunne" "kunne" "kunnet" ; + lin la_V = irregV "la" "lot" "latt" ; + lin legge_V = irregV "legge" "la" "lagt" ; + lin ligge_V = irregV "ligge" "lå" "ligget" ; + lin løpe_V = irregV "løpe" "løp" (variants {"løpt" ; "løpet"}) ; + lin måtte_V = irregV "måtte" "måtte" "måttet" ; + lin renne_V = irregV "renne" "rant" "rent" ; + lin se_V = mkV "se" "ser" "ses" "så" "sett" "se" ; + lin selge_V = irregV "selge" "solgte" "solgt" ; + lin sette_V = irregV "sette" "satte" "satt" ; + lin si_V = mkV "si" "sier" "sies" "sa" "sagt" "sagd" ; + lin sitte_V = irregV "sitte" "satt" "sittet" ; + lin skjære_V = irregV "skjære" "skar" "skåret" ; + lin skrive_V = irregV "skrive" "skrev" "skrevet" ; + lin skulle_V = irregV "skulle" "skulle" "skullet" ; + lin slå_V = irregV "slå" "slo" "slått" ; + lin slåss_V = mkV "slåss" "slåss" "slåss" "sloss" "slåss" "slåss" ; + lin sove_V = irregV "sove" "sov" "sovet" ; + lin springe_V = irregV "springe" "sprang" "sprunget" ; + lin spørre_V = irregV "spørre" "spurte" "spurt" ; + lin stikke_V = irregV "stikke" "stakk" "stukket" ; + lin stå_V = irregV "stå" "stod" "stått" ; + lin suge_V = irregV "suge" (variants {"sugde" ; "saug"}) "sugd" ; + lin synes_V = irregV "synes" "syntes" (variants {"synes" ; "syns"}) ; + lin synge_V = irregV "synge" "sang" "sunget" ; + lin ta_V = irregV "ta" "tok" "tatt" ; + lin treffe_V = irregV "treffe" "traff" "truffet" ; + lin trives_V = irregV "trives" "trivdes" (variants {"trives" ; "trivs"}) ; + lin ville_V = irregV "ville" "ville" "villet" ; + lin vite_V = mkV "vite" "vet" "vetes" "visste" "visst" "vit" ; +} diff --git a/lib/next-resource/norwegian/IrregNorAbs.gf b/lib/next-resource/norwegian/IrregNorAbs.gf new file mode 100644 index 000000000..2c6c61181 --- /dev/null +++ b/lib/next-resource/norwegian/IrregNorAbs.gf @@ -0,0 +1,65 @@ +abstract IrregNorAbs = Cat ** { + fun be_V : V ; + fun bite_V : V ; + fun bli_V : V ; + fun brenne_V : V ; + fun bringe_V : V ; + fun burde_V : V ; + fun bære_V : V ; + fun dra_V : V ; + fun drikke_V : V ; + fun drive_V : V ; + fun dø_V : V ; + fun eie_V : V ; + fun falle_V : V ; + fun finne_V : V ; + fun fly_V : V ; + fun flyte_V : V ; + fun foretrekke_V : V ; + fun forlate_V : V ; + fun forstå_V : V ; + fun fortelle_V : V ; + fun fryse_V : V ; + fun få_V : V ; + fun gi_V : V ; + fun gjelde_V : V ; + fun gjøre_V : V ; + fun gni_V : V ; + fun gå_V : V ; + fun ha_V : V ; + fun hente_V : V ; + fun hete_V : V ; + fun hjelpe_V : V ; + fun holde_V : V ; + fun komme_V : V ; + fun kunne_V : V ; + fun la_V : V ; + fun legge_V : V ; + fun ligge_V : V ; + fun løpe_V : V ; + fun måtte_V : V ; + fun renne_V : V ; + fun se_V : V ; + fun selge_V : V ; + fun sette_V : V ; + fun si_V : V ; + fun sitte_V : V ; + fun skjære_V : V ; + fun skrive_V : V ; + fun skulle_V : V ; + fun slå_V : V ; + fun slåss_V : V ; + fun sove_V : V ; + fun springe_V : V ; + fun spørre_V : V ; + fun stikke_V : V ; + fun stå_V : V ; + fun suge_V : V ; + fun synes_V : V ; + fun synge_V : V ; + fun ta_V : V ; + fun treffe_V : V ; + fun trives_V : V ; + fun ville_V : V ; + fun vite_V : V ; +} diff --git a/lib/next-resource/norwegian/LangNor.gf b/lib/next-resource/norwegian/LangNor.gf new file mode 100644 index 000000000..41d51c2a9 --- /dev/null +++ b/lib/next-resource/norwegian/LangNor.gf @@ -0,0 +1,10 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete LangNor of Lang = + GrammarNor, + LexiconNor + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/norwegian/LexiconNor.gf b/lib/next-resource/norwegian/LexiconNor.gf new file mode 100644 index 000000000..30cda22ea --- /dev/null +++ b/lib/next-resource/norwegian/LexiconNor.gf @@ -0,0 +1,368 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +concrete LexiconNor of Lexicon = CatNor ** + open Prelude, ParadigmsNor, IrregNor in { + +flags startcat=Phr ; lexer=textlit ; unlexer=text ; + optimize=values ; + +lin + airplane_N = mk2N "fly" "flyet" ; + answer_V2S = mkV2S (regV "svare") (mkPrep "til") ; + apartment_N = mk2N "leilighet" "leiligheten" ; + apple_N = mk2N "eple" "eplet" ; + art_N = mk2N "kunst" "kunsten" ; + ask_V2Q = mkV2Q spørre_V noPrep ; + baby_N = mk2N "baby" "babyen" ; + bad_A = regADeg "dårlig" ; ---- + bank_N = mk2N "bank" "banken" ; + beautiful_A = mk3ADeg "vakker" "vakkert" "vakre" ; + become_VA = mkVA (vaereV bli_V) ; + beer_N = regGenN "øl" neutrum ; + beg_V2V = mkV2V be_V noPrep (mkPrep "at") ; + big_A = irregADeg "stor" "større" "størst"; + bike_N = mkN "sykkel" "sykkelen" "sykler" "syklene" ; + bird_N = mk2N "fugl" "fuglen" ; + black_A = mk2ADeg "svart" "svart" ; + blue_A = mk2ADeg "blå" "blått"; + boat_N = regGenN "båt" masculine ; + book_N = mkN "bok" "boka" "bøker" "bøkene" ; + boot_N = mkN "støvel" "støvelen" "støvler" "støvlene" ; + boss_N = mk2N "sjef" "sjefen" ; + boy_N = regGenN "gutt" masculine ; + bread_N = regGenN "brød" neutrum ; + break_V2 = dirV2 (mk2V "knuse" "knuste") ; + broad_A = regADeg "bred" ; + brother_N2 = mkN2 ( (mkN "bror" "broren" "brødre" "brødrene")) (mkPrep "til") ; + brown_A = regADeg "brun" ; + butter_N = regGenN "smør" neutrum ; + buy_V2 = dirV2 (mk2V "kjøpe" "kjøpte") ; + camera_N = mk2N "kamera" "kameraen" ; ---- + cap_N = mk2N "lue" "lua" ; + car_N = regGenN "bil" masculine ; + carpet_N = regGenN "matte" feminine ; + cat_N = mk2N "katt" "katten" ; + ceiling_N = regGenN "tak" neutrum ; + chair_N = regGenN "stol" masculine ; + cheese_N = regGenN "ost" masculine ; + child_N = regGenN "barn" neutrum ; + church_N = regGenN "kirke" feminine ; + city_N = mk2N "by" "byen" ; + clean_A = regADeg "rein" ; + clever_A = regADeg "klok" ; + close_V2 = dirV2 (mk2V "lukke" "lukket") ; + coat_N = regGenN "frakk" masculine ; + cold_A = regADeg "kald" ; + come_V = vaereV IrregNor.komme_V ; + computer_N = mk2N "datamaskin" "datamaskinen" ; + country_N = mk2N "land" "landet" ; + cousin_N = mk2N "fetter" "fetteren" ; ---- + cow_N = mkN "ku" "kua" "kyr" "kyrne" ; ---- + die_V = vaereV IrregNor.dø_V ; + dirty_A = mk3ADeg "skitten" "skittent" "skitne" ; ---- + distance_N3 = mkN3 (regGenN "avstand" masculine) (mkPrep "fra") (mkPrep "til") ; + doctor_N = mk2N "lege" "legen" ; + dog_N = regGenN "hund" masculine ; + door_N = regGenN "dør" feminine ; + drink_V2 = dirV2 IrregNor.drikke_V ; + easy_A2V = mkA2V (regA "grei") (mkPrep "for") ; + eat_V2 = dirV2 (mk2V "spise" "spiste") ; + empty_A = mkADeg "tom" "tomt" "tomme" "tommere" "tommest" ; + enemy_N = regGenN "fiende" masculine ; + factory_N = mk2N "fabrikk" "fabrikken" ; + father_N2 = mkN2 ( (mkN "far" "faren" "fedre" "fedrene")) (mkPrep "til") ; + fear_VS = mkVS (regV "frykte") ; + find_V2 = dirV2 (irregV "finne" "fann" "funnet") ; + fish_N = mk2N "fisk" "fisken" ; + floor_N = regGenN "golv" neutrum ; + forget_V2 = dirV2 (mkV "glemme" "glemmer" "glemmes" "glemte" "glemt" "glem") ; + fridge_N = regGenN "kjøleskap" neutrum ; + friend_N = mkN "venn" "vennen" "venner" "vennene" ; + fruit_N = mk2N "frukt" "frukten" ; + fun_AV = mkAV (mkA "morsom" "morsomt" "morsomme") ; + garden_N = regGenN "hage" masculine ; + girl_N = regGenN "jente" feminine ; + glove_N = regGenN "hanske" masculine ; + gold_N = regGenN "gull" neutrum ; + good_A = mkADeg "god" "godt" "gode" "bedre" "best" ; + go_V = vaereV IrregNor.gå_V ; + green_A = mk2ADeg "grønn" "grønt" ; + harbour_N = regGenN "havn" feminine; + hate_V2 = dirV2 (regV "hate") ; + hat_N = regGenN "hatt" masculine ; + have_V2 = dirV2 IrregNor.ha_V ; + hear_V2 = dirV2 (mk2V "høre" "hørte") ; + hill_N = regGenN "haug" masculine ; + hope_VS = mkVS (regV "håpe") ; + horse_N = regGenN "hest" masculine ; + hot_A = regADeg "heit" ; + house_N = regGenN "hus" neutrum ; + important_A = regADeg "viktig" ; + industry_N = mk2N "industri" "industrien" ; + iron_N = regGenN "jern" neutrum ; + john_PN = mkPN "John" masculine ; + king_N = regGenN "konge" masculine ; + know_V2 = dirV2 IrregNor.vite_V ; + lake_N = regGenN "vann" neutrum ; + lamp_N = regGenN "lampe" feminine ; + learn_V2 = dirV2 (mk2V "lære" "lærte") ; + leather_N = regGenN "lær" neutrum ; + leave_V2 = dirV2 forlate_V ; + like_V2 = dirV2 (mk2V "like" "likte") ; + listen_V2 = dirV2 (regV "lytte") ; + live_V = mk2V "leve" "levde" ; + long_A = irregADeg "lang" "lengre" "lengst" ; + lose_V2 = dirV2 (mk2V "tape" "tapte") ; + love_N = regGenN "kjærlighet" masculine ; + love_V2 = dirV2 (regV "elske") ; + man_N = (mkN "mann" "mannen" "menn" "mennen") ; + married_A2 = mkA2 (mk2A "gift" "gift") (mkPrep "med") ; + meat_N = regGenN "kjøtt" neutrum ; + milk_N = regGenN "melk" masculine ; + moon_N = regGenN "måne" masculine ; + mother_N2 = mkN2 (mkN "mor" "moren" "mødre" "mødrene") (mkPrep "til") ; ---- fem + mountain_N = regGenN "berg" neutrum ; + music_N = mk2N "musikk" "musikken" ; + narrow_A = regADeg "smal" ; + new_A = mkADeg "ny" "nytt" "nye" "nyere" "nyest" ; + newspaper_N = regGenN "avis" feminine ; + oil_N = regGenN "olje" masculine ; + old_A = mkADeg "gammel" "gammelt" "gamle" "eldre" "eldst" ; + open_V2 = dirV2 (regV "åpne") ; + paint_V2A = mkV2A (regV "male") noPrep ; + paper_N = regGenN "papir" neutrum ; ---- + paris_PN = regGenPN "Paris" neutrum ; + peace_N = regGenN "fred" masculine ; + pen_N = regGenN "penn" masculine ; + planet_N = mk2N "planet" "planeten" ; + plastic_N = mk2N "plast" "plasten" ; + play_V2 = dirV2 (mk2V "spille" "spilte") ; + policeman_N = mk2N "politi" "politien" ; + priest_N = mk2N "prest" "presten" ; + probable_AS = mkAS (regA "sannsynlig") ; + queen_N = regGenN "dronning" feminine ; + radio_N = regGenN "radio" masculine ; + rain_V0 = mkV0 (regV "regne") ; + read_V2 = dirV2 (mk2V "lese" "leste") ; + red_A = regADeg "rød" ; + religion_N = mk2N "religion" "religionen" ; + restaurant_N = mk2N "restaurant" "restauranten" ; + river_N = mk2N "elv" "elva" ; + rock_N = regGenN "stein" masculine ; + roof_N = regGenN "tak" neutrum ; + rubber_N = mk2N "gummi" "gummien" ; + run_V = vaereV IrregNor.springe_V ; + say_VS = mkVS si_V ; + school_N = regGenN "skole" feminine; + science_N = mk2N "vitenskap" "vitenskapen" ; + sea_N = mk2N "sjø" "sjøen" ; + seek_V2 = mkV2 (mk2V "lete" "lette") (mkPrep "etter") ; + see_V2 = dirV2 se_V ; + sell_V3 = dirV3 selge_V (mkPrep "til") ; + send_V3 = dirV3 (mk2V "sende" "sendte") (mkPrep "til") ; + sheep_N = mk2N "får" "fåret" ; + ship_N = regGenN "skip" neutrum ; + shirt_N = regGenN "skjorte" feminine ; + shoe_N = regGenN "sko" masculine ; + shop_N = mk2N "butikk" "butikken" ; + short_A = regADeg "kort" ; + silver_N = mk2N "sølv" "sølvet"; + sister_N = mkN "søster" "søsteren" "søstrer" "søstrene" ; + sleep_V = irregV "sove" "sov" "sovet" ; + small_A = mkADeg "liten" "lite" "små" "mindre" "minst" ; ---- lille + snake_N = regGenN "orm" masculine ; + sock_N = regGenN "strømpe" masculine ; + speak_V2 = dirV2 (regV "snakke") ; + star_N = regGenN "stjerne" feminine ; + steel_N = regGenN "stål" neutrum ; + stone_N = regGenN "stein" masculine ; + stove_N = regGenN "komfyr" masculine ; + student_N = mk2N "student" "studenten" ; + stupid_A = mk3ADeg "dum" "dumt" "dumme" ; + sun_N = regGenN "sol" feminine ; + switch8off_V2 = dirV2 (partV (irregV "slå" "slo" "slått") "av") ; + switch8on_V2 = dirV2 (partV (irregV "slå" "slo" "slått") "på") ; + table_N = regGenN "bord" neutrum ; + talk_V3 = mkV3 (regV "snakke") (mkPrep "til") (mkPrep "om") ; + teacher_N = mkN "lærer" "læreren" "lærere" "lærerne" ; + teach_V2 = dirV2 (mk2V "undervise" "underviste") ; + television_N = mk2N "fjernsyn" "fjernsynet" ; + thick_A = mk2ADeg "tykk" "tykt" ; + thin_A = mk2ADeg "tynn" "tynt" ; + train_N = regGenN "tog" neutrum ; + travel_V = vaereV (mk2V "reise" "reiste") ; + tree_N = mkN "tre" "treet" "trær" "træne" ; + ---- trousers_N = regGenN "trousers" ; ---- pl t ! + ugly_A = mk2ADeg "stygg" "stygt" ; + understand_V2 = dirV2 (irregV "forstå" "forstod" "forstått") ; + university_N = regGenN "universitet" neutrum ; + village_N = mk2N "grend" "grenda" ; + wait_V2 = mkV2 (regV "vente") (mkPrep "på") ; + walk_V = vaereV IrregNor.gå_V ; + warm_A = regADeg "varm" ; + war_N = regGenN "krig" masculine ; + watch_V2 = mkV2 se_V (mkPrep "på") ; + water_N = mk2N "vatn" "vatnet" ; + white_A = regADeg "hvit" ; + window_N = mkN "vindu" "vinduet" "vinduer" "vinduene" ; ---- er? + wine_N = mk2N "vin" "vinen" ; + win_V2 = dirV2 (irregV "vinne" "vant" "vunnet") ; + woman_N = regGenN "kvinne" feminine ; ---- kvinnen + wonder_VQ = mkVQ (regV "undre") ; ---- seg + wood_N = mkN "tre" "treet" "trær" "træne" ; + write_V2 = dirV2 (irregV "skrive" "skrev" "skrevet") ; + yellow_A = regADeg "gul" ; + young_A = irregADeg "ung" "yngre" "yngst" ; + + do_V2 = dirV2 (irregV "gjøre" "gjorde" "gjort") ; + now_Adv = mkAdv "nå" ; + already_Adv = mkAdv "allerede" ; + song_N = mk2N "sang" "sangen" ; + add_V3 = mkV3 (partV (irregV "legge" "la" "lagt") "til") noPrep (mkPrep "til") ; + number_N = mk2N "nummer" "nummeret" ; + put_V2 = mkV2 (irregV "sette" "satte" "satt") noPrep ; + stop_V = vaereV (regV "stanse") ; + jump_V = regV "hoppe" ; + + left_Ord = {s = "venstre" ; isDet = True} ; + right_Ord = {s = "høyre" ; isDet = True} ; + far_Adv = mkAdv "fjern" ; + correct_A = regA "riktig" ; + dry_A = mk2A "tørr" "tørt" ; + dull_A = regA "sløv" ; + full_A = regA "full" ; + heavy_A = irregADeg "tung" "tyngre" "tyngst" ; + near_A = mkADeg "nære" "nære" "nære" "nærmere" "nærmest" ; + rotten_A = mk3ADeg "råtten" "råttent" "råtne" ; + round_A = regA "rund" ; + sharp_A = mk2A "kvass" "kvast" ; + smooth_A = mk2A "slett" "slett" ; + straight_A = regA "rak" ; + wet_A = regA "våt" ; + wide_A = regA "bred" ; + animal_N = mk2N "dyr" "dyret" ; + ashes_N = mk2N "aske" "aska" ; + back_N = mk2N "rygg" "ryggen" ; + bark_N = mk2N "bark" "barken" ; + belly_N = mk2N "mage" "magen" ; + blood_N = mk2N "blod" "blodet" ; + bone_N = mk2N "bein" "beinet" ; + breast_N = mk2N "bryst" "brystet" ; + cloud_N = mk2N "sky" "skya" ; + day_N = mk2N "dag" "dagen" ; + dust_N = mk2N "støv" "støvet" ; + ear_N = mk2N "øre" "øret" ; + earth_N = mk2N "jord" "jorda" ; + egg_N = mk2N "egg" "egget" ; + eye_N = mkN "øye" "øyet" "øyne" "øynene" ; + fat_N = mk2N "fett" "fettet" ; + feather_N = mk2N "fjør" "fjøra" ; + fingernail_N = mk2N "negl" "neglen" ; + fire_N = mk2N "ild" "ilden" ; + flower_N = mk2N "blomst" "blomsten" ; + fog_N = mk2N "tåke" "tåka" ; + foot_N = mk2N "fot" "føtter" ; + forest_N = mk2N "skog" "skogen" ; + grass_N = mk2N "gras" "graset" ; + guts_N = mk2N "tarm" "tarmen" ; ---- involler + hair_N = mk2N "hår" "håret" ; + hand_N = mk2N "hånd" "hånden" ; + head_N = mk2N "hode" "hodet" ; + heart_N = mk2N "hjerte" "hjertet" ; + horn_N = mk2N "horn" "hornet" ; + husband_N = mkN "ektemann" "ektemannen" "ektemenn" "ektemennen" ; + ice_N = mk2N "is" "isen" ; + knee_N = mkN "kne" "kneet" "knær" "knæne" ; + leaf_N = mk2N "løv" "løvet" ; + leg_N = mk2N "bein" "beinet" ; + liver_N = mkN "lever" "leveren" "levrer" "levrene" ; + louse_N = mk2N "lus" "lusa" ; + mouth_N = mk2N "munn" "munnen" ; + name_N = mk2N "navn" "navnet" ; + neck_N = mk2N "nakke" "nakken" ; + night_N = mkN "natt" "natta" "netter" "nettene" ; + nose_N = mk2N "nese" "nesen" ; + person_N = mk2N "person" "personen" ; + rain_N = mk2N "regn" "regnet" ; + road_N = mk2N "vei" "veien" ; + root_N = mkN "rot" "rota" "røtter" "røttene" ; + rope_N = mk2N "tau" "tauet" ; + salt_N = mk2N "salt" "saltet" ; + sand_N = mk2N "sand" "sanden" ; + seed_N = mk2N "frø" "frøet" ; + skin_N = mk2N "skinn" "skinnet" ; + sky_N = mkN "himmel" "himmelen" "himler" "himlene" ; + smoke_N = mk2N "røyk" "røyken" ; + snow_N = mk2N "snø" "snøen" ; + stick_N = mk2N "pinne" "pinnen" ; + tail_N = mk2N "hale" "halen" ; + tongue_N = mk2N "tunge" "tunga" ; + tooth_N = mkN "tann" "tanna" "tenner" "tennene" ; + wife_N = mk2N "kone" "kona" ; + wind_N = mk2N "vind" "vinden" ; + wing_N = mk2N "vinge" "vingen" ; + worm_N = mk2N "mark" "marken" ; + year_N = mk2N "år" "året" ; + bite_V2 = dirV2 (IrregNor.bite_V) ; + blow_V = mk2V "blåse" "blåste" ; + burn_V = brenne_V ; + count_V2 = dirV2 (regV "regne") ; + cut_V2 = dirV2 (skjære_V) ; + dig_V = mk2V "grave" "gravde" ; + fall_V = vaereV falle_V ; + fear_V2 = dirV2 (regV "frykte") ; + fight_V2 = dirV2 (slåss_V) ; + float_V = flyte_V ; + flow_V = renne_V ; + fly_V = vaereV IrregNor.fly_V ; + freeze_V = fryse_V ; + give_V3 = dirV3 gi_V (mkPrep "til"); + hit_V2 = dirV2 (slå_V) ; + hold_V2 = dirV2 (holde_V) ; + hunt_V2 = dirV2 (regV "jakte") ; + kill_V2 = dirV2 (mk2V "drepe" "drepte") ; + laugh_V = mkV "le" "ler" "les" "lo" "ledd" "le" ; + lie_V = ligge_V ; + play_V = mk2V "leke" "lekte" ; + pull_V2 = dirV2 (dra_V) ; + push_V2 = dirV2 (irregV "skyve" "skjøv" "skjøvet") ; + rub_V2 = dirV2 (gni_V) ; + scratch_V2 = dirV2 (regV "klø") ; + sew_V = mk2V "sy" "sydde" ; + sing_V = synge_V ; + sit_V = sitte_V ; + smell_V = regV "lukte" ; + spit_V = regV "spytte" ; + split_V2 = dirV2 (mk2V "kløyve" "kløyvde") ; + squeeze_V2 = dirV2 (mk2V "klemme" "klemte") ; + stab_V2 = dirV2 (stikke_V) ; + stand_V = vaereV stå_V ; + suck_V2 = dirV2 (suge_V) ; + swell_V = partV (regV "hovne") "opp" ; + swim_V = regV "simme" ; + think_V = mk2V "tenke" "tenkte" ; + throw_V2 = dirV2 (regV "kaste") ; + tie_V2 = dirV2 (regV "knytte") ; + turn_V = mk2V "vende" "vendte" ; + vomit_V = partV (regV "kaste") "opp" ; + wash_V2 = dirV2 (regV "vaske") ; + wipe_V2 = dirV2 (regV "tørke") ; + breathe_V = regV "puste" ; + + + grammar_N = regN "grammatikk" ; + language_N = mk2N "språk" "språket" ; + rule_N = mkN "regel" "regelen" "regler" "reglene" ; + + question_N = mk2N "spørsmål" "spørsmålet" ; +---- ready_A = regA "färdig" ; +---- reason_N = regN "anledning" ; + today_Adv = mkAdv "idag" ; +---- uncertain_A = mk3A "osäker" "osäkert" "osäkra" ; + +} ; + +-- a" -> e" 86 +-- ö -> ø 66 +-- ck -> kk 20 +-- ä -> e 44 diff --git a/lib/next-resource/norwegian/MathNor.gf b/lib/next-resource/norwegian/MathNor.gf new file mode 100644 index 000000000..53e9ffd99 --- /dev/null +++ b/lib/next-resource/norwegian/MathNor.gf @@ -0,0 +1,2 @@ +concrete MathNor of Math = CatNor ** MathScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/MorphoNor.gf b/lib/next-resource/norwegian/MorphoNor.gf new file mode 100644 index 000000000..13a87125a --- /dev/null +++ b/lib/next-resource/norwegian/MorphoNor.gf @@ -0,0 +1,171 @@ +--1 A Simple Norwegian Resource Morphology +-- +-- Aarne Ranta 2002 +-- +-- This resource morphology contains definitions needed in the resource +-- syntax. It moreover contains copies of the most usual inflectional patterns +-- as defined in functional morphology (in the Haskell file $RulesSw.hs$). +-- +-- We use the parameter types and word classes defined for morphology. + +resource MorphoNor = CommonScand, ResNor ** open Prelude, Predef in { + +-- genders + +oper + masc = Utr Masc ; + fem = Utr Fem ; + neutr = Neutr ; + +-- type synonyms + + Subst : Type = {s : Number => Species => Case => Str} ; + Adj = Adjective ; + +-- nouns + + mkSubstantive : (_,_,_,_ : Str) -> Subst = + \dreng, drengen, drenger, drengene -> + {s = nounForms dreng drengen drenger drengene} ; + + extNGen : Str -> Gender = \s -> case last s of { + "n" => Utr Masc ; + "a" => Utr Fem ; + _ => Neutr + } ; + + nBil : Str -> Subst = \bil -> + mkSubstantive bil (bil + "en") (bil + "er") (bil + "erne") ** + {h1 = masc} ; + + nUke : Str -> Subst = \uke -> + mkSubstantive uke (init uke + "a") (uke + "r") (uke + "ne") ** + {h1 = fem} ; + + nHus : Str -> Subst = \hus -> + mkSubstantive hus (hus + "et") hus (hus + "ene") ** + {h1 = neutr} ; + + nHotell : Str -> Subst = \hotell -> + mkSubstantive hotell (hotell + "et") (hotell + "er") (hotell + "ene") ** + {h1 = neutr} ; + + + + +-- adjectives + + mkAdject : (_,_,_,_,_ : Str) -> Adj = + \stor,stort,store,storre,storst -> {s = table { + AF (APosit (Strong SgUtr )) c => mkCase c stor ; + AF (APosit (Strong SgNeutr)) c => mkCase c stort ; + AF (APosit _) c => mkCase c store ; + AF ACompar c => mkCase c storre ; + AF (ASuperl SupStrong) c => mkCase c storst ; + AF (ASuperl SupWeak) c => mkCase c (storst + "e") + } + } ; + + aRod : Str -> Adj = \rod -> + mkAdject rod (rod + "t") (rod + "e") (rod + "ere") (rod + "est") ; + + aAbstrakt : Str -> Adj = \abstrakt -> + mkAdject abstrakt abstrakt (abstrakt + "e") (abstrakt + "ere") (abstrakt + "est") ; + + aRask : Str -> Adj = \rask -> + mkAdject rask rask (rask + "e") (rask + "ere") (rask + "est") ; + + aBillig : Str -> Adj = \billig -> + mkAdject billig billig (billig + "e") (billig + "ere") (billig + "st") ; + +-- verbs + + Verbum : Type = {s : VForm => Str} ; + + mkVerb6 : (_,_,_,_,_,_ : Str) -> Verbum = + \spise,spiser,spises,spiste,spist,spis -> {s = table { + VI (VInfin v) => mkVoice v spise ; + VF (VPres Act) => spiser ; + VF (VPres Pass) => spises ; + VF (VPret v) => mkVoice v spiste ; --# notpresent + VI (VSupin v) => mkVoice v spist ; --# notpresent + VI (VPtPret (Strong (SgUtr | SgNeutr)) c) => mkCase c spist ; + VI (VPtPret _ c) => case last spist of { + "a" => mkCase c spist ; + _ => mkCase c (spist + "e") + } ; + VF (VImper v) => mkVoice v spis + } + } ; + + vHusk : Str -> Verbum = \husk -> + let huska : Str = husk + "a" ---- variants {husk + "a" ; husk + "et"} + in + mkVerb6 (husk + "e") (husk + "er") (husk + "es") huska huska husk ; + + vSpis : Str -> Verbum = \spis -> + mkVerb6 (spis + "e") (spis + "er") (spis + "es") (spis + "te") (spis + "t") spis ; + + vLev : Str -> Verbum = \lev -> + let lever = case last lev of { + "r" => lev ; + _ => lev + "er" + } + in + mkVerb6 (lev + "e") lever (lev + "es") (lev + "de") (lev + "d") lev ; + + vBo : Str -> Verbum = \bo -> + mkVerb6 bo (bo + "r") (bo + "es") (bo + "dde") (bo + "dd") bo ; + + regVerb : Str -> Str -> Verbum = \spise, spiste -> + let + spis = init spise ; + te = dp 2 spiste + in + case te of { + "te" => vSpis spis ; + "de" => case last spise of { + "e" => vLev spis ; + _ => vBo spise + } ; + _ => vHusk spis + } ; + + +-- For $Numeral$. + +param DForm = ental | ton | tiotal ; + +oper + LinDigit = {s : DForm => CardOrd => Str} ; + + cardOrd : Str -> Str -> CardOrd => Str = \tre,tredje -> + table { + NCard _ => tre ; + NOrd a => tredje ---- a + } ; + + cardReg : Str -> CardOrd => Str = \syv -> + cardOrd syv (syv + case last syv of { + "n" => "de" ; + "e" => "nde" ; + _ => "ende" + }) ; + + + mkTal : (x1,_,_,_,x5 : Str) -> LinDigit = + \två, tolv, tjugo, andra, tolfte -> + {s = table { + ental => cardOrd två andra ; + ton => cardOrd tolv tolfte ; + tiotal => cardReg tjugo + } + } ; + + numPl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \n -> + {s = n ; n = Pl} ; + + invNum : CardOrd = NCard Neutr ; + + +} diff --git a/lib/next-resource/norwegian/NounNor.gf b/lib/next-resource/norwegian/NounNor.gf new file mode 100644 index 000000000..d3aa276ab --- /dev/null +++ b/lib/next-resource/norwegian/NounNor.gf @@ -0,0 +1,2 @@ +concrete NounNor of Noun = CatNor ** NounScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/NumeralNor.gf b/lib/next-resource/norwegian/NumeralNor.gf new file mode 100644 index 000000000..0d0a6e907 --- /dev/null +++ b/lib/next-resource/norwegian/NumeralNor.gf @@ -0,0 +1,85 @@ +concrete NumeralNor of Numeral = CatNor ** open MorphoNor in { + +lincat + Digit = {s : DForm => CardOrd => Str} ; + Sub10 = {s : DForm => CardOrd => Str ; n : Number} ; + Sub100, Sub1000, Sub1000000 = + {s : CardOrd => Str ; n : Number} ; + +lin + num x = x ; + + n2 = mkTal "to" "tolv" "tjue" "andre" "tolfte" ; + n3 = mkTal "tre" "tretten" "tretti" "tredje" "trettende" ; + n4 = mkTal "fire" "fjorten" "førti" "fjerde" "fjortende" ; + n5 = mkTal "fem" "femten" "femti" "femte" "femtende" ; + n6 = mkTal "seks" "seksten" "seksti" "sjette" "sextende" ; + n7 = mkTal "sju" "sytten" "sytti" "syvende" "syttende" ; + n8 = mkTal "åtte" "atten" "åtti" "åttende" "attende" ; + n9 = mkTal "ni" "nitten" "nitti" "niende" "nittende" ; + + pot01 = { + s = \\f => table { + NCard g => case g of {Neutr => "ett" ; _ => "en"} ; + _ => "første" + } ; + n = Sg + } ; + pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ; + pot110 = numPl (cardReg "ti") ; + pot111 = numPl (cardOrd "elve" "elfte") ; + pot1to19 d = numPl (d.s ! ton) ; + pot0as1 n = {s = n.s ! ental ; n = n.n} ; + pot1 d = numPl (d.s ! tiotal) ; + pot1plus d e = {s = \\g => d.s ! tiotal ! invNum ++ e.s ! ental ! g ; n = Pl} ; + pot1as2 n = n ; + pot2 d = + numPl (\\g => d.s ! ental ! invNum ++ cardOrd "hundre" "hundrede" ! g) ; + pot2plus d e = + {s = \\g => d.s ! ental ! invNum ++ "hundre" ++ "og" ++ e.s ! g ; n = Pl} ; + pot2as3 n = n ; + pot3 n = + numPl (\\g => n.s ! invNum ++ cardOrd "tusen" "tusende" ! g) ; + pot3plus n m = + {s = \\g => n.s ! invNum ++ "tusen" ++ "og" ++ m.s ! g ; n = Pl} ; + +-- Numerals from sequences of digits. + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard neutrum ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1:e" Sg ; + D_2 = mk2Dig "2" "2:e" ; + D_3 = mkDig "3" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":e") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ => o} ; + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + +} + diff --git a/lib/next-resource/norwegian/ParadigmsNor.gf b/lib/next-resource/norwegian/ParadigmsNor.gf new file mode 100644 index 000000000..cdb71a1e6 --- /dev/null +++ b/lib/next-resource/norwegian/ParadigmsNor.gf @@ -0,0 +1,502 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +--1 Norwegian Lexical Paradigms +-- +-- Aarne Ranta 2003 +-- +-- 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. +-- It covers the "bokmål" variant of Norwegian. +-- +-- Closed categories (determiners, pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural$. +-- +-- The main difference with $MorphoNor.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 structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- 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 [``IrregNor`` ../../norwegian/IrregNor], +-- which covers irregularly inflected verbs. + +resource ParadigmsNor = + open + (Predef=Predef), + Prelude, + CommonScand, + ResNor, + MorphoNor, + CatNor in { + +--2 Parameters +-- +-- To abstract over gender names, we define the following identifiers. + +oper + Gender : Type ; + + masculine : Gender ; + feminine : Gender ; + neutrum : 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 ; + +-- Prepositions used in many-argument functions are just strings. + + mkPrep : Str -> Prep ; + noPrep : Prep ; -- empty string + +--2 Nouns + +-- The regular function takes the singular indefinite form +-- and computes the other forms and the gender by a heuristic. +-- The heuristic is that nouns ending "e" are feminine like "kvinne", +-- all others are masculine like "bil". +-- Giving gender manually makes the heuristic more reliable. +-- One can also compute the gender from the definite form. +-- gender is computed from the definite form. +-- If in doubt, use the $cc$ command to test! +-- In the worst case, give all four forms. The gender is computed from the +-- last letter of the second form (if "n", then $utrum$, otherwise $neutrum$). + + mkN : overload { + mkN : Str -> N ; + mkN : Str -> Gender -> N ; + mkN : (bil,bilen : Str) -> N ; + mkN : (dreng,drengen,drenger,drengene : Str) -> N + } ; + + + +--3 Compound nouns +-- +-- All the functions above work quite as well to form compound nouns, +-- such as "fotboll". + + +--3 Relational nouns +-- +-- Relational nouns ("datter til x") need a preposition. + + mkN2 : N -> Prep -> N2 ; + +-- The most common preposition is "av", and the following is a +-- shortcut for regular, $nonhuman$ relational nouns with "av". + + regN2 : Str -> Gender -> N2 ; + +-- Use the function $mkPrep$ or see the section on prepositions below to +-- form other prepositions. +-- +-- Three-place relational nouns ("forbindelse fra x til y") +-- need two prepositions. + + mkN3 : N -> Prep -> Prep -> N3 ; + + +--3 Relational common noun phrases +-- +-- In some cases, you may want to make a complex $CN$ into a +-- relational noun (e.g. "den gamle kongen av"). However, $N2$ and +-- $N3$ are purely lexical categories. But you can use the $AdvCN$ +-- and $PrepNP$ constructions to build phrases like this. + +-- +--3 Proper names and noun phrases +-- +-- Proper names, with a regular genitive, are formed as follows +-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". + + mkPN : overload { + mkPN : Str -> PN ; -- masculine + mkPN : Str -> Gender -> PN ; + mkPN : N -> PN ; + } ; + + +--2 Adjectives + +-- The regular pattern works for many adjectives, e.g. those ending +-- with "ig". Two, five, or at worst five forms are sometimes needed. + + mkA : overload { + mkA : (fin : Str) -> A ; + mkA : (fin,fint : Str) -> A ; + mkA : (galen,galet,galne : Str) -> A ; + mkA : (stor,stort,store,storre,storst : Str) -> A ; + +-- If comparison is formed by "mer", "mest", as in general for +-- long adjective, the following pattern is used: + + mkA : A -> A ; -- -/mer/mest norsk + } ; + + +--3 Two-place adjectives +-- +-- Two-place adjectives need a preposition for their second argument. + + mkA2 : A -> Prep -> A2 ; + + + +--2 Adverbs + +-- Adverbs are not inflected. Most lexical ones have position +-- after the verb. Some follow the verb (e.g. "altid"). + + mkAdv : Str -> Adv ; -- e.g. her + mkAdV : Str -> AdV ; -- e.g. altid + +-- Adverbs modifying adjectives and sentences can also be formed. + + mkAdA : Str -> AdA ; + + +--2 Verbs +-- + + mkV : overload { + +-- The 'regular verb' function is the first conjugation. + + mkV : (snakke : Str) -> V ; + +-- The almost regular verb function needs the infinitive and the preteritum. + + mkV : (leve,levde : Str) -> V ; + +-- There is an extensive list of irregular verbs in the module $IrregNor$. +-- In practice, it is enough to give three forms, as in school books. + + mkV : (drikke, drakk, drukket : Str) -> V ; + +-- The worst case needs six forms. + + mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; + +--3 Verbs with a particle. +-- +-- The particle, such as in "lukke opp", is given as a string. + + mkV : V -> Str -> V ; + } ; + + + +--3 Verbs with 'være' as auxiliary +-- +-- By default, the auxiliary is "have". This function changes it to "være". + + vaereV : V -> V ; + + + +--3 Deponent verbs. +-- +-- Some words are used in passive forms only, e.g. "trives", some as +-- reflexive e.g. "forestille seg". + + depV : V -> V ; + reflV : V -> V ; + +--3 Two-place verbs +-- +-- Two-place verbs need a preposition, except the special case with direct object. +-- (transitive verbs). Notice that, if a particle is needed, it comes from the $V$. + + mkV2 : overload { + mkV2 : Str -> V2 ; + mkV2 : V -> V2 ; + mkV2 : V -> Prep -> V2 ; + } ; + + +--3 Three-place verbs +-- +-- Three-place (ditransitive) verbs need two prepositions, of which +-- the first one or both can be absent. + + mkV3 : V -> Prep -> Prep -> V3 ; -- snakke, med, om + dirV3 : V -> Prep -> V3 ; -- gi,_,til + dirdirV3 : V -> V3 ; -- gi,_,_ + +--3 Other complement patterns +-- +-- Verbs and adjectives can take complements such as sentences, +-- questions, verb phrases, and adjectives. + + mkV0 : V -> V0 ; + mkVS : V -> VS ; + mkV2S : V -> Prep -> V2S ; + mkVV : V -> VV ; + mkV2V : V -> Prep -> Prep -> V2V ; + mkVA : V -> VA ; + mkV2A : V -> Prep -> V2A ; + mkVQ : V -> VQ ; + mkV2Q : V -> Prep -> V2Q ; + + mkAS : A -> AS ; + mkA2S : A -> Prep -> A2S ; + mkAV : A -> AV ; + mkA2V : A -> Prep -> A2V ; + +-- Notice: categories $AS, A2S, AV, A2V$ are just $A$. +-- $V0$ is just $V$. + + V0 : Type ; + AS, A2S, AV, A2V : Type ; + + +--. +--2 Definitions of the paradigms +-- +-- The definitions should not bother the user of the API. So they are +-- hidden from the document. + + Gender = MorphoNor.Gender ; + Number = MorphoNor.Number ; + Case = MorphoNor.Case ; + masculine = Utr Masc ; + feminine = Utr Fem ; + neutrum = Neutr ; + singular = Sg ; + plural = Pl ; + nominative = Nom ; + genitive = Gen ; + + mk4N x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ; + + regN x = regGenN x g where { + g = case of { + _ + "e" => Utr Fem ; + _ => Utr Masc + } + } ; + + regGenN x g = case last x of { + "e" => case g of { + Utr Masc => mk4N x (x + "n") (x + "r") (x + "ne") ; + Utr Fem => mk4N x (init x + "a") (x + "r") (x + "ne") ; + Neutr => mk4N x (x + "t") (x + "r") (init x + "a") + } ; + _ => case g of { + Utr Masc => mk4N x (x + "en") (x + "er") (x + "ene") ; + Utr Fem => mk4N x (x + "a") (x + "er") (x + "ene") ; + Neutr => mk4N x (x + "et") (x + "") (x + "a") + } + } ; + + mk2N x y = case last y of { + "n" => regGenN x masculine ; + "a" => regGenN x feminine ; + _ => regGenN x neutrum + } ; + + + mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = mkComplement p.s} ; + regN2 n g = mkN2 (regGenN n g) (mkPrep "av") ; + mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = mkComplement p.s ; c3 = mkComplement q.s} ; + + regGenPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ; + regPN n = regGenPN n utrum ; + nounPN n = {s = n.s ! singular ! Indef ; g = n.g ; lock_PN = <>} ; + +-- To form a noun phrase that can also be plural and have an irregular +-- genitive, you can use the worst-case function. + + makeNP : Str -> Str -> Number -> Gender -> NP ; + makeNP x y n g = + {s = table {NPPoss _ => x ; _ => y} ; a = agrP3 g n ; + lock_NP = <>} ; + + mk3A a b c = (mkAdject a b c [] []) ** {isComp = False ; lock_A = <>} ; + mk2A a b = mk3A a b (a + "e") ; + regA a = (regADeg a) ** {isComp = False ; lock_A = <>} ; + + mkA2 a p = a ** {c2 = mkComplement p.s ; lock_A2 = <>} ; + + mkADeg a b c d e = mkAdject a b c d e ** {isComp = False ; lock_A = <>} ; + regADeg a = case Predef.dp 2 a of { + "ig" => aBillig a ; + "sk" => aRask a ; + _ => aRod a + } ** {isComp = False ; lock_A = <>} ; + irregADeg a b c = mkAdject a (a + "t") (a + "e") b c ** + {isComp = False ; lock_A = <>} ; + mk3ADeg a b c = mkAdject a b c (a + "ere") (a + "est") ** + {isComp = False ; lock_A = <>} ; + mk2ADeg a b = mkAdject a b (a + "e") (a + "ere") (a + "est") ** + {isComp = False ; lock_A = <>} ; + + compoundA adj = {s = adj.s ; isComp = True ; lock_A = <>} ; + + mkAdv x = ss x ** {lock_Adv = <>} ; + mkAdV x = ss x ** {lock_AdV = <>} ; + mkAdA x = ss x ** {lock_AdA = <>} ; + + mkPrep p = {s = p ; lock_Prep = <>} ; + noPrep = mkPrep [] ; + + mk6V a b c d e f = mkVerb6 a b c d e f ** + {part = [] ; vtype = VAct ; isVaere = False ; lock_V = <>} ; + + regV a = case last a of { + +--3 Verbs with a particle. +-- +-- The particle, such as in "lukke opp", is given as a string. + + + +--3 Verbs with a particle. +-- +-- The particle, such as in "lukke opp", is given as a string. + + + "e" => vHusk (init a) ; + _ => vBo a + } ** {part = [] ; vtype = VAct ; isVaere = False ; lock_V = <>} ; + + mk2V a b = regVerb a b ** {part = [] ; vtype = VAct ; isVaere = False ; lock_V = <>} ; + + irregV = + \drikke,drakk,drukket -> + let + drikk = case last drikke of { + "e" => init drikke ; + _ => drikke + } ; + drikker = case last (init drikke) of { + "r" => init drikke ; + _ => drikke + "r" + } + in + mk6V drikke drikker (drikke + "s") drakk drukket drikk ; + + vaereV v = { + s = v.s ; + part = [] ; + vtype = v.vtype ; + isVaere = True ; + lock_V = <> + } ; + + partV v p = {s = v.s ; part = p ; vtype = v.vtype ; isVaere = v.isVaere ; lock_V = <>} ; + depV v = {s = v.s ; part = v.part ; vtype = VPass ; isVaere = False ; lock_V = <>} ; + reflV v = {s = v.s ; part = v.part ; vtype = VRefl ; isVaere = False ; lock_V = <>} ; + + mk2V2 v p = v ** {c2 = mkComplement p.s ; lock_V2 = <>} ; + dirV2 v = mk2V2 v noPrep ; + + mkV3 v p q = v ** {c2 = mkComplement p.s ; c3 = mkComplement 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 = mk2V2 v p ** {lock_V2S = <>} ; + mkVV v = v ** {c2 = mkComplement "å" ; lock_VV = <>} ; + mkV2V v p t = mk2V2 v p ** {c3 = mkComplement "att" ; lock_V2V = <>} ; + mkVA v = v ** {lock_VA = <>} ; + mkV2A v p = mk2V2 v p ** {lock_V2A = <>} ; + mkVQ v = v ** {lock_VQ = <>} ; + mkV2Q v p = mk2V2 v p ** {lock_V2Q = <>} ; + + 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_A = <>} ; + + V0 : Type = V ; + AS, A2S, AV : Type = A ; + A2V : Type = A2 ; + + +--------- + + mk2N : (bil,bilen : Str) -> N ; + mk4N : (dreng,drengen,drenger,drengene : Str) -> N ; + regN : Str -> N ; + regGenN : Str -> Gender -> N ; + mk2N : (bil,bilen : Str) -> N ; + + mkN = overload { + mkN : Str -> N = regN ; + mkN : Str -> Gender -> N = regGenN ; + mkN : (bil,bilen : Str) -> N = mk2N ; + mkN : (dreng,drengen,drenger,drengene : Str) -> N = mk4N + } ; + + mkPN = overload { + mkPN : Str -> PN = regPN ; -- masculine + mkPN : Str -> Gender -> PN = regGenPN ; + mkPN : N -> PN = nounPN ; + } ; + + regPN : Str -> PN ; -- utrum + regGenPN : Str -> Gender -> PN ; + nounPN : N -> PN ; + + mkA = overload { + mkA : (fin : Str) -> A = regADeg ; + mkA : (fin,fint : Str) -> A = mk2ADeg ; + mkA : (galen,galet,galne : Str) -> A = mk3ADeg ; + mkA : (stor,stort,store,storre,storst : Str) -> A = mkADeg ; + mkA : A -> A = compoundA ; -- -/mer/mest norsk + } ; + + mk3A : (galen,galet,galne : Str) -> A ; + regA : Str -> A ; + mk2A : (stor,stort : Str) -> A ; + mkADeg : (stor,stort,store,storre,storst : Str) -> A ; + regADeg : Str -> A ; + irregADeg : (tung,tyngre,tyngst : Str) -> A ; + mk3ADeg : (galen,galet,galne : Str) -> A ; + mk2ADeg : (bred,bredt : Str) -> A ; + compoundA : A -> A ; -- -/mer/mest norsk + + mkV = overload { + mkV : (snakke : Str) -> V = regV ; + mkV : (leve,levde : Str) -> V = mk2V ; + mkV : (drikke, drakk, drukket : Str) -> V = irregV ; + mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V = mk6V ; + mkV : V -> Str -> V = partV ; + } ; + + + regV : (snakke : Str) -> V ; + mk2V : (leve,levde : Str) -> V ; + irregV : (drikke, drakk, drukket : Str) -> V ; + mk6V : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; + partV : V -> Str -> V ; + + + mkV2 = overload { + mkV2 : Str -> V2 = \s -> dirV2 (regV s) ; + mkV2 : V -> V2 = dirV2 ; + mkV2 : V -> Prep -> V2 = mk2V2 ; + } ; + + mk2V2 : V -> Prep -> V2 ; + dirV2 : V -> V2 ; + +} ; diff --git a/lib/next-resource/norwegian/PhraseNor.gf b/lib/next-resource/norwegian/PhraseNor.gf new file mode 100644 index 000000000..da463adb1 --- /dev/null +++ b/lib/next-resource/norwegian/PhraseNor.gf @@ -0,0 +1,2 @@ +concrete PhraseNor of Phrase = CatNor ** PhraseScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/QuestionNor.gf b/lib/next-resource/norwegian/QuestionNor.gf new file mode 100644 index 000000000..8a7c08e0f --- /dev/null +++ b/lib/next-resource/norwegian/QuestionNor.gf @@ -0,0 +1,2 @@ +concrete QuestionNor of Question = CatNor ** QuestionScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/RelativeNor.gf b/lib/next-resource/norwegian/RelativeNor.gf new file mode 100644 index 000000000..18be3bc45 --- /dev/null +++ b/lib/next-resource/norwegian/RelativeNor.gf @@ -0,0 +1,2 @@ +concrete RelativeNor of Relative = CatNor ** RelativeScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/ResNor.gf b/lib/next-resource/norwegian/ResNor.gf new file mode 100644 index 000000000..490389ad2 --- /dev/null +++ b/lib/next-resource/norwegian/ResNor.gf @@ -0,0 +1,3 @@ +instance ResNor of ResScand = DiffNor ** open CommonScand, Prelude in { +} ; + diff --git a/lib/next-resource/norwegian/SentenceNor.gf b/lib/next-resource/norwegian/SentenceNor.gf new file mode 100644 index 000000000..eeca680ab --- /dev/null +++ b/lib/next-resource/norwegian/SentenceNor.gf @@ -0,0 +1,2 @@ +concrete SentenceNor of Sentence = CatNor ** SentenceScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/norwegian/StructuralNor.gf b/lib/next-resource/norwegian/StructuralNor.gf new file mode 100644 index 000000000..4e0814915 --- /dev/null +++ b/lib/next-resource/norwegian/StructuralNor.gf @@ -0,0 +1,129 @@ +concrete StructuralNor of Structural = CatNor ** + open MorphoNor, ParadigmsNor, Prelude in { + + flags optimize=all ; + + lin + above_Prep = ss "ovenfor" ; + after_Prep = ss "etter" ; + by8agent_Prep = ss "av" ; + all_Predet = {s = gennumForms "all" "alt" "alle"} ; + almost_AdA, almost_AdN = ss "nesten" ; + although_Subj = ss ["selv om"] ; + always_AdV = ss "altid" ; + and_Conj = {s1 = [] ; s2 = "og" ; n = Pl} ; + because_Subj = ss "fordi" ; + before_Prep = ss "før" ; + behind_Prep = ss "bakom" ; + between_Prep = ss "mellom" ; + both7and_DConj = sd2 "både" "og" ** {n = Pl} ; + but_PConj = ss "men" ; + by8means_Prep = ss "med" ; + can8know_VV, can_VV = + mkV "kunne" "kan" "kunn" "kunne" "kunnet" "kunnen" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + during_Prep = ss "under" ; + either7or_DConj = sd2 "enten" "eller" ** {n = Sg} ; + everybody_NP = regNP "alle" "alles" Plg ; + every_Det = {s = \\_,_ => "hver" ; n = Sg ; det = DDef Indef} ; + everything_NP = regNP "alt" "alts" SgNeutr ; + everywhere_Adv = ss "overalt" ; + few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ; +--- first_Ord = {s = "første" ; isDet = True} ; DEPREC + for_Prep = ss "for" ; + from_Prep = ss "fra" ; + he_Pron = MorphoNor.mkNP "han" "ham" "hans" "hans" "hans" SgUtr P3 ; + here_Adv = ss "her" ; + here7to_Adv = ss "hit" ; + here7from_Adv = ss "herfra" ; + how_IAdv = ss "hvor" ; + how8many_IDet = {s = \\_ => ["hur mange"] ; n = Pl ; det = DDef Indef} ; + if_Subj = ss "hvis" ; + in8front_Prep = ss "foran" ; + i_Pron = + MorphoNor.mkNP "jeg" "meg" (variants {"min" ; "mi"}) "mit" "mine" SgUtr P1 ; --- mi + in_Prep = ss "i" ; + it_Pron = MorphoNor.regNP "det" "dets" SgNeutr ; + less_CAdv = ss "mindre" ; + many_Det = {s = \\_,_ => "mange" ; n = Pl ; det = DDef Indef} ; + more_CAdv = ss "mer" ; + most_Predet = {s = gennumForms ["den meste"] ["det meste"] ["de fleste"]} ; + much_Det = {s = \\_,_ => "mye" ; n = Pl ; det = DDef Indef} ; + must_VV = + mkV "måtte" "må" "må" "måtte" "måttet" "mått" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + no_Utt = ss ["nei"] ; + on_Prep = ss "på" ; +--- one_Quant = {s = \\_ => genderForms ["en"] ["et"] ; n = Sg ; det = DIndef} ; DEPREC + only_Predet = {s = \\_ => "kun"} ; + or_Conj = {s1 = [] ; s2 = "eller" ; n = Pl} ; + otherwise_PConj = ss "annarledes" ; + part_Prep = ss "av" ; + please_Voc = ss "takk" ; --- + possess_Prep = ss "av" ; + quite_Adv = ss "temmelig" ; + she_Pron = MorphoNor.mkNP "hun" "henne" "hennes" "hennes" "hennes" SgUtr P3 ; + so_AdA = ss "så" ; + someSg_Det = {s = \\_ => genderForms "noen" "noe" ; n = Sg ; det = DIndef} ; + somePl_Det = {s = \\_,_ => "noen" ; n = Pl ; det = DIndef} ; + somebody_NP = regNP "noen" "noens" SgUtr ; + something_NP = regNP "noe" "noes" SgNeutr ; + somewhere_Adv = ss ["et eller annet sted"] ; ---- ? + that_Quant = + {s = table { + Sg => \\_,_ => genderForms ["den der"] ["det der"] ; + Pl => \\_,_,_ => ["de der"] + } ; + det = DDef Indef + } ; + there_Adv = ss "der" ; + there7to_Adv = ss "dit" ; + there7from_Adv = ss "derfra" ; + therefore_PConj = ss "derfor" ; + they_Pron = MorphoNor.mkNP "de" "dem" "deres" "deres" "deres" Plg P1 ; + this_Quant = + {s = table { + Sg => \\_,_ => genderForms ["denne"] ["dette"] ; + Pl => \\_,_,_ => ["disse"] + } ; + det = DDef Def + } ; + through_Prep = ss "gjennom" ; + too_AdA = ss "for" ; + to_Prep = ss "til" ; + under_Prep = ss "under" ; + very_AdA = ss "mye" ; + want_VV = + mkV "ville" "vil" "vill" "ville" "villet" "villed" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + we_Pron = MorphoNor.mkNP "vi" "oss" "vår" "vårt" "våre" Plg P1 ; + whatSg_IP = {s = \\_ => "hva" ; gn = SgUtr} ; ---- infl + whatPl_IP = {s = \\_ => "hva" ; gn = Plg} ; ---- infl + when_IAdv = ss "når" ; + when_Subj = ss "når" ; + where_IAdv = ss "hver" ; + which_IQuant = { + s = table { + Sg => genderForms "hvilken" "hvilket" ; + Pl => \\_ => "hvilke" + } ; + det = DIndef + } ; + whoSg_IP = {s = vem.s ; gn = SgUtr} ; + whoPl_IP = {s = \\_ => "hvilke" ; gn = Plg} ; + why_IAdv = ss "hvorfor" ; + without_Prep = ss "uten" ; + with_Prep = ss "med" ; + yes_Utt = ss ["ja"] ; + youSg_Pron = + MorphoNor.mkNP "du" "deg" (variants {"din" ; "di"}) "dit" "dine" SgUtr P2 ; ---- + youPl_Pron = MorphoNor.mkNP "dere" "dere" "deres" "deres" "deres" Plg P2 ; + youPol_Pron = MorphoNor.mkNP "Dere" "Dere" "Deres" "Deres" "Deres" SgUtr P2 ; --- wrong in refl + +-- Auxiliaries that are used repeatedly. + + oper + vem = MorphoNor.mkNP "hvem" "hvem" "hvis" "hvis" "hvis" SgUtr P3 ; + +} + diff --git a/lib/next-resource/norwegian/VerbNor.gf b/lib/next-resource/norwegian/VerbNor.gf new file mode 100644 index 000000000..cd816e2fc --- /dev/null +++ b/lib/next-resource/norwegian/VerbNor.gf @@ -0,0 +1,2 @@ +concrete VerbNor of Verb = CatNor ** VerbScand with + (ResScand = ResNor) ; diff --git a/lib/next-resource/scandinavian/AdjectiveScand.gf b/lib/next-resource/scandinavian/AdjectiveScand.gf new file mode 100644 index 000000000..1570574cb --- /dev/null +++ b/lib/next-resource/scandinavian/AdjectiveScand.gf @@ -0,0 +1,44 @@ +incomplete concrete AdjectiveScand of Adjective = + CatScand ** open CommonScand, ResScand, Prelude in { + + lin + + PositA a = { + s = \\ap => a.s ! AF (APosit ap) Nom ; + isPre = True + } ; + ComparA a np = { + s = \\ap => case a.isComp of { + True => compMore ++ a.s ! AF (APosit ap) Nom ; + _ => a.s ! AF ACompar Nom + } + ++ conjThan ++ np.s ! nominative ; + isPre = False + } ; + +-- $SuperlA$ belongs to determiner syntax in $Noun$. + + ComplA2 a np = { + s = \\ap => a.s ! AF (APosit ap) Nom ++ a.c2.s ++ np.s ! accusative ; + isPre = False + } ; + + ReflA2 a = { + s = \\ap => a.s ! AF (APosit ap) Nom ++ a.c2.s ++ + reflPron (agrP3 utrum Sg) ; ---- + 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 ; + +} diff --git a/lib/next-resource/scandinavian/AdverbScand.gf b/lib/next-resource/scandinavian/AdverbScand.gf new file mode 100644 index 000000000..1afa40cf1 --- /dev/null +++ b/lib/next-resource/scandinavian/AdverbScand.gf @@ -0,0 +1,27 @@ +incomplete concrete AdverbScand of Adverb = CatScand ** open CommonScand, ResScand, Prelude in { + + lin + PositAdvAdj a = { + s = a.s ! adverbForm + } ; + ComparAdvAdj cadv a np = { + s = cadv.s ++ a.s ! adverbForm ++ conjThan ++ np.s ! nominative + } ; + ComparAdvAdjS cadv a s = { + s = cadv.s ++ a.s ! adverbForm ++ conjThan ++ s.s ! Sub + } ; + + PrepNP prep np = {s = prep.s ++ np.s ! accusative} ; + + AdAdv = cc2 ; + + SubjS subj s = { + s = subj.s ++ s.s ! Sub + } ; + + AdnCAdv cadv = {s = cadv.s ++ conjThan} ; + + oper + adverbForm : AForm = AF (APosit (Strong SgNeutr)) Nom ; + +} diff --git a/lib/next-resource/scandinavian/CatScand.gf b/lib/next-resource/scandinavian/CatScand.gf new file mode 100644 index 000000000..3b55f755f --- /dev/null +++ b/lib/next-resource/scandinavian/CatScand.gf @@ -0,0 +1,105 @@ +incomplete concrete CatScand of Cat = + CommonX ** open ResScand, Prelude, CommonScand, (R = ParamX) in { + + flags optimize=all_subs ; + + lincat + +-- Tensed/Untensed + + S = {s : Order => Str} ; + QS = {s : QForm => Str} ; + RS = {s : Agr => Str ; c : NPForm} ; + SSlash = {s : Order => Str ; n3 : Agr => Str ; c2 : Complement} ; + +-- Sentence + + Cl = {s : R.Tense => Anteriority => Polarity => Order => Str} ; + ClSlash = { + s : R.Tense => Anteriority => Polarity => Order => Str ; + n3 : Agr => Str ; + c2 : Complement + } ; + Imp = {s : Polarity => Number => Str} ; + +-- Question + + QCl = {s : R.Tense => Anteriority => Polarity => QForm => Str} ; + IP = {s : NPForm => Str ; gn : GenNum} ; + IComp = {s : AFormPos => Str} ; + IDet = {s : Gender => Str ; n : Number ; det : DetSpecies} ; + IQuant = {s : Number => Gender => Str ; det : DetSpecies} ; + +-- Relative; the case $c$ is for "det" clefts. + + RCl = {s : R.Tense => Anteriority => Polarity => Agr => Str ; c : NPForm} ; + RP = {s : GenNum => RCase => Str ; a : RAgr} ; + +-- Verb + + VP = { + s : VPForm => { + fin : Str ; -- V1 har ---s1 + inf : Str -- V2 sagt ---s4 + } ; + a1 : Polarity => Str ; -- A1 inte ---s3 + n2 : Agr => Str ; -- N2 dig ---s5 + a2 : Str ; -- A2 idag ---s6 + ext : Str ; -- S-Ext att hon går ---s7 + en2,ea2,eext : Bool -- indicate if the field exists + } ; + VPSlash = CommonScand.VP ** { + n3 : Agr => Str ; -- object-control complement + c2 : Complement + } ; + Comp = {s : AFormPos => Str} ; + + +-- Adjective + + AP = {s : AFormPos => Str ; isPre : Bool} ; + +-- Noun + +-- The fields $isMod$ and $isDet$, and the boolean parameter of +-- determiners, are a hack (the simples possible we found) that +-- permits treating definite articles "huset - de fem husen - det gamla huset" +-- as $Quant$. + + CN = {s : Number => DetSpecies => Case => Str ; g : Gender ; isMod : Bool} ; + NP,Pron = {s : NPForm => Str ; a : Agr} ; + Det = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ; + Quant = {s : Number => Bool => Bool => Gender => Str ; det : DetSpecies} ; + Predet = {s : GenNum => Str} ; + Num = {s : Gender => Str ; isDet : Bool ; n : Number} ; + Card = {s : Gender => Str ; n : Number} ; + Ord = {s : Str} ; + +-- Numeral + + Numeral = {s : CardOrd => Str ; n : Number} ; + Digits = {s : CardOrd => Str ; n : Number} ; + +-- Structural + + Conj = {s1,s2 : Str ; n : Number} ; + Subj = {s : Str} ; + Prep = {s : Str} ; + +-- Open lexical classes, e.g. Lexicon + + V, VS, VQ, VA = Verb ; + V2, VV, V2Q, V2S, V2A = Verb ** {c2 : Complement} ; + V3, V2V = Verb ** {c2,c3 : Complement} ; + + A = Adjective ** {isComp : Bool} ; + -- {s : AForm => Str} ; + A2 = Adjective ** {isComp : Bool ; c2 : Complement} ; + + N = Noun ; + -- {s : Number => Species => Case => Str ; g : Gender} ; + N2 = Noun ** {c2 : Complement} ; + N3 = Noun ** {c2,c3 : Complement} ; + PN = {s : Case => Str ; g : Gender} ; + +} diff --git a/lib/next-resource/scandinavian/CommonScand.gf b/lib/next-resource/scandinavian/CommonScand.gf new file mode 100644 index 000000000..487082305 --- /dev/null +++ b/lib/next-resource/scandinavian/CommonScand.gf @@ -0,0 +1,310 @@ +--1 Auxiliary operations common for Scandinavian languages. +-- +-- This module contains operations that are shared by the Scandinavian +-- languages. The complete set of auxiliary operations needed to +-- implement [Test Test.html] is defined in [ResScandinavian ResScandinavian.html], +-- which depends on [DiffScandinavian DiffScandinavian.html]. + +resource CommonScand = ParamX ** open Prelude in { + + flags optimize=all ; + +param + Species = Indef | Def ; + Case = Nom | Gen ; + Voice = Act | Pass ; + + Order = Main | Inv | Sub ; + + DetSpecies = DIndef | DDef Species ; + + GenNum = SgUtr | SgNeutr | Plg ; + + AForm = AF AFormGrad Case ; + + AFormGrad = + APosit AFormPos + | ACompar + | ASuperl AFormSup ; + +-- The $Number$ in $Weak$ only matters in "lilla"/"små". + + AFormPos = Strong GenNum | Weak Number ; + AFormSup = SupStrong | SupWeak ; + + VForm = + VF VFin + | VI VInf ; + + VFin = + VPres Voice + | VPret Voice --# notpresent + | VImper Voice + ; + + VInf = + VInfin Voice + | VSupin Voice --# notpresent + | VPtPret AFormPos Case + ; + + VPForm = + VPFinite Tense Anteriority + | VPImperat + | VPInfinit Anteriority ; + + VType = VAct | VPass | VRefl ; + + NPForm = NPNom | NPAcc | NPPoss GenNum ; +--- AdjPronForm = APron GenNum Case ; +--- AuxVerbForm = AuxInf | AuxPres | AuxPret | AuxSup ; + + RCase = RNom | RGen | RPrep Bool ; + + RAgr = RNoAg | RAg {gn : GenNum ; p : Person} ; + +oper + Complement : Type = {s : Str ; hasPrep : Bool} ; + + Agr : PType = {gn : GenNum ; p : Person} ; + + nominative : NPForm = NPNom ; + accusative : NPForm = NPAcc ; + + caseNP : NPForm -> Case = \np -> case np of { + NPPoss _ => Gen ; + _ => Nom + } ; + + specDet : DetSpecies -> Species = \d -> case d of { + DDef Def => Def ; + _ => Indef + } ; + + mkComplement : Str -> Complement = \s -> { + s = s ; + hasPrep = case s of { + "" => False ; + _ => True + } + } ; +-- Used in $Noun.AdjCN$. + +----- agrAdj : GenNum -> DetSpecies -> AFormPos = \gn,d -> Strong gn ; --- debug + agrAdj : GenNum -> DetSpecies -> AFormPos = \gn,d -> + case < : GenNum * DetSpecies> of { + <_, DIndef> => Strong gn ; + => Weak Pl ; + _ => Weak Sg + } ; + +-- Used in $DiffScand.predV$. + + vFin : Tense -> Voice -> VForm = \t,v -> case t of { + Pres => VF (VPres v) ; + Past => VF (VPret v) ; --# notpresent + _ => VI (VInfin v) --- not to be used? + } ; + +-- Used in $ConjunctionScand$. + + conjGenNum : (_,_ : GenNum) -> GenNum = \g,h -> case of { + => SgUtr ; + => Plg ; + <_, Plg> => Plg ; + _ => SgNeutr + } ; + + conjAgr : (_,_ : Agr) -> Agr = \a,b -> { + gn = conjGenNum a.gn b.gn ; + p = conjPerson a.p b.p + } ; + +--- + +-- For $Lex$. + +-- For each lexical category, here are the worst-case constructors. +-- +-- But $mkNoun$ is fully defined only for each language, since +-- $Gender$ varies. + + nounForms : (x1,_,_,x4 : Str) -> (Number => Species => Case => Str) = + \man,mannen,men,mennen -> \\n,d,c => case of { + => mkCase c man ; + => mkCase c mannen ; + => mkCase c men ; + => mkCase c mennen + } ; + + Adjective : Type = {s : AForm => Str} ; + + mkAdjective : (x1,_,_,_,_,_,x7 : Str) -> {s : AForm => Str} = + \liten, litet, lilla, sma, mindre, minst, minsta -> { + s = table { + AF (APosit a) c => mkCase c (mkAdjPos a liten litet lilla sma) ; + AF ACompar c => mkCase c mindre ; + AF (ASuperl SupStrong) c => mkCase c minst ; + AF (ASuperl SupWeak) c => mkCase c minsta + } + } ; + + mkVerb : (x1,_,_,_,_,_,_,x8 : Str) -> {s : VForm => Str ; vtype : VType} = + \finna,finner,finn,fann,funnit,funnen,funnet,funna -> { + s = table { + VF (VPres Act) => finner ; + VF (VPres Pass) => mkVoice Pass finn ; + VF (VPret v) => mkVoice v fann ; --# notpresent + VF (VImper v) => mkVoice v finn ; + VI (VInfin v) => mkVoice v finna ; + VI (VSupin v) => mkVoice v funnit ; --# notpresent + VI (VPtPret a c)=> mkCase c (mkAdjPos a funnen funnet funna funna) + } ; + vtype = VAct + } ; + +-- These are useful auxiliaries. + + mkCase : Case -> Str -> Str = \c,f -> case c of { + Nom => f ; + Gen => f + case last f of { + "s" | "x" => [] ; + _ => "s" + } + } ; + + mkAdjPos : AFormPos -> (s1,_,_,s4 : Str) -> Str = + \a, liten, litet, lilla, sma -> + case a of { + Strong gn => case gn of { + SgUtr => liten ; + SgNeutr => litet ; + Plg => sma + } ; + Weak Sg => lilla ; + Weak Pl => sma + } ; + + mkVoice : Voice -> Str -> Str = \v,s -> case v of { + Act => s ; + Pass => s + case last s of { + "s" => "es" ; + _ => "s" + } + } ; + + +-- For $Noun$. + + artDef : GenNum -> Str = \gn -> gennumForms "den" "det" "de" ! gn ; + + mkNP : (x1,_,_,_,x5 : Str) -> GenNum -> Person -> + {s : NPForm => Str ; a : Agr} = \du,dig,din,ditt,dina,gn,p -> { + s = table { + NPNom => du ; + NPAcc => dig ; + NPPoss g => gennumForms din ditt dina ! g + } ; + a = { + gn = gn ; + p = p + } + } ; + + gennumForms : (x1,x2,x3 : Str) -> GenNum => Str = \den,det,de -> + table { + SgUtr => den ; + SgNeutr => det ; + _ => de + } ; + + regNP : Str -> Str -> GenNum -> {s : NPForm => Str ; a : Agr} = + \det,dess,gn -> + mkNP det det dess dess dess gn P3 ; + + +-- For $Verb$. + + VP = { + s : VPForm => { + fin : Str ; -- V1 har ---s1 + inf : Str -- V2 sagt ---s4 + } ; + a1 : Polarity => Str ; -- A1 inte ---s3 + n2 : Agr => Str ; -- N2 dig ---s5 + a2 : Str ; -- A2 idag ---s6 + ext : Str ; -- S-Ext att hon går ---s7 + --- ea1,ev2, --- these depend on params of v and a1 + en2,ea2,eext : Bool -- indicate if the field exists + } ; + + + insertObj : (Agr => Str) -> VP -> VP = \obj,vp -> { + s = vp.s ; + a1 = vp.a1 ; + n2 = \\a => obj ! a ++ vp.n2 ! a ; + a2 = vp.a2 ; + ext = vp.ext ; + en2 = True ; + ea2 = vp.ea2 ; + eext = vp.eext + } ; + + insertObjPost : (Agr => Str) -> VP -> VP = \obj,vp -> { + s = vp.s ; + a1 = vp.a1 ; + n2 = \\a => vp.n2 ! a ++ obj ! a ; + a2 = vp.a2 ; + ext = vp.ext ; + en2 = True ; + ea2 = vp.ea2 ; + eext = vp.eext + } ; + + insertAdv : Str -> VP -> VP = \adv,vp -> { + s = vp.s ; + a1 = vp.a1 ; + n2 = vp.n2 ; + a2 = vp.a2 ++ adv ; + ext = vp.ext ; + en2 = vp.en2 ; + ea2 = True ; + eext = vp.eext + } ; + + insertAdV : Str -> VP -> VP = \adv,vp -> { + s = vp.s ; + a1 = \\b => vp.a1 ! b ++ adv ; + n2 = vp.n2 ; + a2 = vp.a2 ; + ext = vp.ext ; + en2 = vp.en2 ; + ea2 = vp.ea2 ; + eext = vp.eext + } ; + + infVP : VP -> Agr -> Str = \vp,a -> + vp.a1 ! Pos ++ (vp.s ! VPInfinit Simul).inf ++ vp.n2 ! a ++ vp.a2 ++ vp.ext ; --- a1 + + +-- For $Sentence$. + + Clause : Type = { + s : Tense => Anteriority => Polarity => Order => Str + } ; + + mkClause : Str -> Agr -> VP -> Clause = \subj,agr,vp -> { + s = \\t,a,b,o => + let + verb = vp.s ! VPFinite t a ; + neg = vp.a1 ! b ; + compl = vp.n2 ! agr ++ vp.a2 ++ vp.ext + in + case o of { + Main => subj ++ verb.fin ++ neg ++ verb.inf ++ compl ; + Inv => verb.fin ++ subj ++ neg ++ verb.inf ++ compl ; + Sub => subj ++ neg ++ verb.fin ++ verb.inf ++ compl + } + } ; + +} diff --git a/lib/next-resource/scandinavian/ConjunctionScand.gf b/lib/next-resource/scandinavian/ConjunctionScand.gf new file mode 100644 index 000000000..b98f04ae9 --- /dev/null +++ b/lib/next-resource/scandinavian/ConjunctionScand.gf @@ -0,0 +1,37 @@ +incomplete concrete ConjunctionScand of Conjunction = + CatScand ** open CommonScand, ResScand, Coordination, Prelude in { + + flags optimize=all_subs ; + + lin + + ConjS conj ss = conjunctDistrTable Order conj ss ; + + ConjAdv conj ss = conjunctDistrSS conj ss ; + + ConjNP conj ss = conjunctDistrTable NPForm conj ss ** { + a = {gn = conjGenNum (gennum utrum conj.n) ss.a.gn ; p = ss.a.p} + } ; + + ConjAP conj ss = conjunctDistrTable AFormPos conj ss ** { + isPre = ss.isPre + } ; + +-- These fun's are generated from the list cat's. + + BaseS = twoTable Order ; + ConsS = consrTable Order comma ; + BaseAdv = twoSS ; + ConsAdv = consrSS comma ; + BaseNP x y = twoTable NPForm x y ** {a = conjAgr x.a y.a} ; + ConsNP xs x = consrTable NPForm comma xs x ** {a = conjAgr xs.a x.a} ; + BaseAP x y = twoTable AFormPos x y ** {isPre = andB x.isPre y.isPre} ; + ConsAP xs x = consrTable AFormPos comma xs x ** {isPre = andB xs.isPre x.isPre} ; + + lincat + [S] = {s1,s2 : Order => Str} ; + [Adv] = {s1,s2 : Str} ; + [NP] = {s1,s2 : NPForm => Str ; a : Agr} ; + [AP] = {s1,s2 : AFormPos => Str ; isPre : Bool} ; + +} diff --git a/lib/next-resource/scandinavian/DiffScand.gf b/lib/next-resource/scandinavian/DiffScand.gf new file mode 100644 index 000000000..e288be677 --- /dev/null +++ b/lib/next-resource/scandinavian/DiffScand.gf @@ -0,0 +1,63 @@ +interface DiffScand = open CommonScand, Prelude in { + +--1 Differences between Scandinavian languages + +-- Norway has three genders, Danish and Swedish have two. + + param + Gender ; + + oper + neutrum, utrum : Gender ; + + gennum : Gender -> Number -> GenNum ; + +-- This is the form of the noun in "det stora berget"/"det store berg". + + detDef : Species ; + +-- Danish and Norwegian verbs, but not Swedish verbs, +-- have two possible compound-tense auxiliaries ("have" or "være"). + + Verb : Type ; + + hasAuxBe : Verb -> Bool ; + +-- The rest of the parameters are function words used in the syntax modules. + + conjThat : Str ; + conjThan : Str ; + compMore : Str ; + conjAnd : Str ; + infMark : Str ; + + subjIf : Str ; + + artIndef : Gender => Str ; + + verbHave : Verb ; + verbBe : Verb ; + + verbBecome : Verb ; + + auxFut : Str ; + auxCond : Str ; + + negation : Polarity => Str ; + +-- For determiners; mostly two-valued even in Norwegian. + + genderForms : (x1,x2 : Str) -> Gender => Str ; + +-- The forms of a relative pronoun ("som", "vars", "i vilken"). + + relPron : GenNum => RCase => Str ; + +-- Pronoun "sådan" used in $Relative.RelCl$. + + pronSuch : GenNum => Str ; + + reflPron : Agr -> Str ; + +} + diff --git a/lib/next-resource/scandinavian/ExtEngAbs.gf b/lib/next-resource/scandinavian/ExtEngAbs.gf new file mode 100644 index 000000000..85c117e47 --- /dev/null +++ b/lib/next-resource/scandinavian/ExtEngAbs.gf @@ -0,0 +1,15 @@ +abstract ExtEngAbs = Cat ** { + + cat + Aux ; -- auxiliary verbs: "can", "must", etc + +-- Notice that $Aux$ cannot form $VP$ with infinitive, imperative, etc. + + fun + PredAux : NP -> Aux -> VP -> Cl ; + QuestAux : IP -> Aux -> VP -> QCl ; + + can_Aux : Aux ; + must_Aux : Aux ; + +} diff --git a/lib/next-resource/scandinavian/ExtraScand.gf b/lib/next-resource/scandinavian/ExtraScand.gf new file mode 100644 index 000000000..360cb3832 --- /dev/null +++ b/lib/next-resource/scandinavian/ExtraScand.gf @@ -0,0 +1,47 @@ +incomplete concrete ExtraScand of ExtraScandAbs = CatScand ** + open CommonScand,Coordination,ResScand in { + lin + GenNP np = { + s = \\n,_,_,g => np.s ! NPPoss (gennum g n) ; + det = DDef Indef + } ; + + ComplBareVS v s = insertObj (\\_ => s.s ! Sub) (predV v) ; + + StrandRelSlash rp slash = { + s = \\t,a,p,ag => + rp.s ! ag.gn ! RNom ++ slash.s ! t ! a ! p ! Sub ++ slash.c2.s ; + c = NPAcc + } ; + EmptyRelSlash rp slash = { + s = \\t,a,p,ag => + slash.s ! t ! a ! p ! Sub ++ slash.c2.s ; + c = NPAcc + } ; + + StrandQuestSlash ip slash = { + s = \\t,a,p => + let + cls = slash.s ! t ! a ! p ; + who = ip.s ! accusative + in table { + QDir => who ++ cls ! Inv ++ slash.c2.s ; + QIndir => who ++ cls ! Sub ++ slash.c2.s + } + } ; + + lincat + VPI = {s : VPIForm => Agr => Str} ; + [VPI] = {s1,s2 : VPIForm => Agr => Str} ; + + lin + BaseVPI = twoTable2 VPIForm Agr ; + ConsVPI = consrTable2 VPIForm Agr comma ; + + MkVPI vp = { + s = \\v,a => infVP vp a ---- no sup + } ; + ConjVPI = conjunctDistrTable2 VPIForm Agr ; + ComplVPIVV vv vpi = insertObj (\\a => vv.c2.s ++ vpi.s ! VPIInf ! a) (predV vv) ; + +} diff --git a/lib/next-resource/scandinavian/ExtraScandAbs.gf b/lib/next-resource/scandinavian/ExtraScandAbs.gf new file mode 100644 index 000000000..7f0fb1651 --- /dev/null +++ b/lib/next-resource/scandinavian/ExtraScandAbs.gf @@ -0,0 +1,3 @@ +abstract ExtraScandAbs = Extra ** { + +} diff --git a/lib/next-resource/scandinavian/NounScand.gf b/lib/next-resource/scandinavian/NounScand.gf new file mode 100644 index 000000000..81516ef3a --- /dev/null +++ b/lib/next-resource/scandinavian/NounScand.gf @@ -0,0 +1,187 @@ +incomplete concrete NounScand of Noun = + CatScand ** open CommonScand, ResScand, Prelude in { + + flags optimize=all_subs ; + +-- The rule defines $Det Quant Num Ord CN$ where $Det$ is empty if +-- it is the definite article ($DefSg$ or $DefPl$) and both $Num$ and +-- $Ord$ are empty and $CN$ is not adjectivally modified +-- ($AdjCN$). Thus we get $huset$ but $de fem husen$, $det gamla huset$. + + lin + DetCN det cn = + let + g = cn.g ; + m = cn.isMod ; + dd = case of { + => DDef Indef ; + => d + } + in { + s = \\c => det.s ! m ! g ++ + cn.s ! det.n ! dd ! caseNP c ; + a = agrP3 g det.n + } ; + + UsePN pn = { + s = \\c => pn.s ! caseNP c ; + a = agrP3 pn.g Sg + } ; + + UsePron p = p ; + + PredetNP pred np = { + s = \\c => pred.s ! np.a.gn ++ np.s ! c ; + a = np.a + } ; + + PPartNP np v2 = { + s = \\c => np.s ! c ++ v2.s ! (VI (VPtPret (agrAdj np.a.gn DIndef) Nom)) ; + a = np.a + } ; + + AdvNP np adv = { + s = \\c => np.s ! c ++ adv.s ; + a = np.a + } ; + + DetQuantOrd quant num ord = { + s = \\b,g => quant.s ! num.n ! b ! (orB b num.isDet) ! g ++ + num.s ! g ++ ord.s ; + n = num.n ; + det = quant.det + } ; + + DetQuant quant num = { + s = \\b,g => quant.s ! num.n ! b ! (orB b num.isDet) ! g ++ + num.s ! g ; + n = num.n ; + det = quant.det + } ; + + DetNP det = + let + g = Neutr ; ---- + m = True ; ---- is this needed for other than Art? + in { + s = \\c => det.s ! m ! g ; + a = agrP3 g det.n + } ; + + PossPron p = { + s = \\n,_,_,g => p.s ! NPPoss (gennum g n) ; + det = DDef Indef + } ; + + NumCard c = c ** {isDet = True} ; + + NumSg = {s = \\_ => [] ; isDet = False ; n = Sg} ; + NumPl = {s = \\_ => [] ; isDet = False ; n = Pl} ; + + NumDigits nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ; + OrdDigits nu = {s = nu.s ! NOrd SupWeak} ; + + NumNumeral nu = {s = \\g => nu.s ! NCard g ; n = nu.n} ; + OrdNumeral nu = {s = nu.s ! NOrd SupWeak} ; + + AdNum adn num = {s = \\g => adn.s ++ num.s ! g ; isDet = True ; n = num.n} ; + + OrdSuperl a = { + s = case a.isComp of { + True => "mest" ++ a.s ! AF (APosit (Weak Sg)) Nom ; + _ => a.s ! AF (ASuperl SupWeak) Nom + } ; + isDet = True + } ; + + DefArt = { + s = \\n,bm,bn,g => if_then_Str (orB bm bn) (artDef (gennum g n)) [] ; + det = DDef Def + } ; + + IndefArt = { + s = table { + Sg => \\_,bn,g => if_then_Str bn [] (artIndef ! g) ; + Pl => \\_,bn,_ => [] + } ; + det = DIndef + } ; + + MassNP cn = { + s = \\c => cn.s ! Sg ! DIndef ! caseNP c ; + a = agrP3 cn.g Sg + } ; + + UseN, UseN2 = \noun -> { + s = \\n,d,c => noun.s ! n ! specDet d ! c ; + ---- part app wo c shows editor bug. AR 8/7/2007 + g = noun.g ; + isMod = False + } ; + + Use2N3 f = { + s = f.s ; + g = f.g ; + c2 = f.c2 ; + isMod = False + } ; + + Use3N3 f = { + s = f.s ; + g = f.g ; + c2 = f.c3 ; + isMod = False + } ; + +-- The genitive of this $NP$ is not correct: "sonen till mig" (not "migs"). + + ComplN2 f x = { + s = \\n,d,c => f.s ! n ! specDet d ! Nom ++ f.c2.s ++ x.s ! accusative ; + g = f.g ; + isMod = False + } ; + ComplN3 f x = { + s = \\n,d,c => f.s ! n ! d ! Nom ++ f.c2.s ++ x.s ! accusative ; + g = f.g ; + c2 = f.c3 ; + isMod = False + } ; + + AdjCN ap cn = let g = cn.g in { + s = \\n,d,c => + preOrPost ap.isPre + (ap.s ! agrAdj (gennum g n) d) + (cn.s ! n ! d ! c) ; + g = g ; + isMod = True + } ; + + RelCN cn rs = let g = cn.g in { + s = \\n,d,c => cn.s ! n ! d ! c ++ rs.s ! agrP3 g n ; + g = g ; + isMod = cn.isMod + } ; + + RelNP np rs = { + s = \\c => np.s ! c ++ "," ++ rs.s ! np.a ; + a = np.a ; + isMod = np.isMod + } ; + + AdvCN cn sc = let g = cn.g in { + s = \\n,d,c => cn.s ! n ! d ! c ++ sc.s ; + g = g ; + isMod = cn.isMod + } ; + SentCN cn sc = let g = cn.g in { + s = \\n,d,c => cn.s ! n ! d ! c ++ sc.s ; + g = g ; + isMod = cn.isMod + } ; + ApposCN cn np = let g = cn.g in { + s = \\n,d,c => cn.s ! n ! d ! Nom ++ np.s ! NPNom ; --c + g = g ; + isMod = cn.isMod + } ; + +} diff --git a/lib/next-resource/scandinavian/PhraseScand.gf b/lib/next-resource/scandinavian/PhraseScand.gf new file mode 100644 index 000000000..f417b6041 --- /dev/null +++ b/lib/next-resource/scandinavian/PhraseScand.gf @@ -0,0 +1,25 @@ +incomplete concrete PhraseScand of Phrase = + CatScand ** open CommonScand, ResScand, Prelude in { + + lin + PhrUtt pconj utt voc = {s = pconj.s ++ utt.s ++ voc.s} ; + + UttS s = {s = s.s ! Main} ; + UttQS qs = {s = qs.s ! QDir} ; + UttImpSg pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; + UttImpPl pol imp = {s = pol.s ++ imp.s ! pol.p ! Pl} ; + UttImpPol pol imp = {s = pol.s ++ imp.s ! pol.p ! Sg} ; --- works for adj but not for refl + + UttIP ip = {s = ip.s ! nominative} ; --- Acc also + UttIAdv iadv = iadv ; + UttNP np = {s = np.s ! accusative} ; + UttVP vp = {s = infMark ++ infVP vp (agrP3 utrum Sg)} ; + UttAdv adv = adv ; + + NoPConj = {s = []} ; + PConjConj conj = {s = conj.s2} ; + + NoVoc = {s = []} ; + VocNP np = {s = "," ++ np.s ! nominative} ; + +} diff --git a/lib/next-resource/scandinavian/QuestionScand.gf b/lib/next-resource/scandinavian/QuestionScand.gf new file mode 100644 index 000000000..f053e71cc --- /dev/null +++ b/lib/next-resource/scandinavian/QuestionScand.gf @@ -0,0 +1,96 @@ +incomplete concrete QuestionScand of Question = + CatScand ** open CommonScand, ResScand in { + + flags optimize=all_subs ; + + lin + + QuestCl cl = { + s = \\t,a,p => + let cls = cl.s ! t ! a ! p + in table { + QDir => cls ! Inv ; + QIndir => subjIf ++ cls ! Sub + } + } ; + + QuestVP qp vp = { + s = \\t,a,b,q => + let + somo = case q of { + QIndir => <"som",Sub> ; + _ => <[], Main> + } ; + cl = mkClause (qp.s ! nominative ++ somo.p1) {gn = qp.gn ; p = P3} vp + in + cl.s ! t ! a ! b ! somo.p2 + } ; + + QuestSlash ip slash = { + s = \\t,a,p => + let + agr = {gn = ip.gn ; p = P3} ; + cls : Order => Str = \\o => slash.s ! t ! a ! p ! o ++ slash.n3 ! agr ; + who = slash.c2.s ++ ip.s ! accusative --- stranding in ExtScand + in table { + QDir => who ++ cls ! Inv ; + QIndir => who ++ cls ! Sub + } + } ; + + QuestIAdv iadv cl = { + s = \\t,a,p => + let + cls = cl.s ! t ! a ! p ; + why = iadv.s + in table { + QDir => why ++ cls ! Inv ; + QIndir => why ++ cls ! Sub + } + } ; + + QuestIComp icomp np = { + s = \\t,a,p => + let + cls = + (mkClause (np.s ! nominative) np.a (predV verbBe)).s ! t ! a ! p ; + why = icomp.s ! agrAdj np.a.gn DIndef + in table { + QDir => why ++ cls ! Inv ; + QIndir => why ++ cls ! Sub + } + } ; + + PrepIP p ip = { + s = p.s ++ ip.s ! accusative + } ; + + AdvIP ip adv = { + s = \\c => ip.s ! c ++ adv.s ; + gn = ip.gn + } ; + + IdetCN idet cn = let g = cn.g in { + s = \\c => + idet.s ! g ++ cn.s ! idet.n ! idet.det ! caseNP c ; + gn = gennum g idet.n + } ; + + IdetIP idet = + let + g = Neutr ; + in { + s = \\c => idet.s ! g ; + gn = (agrP3 g idet.n).gn + } ; + + IdetQuant idet num = { + s = \\g => idet.s ! num.n ! g ++ num.s ! g ; + n = num.n ; + det = idet.det + } ; + + CompIAdv a = {s = \\_ => a.s} ; + CompIP ip = {s = \\_ => ip.s ! nominative} ; + +} diff --git a/lib/next-resource/scandinavian/RelativeScand.gf b/lib/next-resource/scandinavian/RelativeScand.gf new file mode 100644 index 000000000..c5c0abc17 --- /dev/null +++ b/lib/next-resource/scandinavian/RelativeScand.gf @@ -0,0 +1,52 @@ +incomplete concrete RelativeScand of Relative = + CatScand ** open CommonScand, ResScand, Prelude in { + + flags optimize=all_subs ; + + lin + + RelCl cl = { + s = \\t,a,p,ag => pronSuch ! ag.gn ++ conjThat ++ cl.s ! t ! a ! p ! Sub ; + c = NPAcc + } ; + + RelVP rp vp = { + s = \\t,ant,b,ag => + let + agr = case rp.a of { + RNoAg => ag ; + RAg a => a + } ; + cl = mkClause (rp.s ! ag.gn ! RNom) agr vp + in + cl.s ! t ! ant ! b ! Sub ; + c = NPNom + } ; + +-- This rule uses pied piping ("huset i vilket hon bor") +-- Preposition stranding ("huset som hon bor i") +-- and the empty relative ("huset hon bor i") are defined in $ExtraScand$. + + RelSlash rp slash = { + s = \\t,a,p,ag => + let + agr = case rp.a of { + RNoAg => ag ; + RAg agg => agg + } + in + slash.c2.s ++ rp.s ! ag.gn ! RPrep slash.c2.hasPrep ++ + slash.s ! t ! a ! p ! Sub ++ slash.n3 ! agr ; + c = NPAcc + } ; + +--- The case here could be genitive. + + FunRP p np rp = { + s = \\gn,c => np.s ! nominative ++ p.s ++ rp.s ! gn ! RPrep True ; + a = RAg np.a + } ; + + IdRP = {s = relPron ; a = RNoAg} ; + +} diff --git a/lib/next-resource/scandinavian/ResScand.gf b/lib/next-resource/scandinavian/ResScand.gf new file mode 100644 index 000000000..bcd1c7497 --- /dev/null +++ b/lib/next-resource/scandinavian/ResScand.gf @@ -0,0 +1,75 @@ +--1 Scandinavian auxiliary operations + +interface ResScand = DiffScand ** open CommonScand, Prelude in { + +--2 Constants uniformly defined in terms of language-dependent constants + + param + CardOrd = NCard Gender | NOrd AFormSup ; -- sic! (AFormSup) + + oper + agrP3 : Gender -> Number -> Agr = \g,n -> { + gn = gennum g n ; + p = P3 + } ; + + Noun = {s : Number => Species => Case => Str ; g : Gender} ; + +-- This function is here because it depends on $verbHave, auxFut, auxCond$. + + predV : Verb -> VP = \verb -> + let + diath = case verb.vtype of { + VPass => Pass ; + _ => Act + } ; + vfin : Tense -> Str = \t -> verb.s ! vFin t diath ; + vsup = verb.s ! VI (VSupin diath) ; --# notpresent + vinf = verb.s ! VI (VInfin diath) ; + + auxv = case hasAuxBe verb of { + True => verbBe.s ; + _ => verbHave.s + } ; + + har : Tense -> Str = \t -> auxv ! vFin t Act ; + ha : Str = auxv ! VI (VInfin Act) ; + + vf : Str -> Str -> {fin,inf : Str} = \fin,inf -> { + fin = fin ; inf = inf ++ verb.part + } ; + + in { + s = table { + VPFinite t Simul => case t of { +-- Pres | Past => vf (vfin t) [] ; -- the general rule + Past => vf (vfin t) [] ; --# notpresent + Fut => vf auxFut vinf ; --# notpresent + Cond => vf auxCond vinf ; --# notpresent + Pres => vf (vfin t) [] + } ; + VPFinite t Anter => case t of { --# notpresent + Pres | Past => vf (har t) vsup ; --# notpresent + Fut => vf auxFut (ha ++ vsup) ; --# notpresent + Cond => vf auxCond (ha ++ vsup) --# notpresent + } ; --# notpresent + VPImperat => vf (verb.s ! VF (VImper diath)) [] ; + VPInfinit Anter => vf [] (ha ++ vsup) ; --# notpresent + VPInfinit Simul => vf [] vinf + } ; + a1 : Polarity => Str = negation ; + n2 : Agr => Str = \\a => case verb.vtype of { + VRefl => reflPron a ; + _ => [] + } ; + a2 : Str = [] ; + ext : Str = [] ; + en2,ea2,eext : Bool = False -- indicate if the field exists + } ; + +-- needed for VP conjunction + param + VPIForm = VPIInf | VPISup ; ---- sup not yet used + + +} diff --git a/lib/next-resource/scandinavian/SentenceScand.gf b/lib/next-resource/scandinavian/SentenceScand.gf new file mode 100644 index 000000000..e845b2a79 --- /dev/null +++ b/lib/next-resource/scandinavian/SentenceScand.gf @@ -0,0 +1,64 @@ +incomplete concrete SentenceScand of Sentence = + CatScand ** open CommonScand, ResScand, Prelude in { + + flags optimize=all_subs ; + + lin + PredVP np vp = mkClause (np.s ! nominative) np.a vp ; + + PredSCVP sc vp = mkClause sc.s (agrP3 neutrum Sg) vp ; + + ImpVP vp = { + s = \\pol,n => + let + agr = {gn = gennum utrum n ; p = P2} ; + verb = vp.s ! VPImperat ; + in + verb.fin ++ vp.a1 ! pol ++ verb.inf ++ vp.n2 ! agr ++ vp.a2 ++ vp.ext + } ; + + SlashVP np vp = + mkClause + (np.s ! nominative) np.a + vp ** + {n3 = vp.n3 ; c2 = vp.c2} ; + + AdvSlash slash adv = { + s = \\t,a,b,o => slash.s ! t ! a ! b ! o ++ adv.s ; + n3 = slash.n3 ; + c2 = slash.c2 + } ; + + SlashPrep cl prep = cl ** {n3 = \\_ => [] ; c2 = {s = prep.s ; hasPrep = True}} ; + + SlashVS np vs slash = + mkClause + (np.s ! nominative) np.a + (insertObj (\\_ => conjThat ++ slash.s ! Sub) (predV vs)) ** + {n3 = slash.n3 ; c2 = slash.c2} ; + + EmbedS s = {s = conjThat ++ s.s ! Sub} ; + EmbedQS qs = {s = qs.s ! QIndir} ; + EmbedVP vp = {s = infMark ++ infVP vp (agrP3 utrum Sg)} ; --- agr + + UseCl t a p cl = { + s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o + } ; + UseQCl t a p cl = { + s = \\q => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! q + } ; + UseRCl t a p cl = { + s = \\r => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! r ; + c = cl.c + } ; + UseSlash t a p cl = { + s = \\o => t.s ++ a.s ++ p.s ++ cl.s ! t.t ! a.a ! p.p ! o ; + n3 = cl.n3 ; + c2 = cl.c2 + } ; + + AdvS a s = {s = \\o => a.s ++ s.s ! Inv} ; + + RelS s r = {s = \\o => s.s ! o ++ "," ++ r.s ! agrP3 Neutr Sg} ; --- vilket + +} diff --git a/lib/next-resource/scandinavian/VerbScand.gf b/lib/next-resource/scandinavian/VerbScand.gf new file mode 100644 index 000000000..5ec40157c --- /dev/null +++ b/lib/next-resource/scandinavian/VerbScand.gf @@ -0,0 +1,69 @@ +incomplete concrete VerbScand of Verb = CatScand ** open CommonScand, ResScand in { + + flags optimize=all_subs ; + + lin + UseV = predV ; + + SlashV2a v = predV v ** {n3 = \\_ => [] ; c2 = v.c2} ; + + Slash2V3 v np = + insertObj (\\_ => v.c2.s ++ np.s ! accusative) (predV v) ** + {n3 = \\_ => [] ; c2 = v.c3} ; -- to preserve the order of args + Slash3V3 v np = predV v ** { + n3 = \\_ => v.c3.s ++ np.s ! accusative ; + c2 = v.c2 + } ; + + ComplVV v vp = insertObj (\\a => v.c2.s ++ infVP vp a) (predV v) ; + ComplVS v s = insertObj (\\_ => conjThat ++ s.s ! Sub) (predV v) ; + ComplVQ v q = insertObj (\\_ => q.s ! QIndir) (predV v) ; + ComplVA v ap = insertObj (\\a => ap.s ! agrAdj a.gn DIndef) (predV v) ; + + SlashV2V v vp = predV v ** { + n3 = \\a => v.c3.s ++ infVP vp a ; + c2 = v.c2 + } ; + SlashV2S v s = predV v ** { + n3 = \\_ => conjThat ++ s.s ! Sub ; + c2 = v.c2 + } ; + SlashV2Q v q = predV v ** { + n3 = \\_ => q.s ! QIndir ; + c2 = v.c2 + } ; + SlashV2A v ap = predV v ** { + n3 = \\a => ap.s ! agrAdj a.gn DIndef ; + c2 = v.c2 + } ; + + ComplSlash vp np = + insertObj + (\\_ => vp.c2.s ++ np.s ! accusative ++ vp.n3 ! np.a) vp ; + + SlashVV v vp = + insertObj (\\a => v.c2.s ++ infVP vp a) (predV v) ** {n3 = vp.n3 ; c2 = vp.c2} ; + + SlashV2VNP v np vp = + insertObj + (\\a => v.c2.s ++ np.s ! accusative ++ v.c3.s ++ infVP vp a) (predV v) + ** {n3 = vp.n3 ; c2 = v.c2} ; + + UseComp comp = insertObj (\\a => comp.s ! agrAdj a.gn DIndef) (predV verbBe) ; + + CompAP ap = ap ; + CompNP np = {s = \\_ => np.s ! accusative} ; + CompAdv a = {s = \\_ => a.s} ; + + AdvVP vp adv = insertAdv adv.s vp ; + AdVVP adv vp = insertAdV adv.s vp ; + + + ReflVP vp = insertObj (\\a => vp.c2.s ++ reflPron a ++ vp.n3 ! a) vp ; + + PassV2 v = + insertObj + (\\a => v.s ! VI (VPtPret (agrAdj a.gn DIndef) Nom)) + (predV verbBecome) ; + +} diff --git a/lib/next-resource/swedish/AdjectiveSwe.gf b/lib/next-resource/swedish/AdjectiveSwe.gf new file mode 100644 index 000000000..00603805b --- /dev/null +++ b/lib/next-resource/swedish/AdjectiveSwe.gf @@ -0,0 +1,2 @@ +concrete AdjectiveSwe of Adjective = CatSwe ** AdjectiveScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/AdverbSwe.gf b/lib/next-resource/swedish/AdverbSwe.gf new file mode 100644 index 000000000..4ecd8aff4 --- /dev/null +++ b/lib/next-resource/swedish/AdverbSwe.gf @@ -0,0 +1,2 @@ +concrete AdverbSwe of Adverb = CatSwe ** AdverbScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/AllSwe.gf b/lib/next-resource/swedish/AllSwe.gf new file mode 100644 index 000000000..c63bd9424 --- /dev/null +++ b/lib/next-resource/swedish/AllSwe.gf @@ -0,0 +1,7 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete AllSwe of AllSweAbs = + LangSwe, + IrregSwe, + ExtraSwe + ** {} ; diff --git a/lib/next-resource/swedish/AllSweAbs.gf b/lib/next-resource/swedish/AllSweAbs.gf new file mode 100644 index 000000000..33ea20ec1 --- /dev/null +++ b/lib/next-resource/swedish/AllSweAbs.gf @@ -0,0 +1,5 @@ +abstract AllSweAbs = + Lang, + IrregSweAbs, + ExtraSweAbs + ** {} ; diff --git a/lib/next-resource/swedish/CatSwe.gf b/lib/next-resource/swedish/CatSwe.gf new file mode 100644 index 000000000..c35924036 --- /dev/null +++ b/lib/next-resource/swedish/CatSwe.gf @@ -0,0 +1,2 @@ +concrete CatSwe of Cat = CommonX ** CatScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/ConjunctionSwe.gf b/lib/next-resource/swedish/ConjunctionSwe.gf new file mode 100644 index 000000000..dca410032 --- /dev/null +++ b/lib/next-resource/swedish/ConjunctionSwe.gf @@ -0,0 +1,2 @@ +concrete ConjunctionSwe of Conjunction = CatSwe ** ConjunctionScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/DiffSwe.gf b/lib/next-resource/swedish/DiffSwe.gf new file mode 100644 index 000000000..97d9fa9cd --- /dev/null +++ b/lib/next-resource/swedish/DiffSwe.gf @@ -0,0 +1,98 @@ +instance DiffSwe of DiffScand = open CommonScand, Prelude in { + +-- Parameters. + + param + Gender = Utr | Neutr ; + + oper + utrum = Utr ; + neutrum = Neutr ; + + gennumN : Gender -> Number -> GenNum = \g,n -> Plg ; ----- + gennum : Gender -> Number -> GenNum = \g,n -> +{- +--- debugging Compute 9/11/2007 + case n of { + Sg => case g of { + Utr => SgUtr ; + Neutr => SgNeutr + } ; + _ => Plg + } ; +-} + case < : Gender * Number> of { + => SgUtr ; + => SgNeutr ; + _ => Plg + } ; + + detDef : Species = Def ; + + Verb : Type = { + s : VForm => Str ; + part : Str ; + vtype : VType + } ; + + hasAuxBe _ = False ; + + +-- Strings. + + conjThat = "att" ; + conjThan = "än" ; + conjAnd = "och" ; + infMark = "att" ; + compMore = "mera" ; + + subjIf = "om" ; + + artIndef : Gender => Str = table { + Utr => "en" ; + Neutr => "ett" + } ; + + verbHave = + mkVerb "ha" "har" "ha" "hade" "haft" "havd" "havt" "havda" ** noPart ; + verbBe = + mkVerb "vara" "är" "var" "var" "varit" "varen" "varet" "varna" + ** noPart ; + verbBecome = + mkVerb "bli" "blir" "bli" "blev" "blivit" "bliven" "blivet" "blivna" + ** noPart ; + + -- auxiliary + noPart = {part = []} ; + + auxFut = "ska" ; -- "skall" in ExtSwe + auxCond = "skulle" ; + + negation : Polarity => Str = table { + Pos => [] ; + Neg => "inte" + } ; + + genderForms : (x1,x2 : Str) -> Gender => Str = \all,allt -> + table { + Utr => all ; + Neutr => allt + } ; + + relPron : GenNum => RCase => Str = \\gn,c => case c of { + RNom | RPrep False => "som" ; + RGen => "vars" ; + RPrep True => gennumForms "vilken" "vilket" "vilka" ! gn + } ; + + pronSuch = gennumForms "sådan" "sådant" "sådana" ; + + reflPron : Agr -> Str = \a -> case a of { + {gn = Plg ; p = P1} => "oss" ; + {gn = Plg ; p = P2} => "er" ; + {p = P1} => "mig" ; + {p = P2} => "dig" ; + {p = P3} => "sig" + } ; + +} diff --git a/lib/next-resource/swedish/ExtraScandSwe.gf b/lib/next-resource/swedish/ExtraScandSwe.gf new file mode 100644 index 000000000..ba62a8f1e --- /dev/null +++ b/lib/next-resource/swedish/ExtraScandSwe.gf @@ -0,0 +1,2 @@ +concrete ExtraScandSwe of ExtraScandAbs = CatSwe ** ExtraScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/ExtraSwe.gf b/lib/next-resource/swedish/ExtraSwe.gf new file mode 100644 index 000000000..ca533be6b --- /dev/null +++ b/lib/next-resource/swedish/ExtraSwe.gf @@ -0,0 +1,3 @@ +concrete ExtraSwe of ExtraSweAbs = ExtraScandSwe ** { + +} diff --git a/lib/next-resource/swedish/ExtraSweAbs.gf b/lib/next-resource/swedish/ExtraSweAbs.gf new file mode 100644 index 000000000..9371b3e11 --- /dev/null +++ b/lib/next-resource/swedish/ExtraSweAbs.gf @@ -0,0 +1,7 @@ +-- Structures special for Swedish. These are not implemented in other +-- Scandinavian languages. + +abstract ExtraSweAbs = ExtraScandAbs ** { + + +} \ No newline at end of file diff --git a/lib/next-resource/swedish/GrammarSwe.gf b/lib/next-resource/swedish/GrammarSwe.gf new file mode 100644 index 000000000..109669dfb --- /dev/null +++ b/lib/next-resource/swedish/GrammarSwe.gf @@ -0,0 +1,21 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete GrammarSwe of Grammar = + NounSwe, + VerbSwe, + AdjectiveSwe, + AdverbSwe, + NumeralSwe, + SentenceSwe, + QuestionSwe, + RelativeSwe, + ConjunctionSwe, + PhraseSwe, + TextX, + IdiomSwe, + StructuralSwe + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/swedish/IdiomSwe.gf b/lib/next-resource/swedish/IdiomSwe.gf new file mode 100644 index 000000000..65ebf9b30 --- /dev/null +++ b/lib/next-resource/swedish/IdiomSwe.gf @@ -0,0 +1,44 @@ +concrete IdiomSwe of Idiom = CatSwe ** + open MorphoSwe, ParadigmsSwe, IrregSwe, Prelude in { + + flags optimize=all_subs ; + + oper + utr = ParadigmsSwe.utrum ; + neutr = ParadigmsSwe.neutrum ; + + lin + ImpersCl vp = mkClause "det" (agrP3 neutr Sg) vp ; + GenericCl vp = mkClause "man" (agrP3 utr Sg) vp ; + + CleftNP np rs = mkClause "det" (agrP3 neutr Sg) + (insertObj (\\_ => np.s ! rs.c ++ rs.s ! np.a) (predV verbBe)) ; + + CleftAdv ad s = mkClause "det" (agrP3 neutr Sg) + (insertObj (\\_ => ad.s ++ s.s ! Sub) (predV verbBe)) ; + + ExistNP np = + mkClause "det" (agrP3 neutr Sg) (insertObj + (\\_ => np.s ! accusative) (predV (depV finna_V))) ; + + ExistIP ip = { + s = \\t,a,p => + let + cls = + (mkClause "det" (agrP3 neutr Sg) (predV (depV finna_V))).s ! t ! a ! p ; + who = ip.s ! accusative + in table { + QDir => who ++ cls ! Inv ; + QIndir => who ++ cls ! Sub + } + } ; + + + ProgrVP vp = + insertObj (\\a => "att" ++ infVP vp a) (predV (partV hålla_V "på")) ; + + ImpPl1 vp = {s = ["låt oss"] ++ infVP vp {gn = Plg ; p = P1}} ; + + +} + diff --git a/lib/next-resource/swedish/IrregSwe.gf b/lib/next-resource/swedish/IrregSwe.gf new file mode 100644 index 000000000..a31fd7241 --- /dev/null +++ b/lib/next-resource/swedish/IrregSwe.gf @@ -0,0 +1,185 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +concrete IrregSwe of IrregSweAbs = CatSwe ** open ParadigmsSwe in { + + flags optimize=values ; + + lin + anfalla_V = irregV "anfalla" "anföll" "anfallit" ; + angiva_V = irregV "angiva" "angav" "angivit" ; + angripa_V = irregV "angripa" "angrep" "angripit" ; + anhålla_V = irregV "anhålla" "anhäll" "anhållit" ; + antaga_V = irregV "antaga" "antog" "antagit" ; + äta_V = irregV "äta" "åt" "ätit" ; + återfinna_V = irregV "återfinna" "återfann" "återfunnit" ; + avbryta_V = irregV "avbryta" "avbröt" "avbrutit" ; + avfalla_V = irregV "avfalla" "avföll" "avfallit" ; + avhugga_V = irregV "avhugga" "avhögg" "avhuggit" ; + avlida_V = irregV "avlida" "avled" "avlidit" ; + avnjuta_V = irregV "avnjuta" "avnjöt" "avnjutit" ; + avsitta_V = irregV "avsitta" "avsatt" "avsuttit" ; + avskriva_V = irregV "avskriva" "avskrev" "avskrivit" ; + avstiga_V = irregV "avstiga" "avsteg" "avstigit" ; + bära_V = irregV "bära" "bar" "burit" ; + bedraga_V = irregV "bedraga" "bedrog" "bedragit" ; + bedriva_V = irregV "bedriva" "bedrev" "bedrivit" ; + befinna_V = irregV "befinna" "befann" "befunnit" ; + begrava_V = irregV "begrava" "begrov" "begravit" ; + behålla_V = irregV "behålla" "behöll" "behållit" ; + beljuga_V = irregV "beljuga" "beljög" "beljugit" ; + berida_V = irregV "berida" "bered" "beridit" ; + besitta_V = irregV "besitta" "besatt" "besuttit" ; + beskriva_V = irregV "beskriva" "beskrev" "beskrivit" ; + besluta_V = irregV "besluta" "beslöt" "beslutit" ; + bestiga_V = irregV "bestiga" "besteg" "bestigit" ; + bestrida_V = irregV "bestrida" "bestred" "bestridit" ; + bidraga_V = irregV "bidraga" "bidrog" "bidragit" ; + bifalla_V = irregV "bifalla" "biföll" "bifallit" ; + binda_V = irregV "binda" "band" "bundit" ; + bita_V = irregV "bita" "bet" "bitit" ; + bjuda_V = irregV "bjuda" "bjöd" "bjudit" ; + bliva_V = irregV "bli" "blev" "blivit" ; + borttaga_V = irregV "borttaga" "borttog" "borttagit" ; + brinna_V = irregV "brinna" "brann" "brunnit" ; + brista_V = irregV "brista" "brast" "brustit" ; + bryta_V = irregV "bryta" "bröt" "brutit" ; + dö_V = irregV "dö" "dog" "dött" ; + draga_V = mkV (variants { "dra"; "draga"}) (variants { "drar" ; + "drager"}) (variants { "dra" ; "drag" }) "drog" "dragit" "dragen" ; + dricka_V = irregV "dricka" "drack" "druckit" ; + driva_V = irregV "driva" "drev" "drivit" ; + drypa_V = irregV "drypa" "dröp" "drupit" ; + duga_V = irregV "duga" "dög" "dugit" ; + dyka_V = irregV "dyka" "dök" "dukit" ; + erbjuda_V = irregV "erbjuda" "erbjöd" "erbjudit" ; + erfara_V = irregV "erfara" "erfor" "erfarit" ; + erhålla_V = irregV "erhålla" "erhöll" "erhållit" ; + falla_V = irregV "falla" "föll" "fallit" ; + fånga_V = irregV "fånga" "fäng" "fångit" ; + fara_V = irregV "fara" "for" "farit" ; + finna_V = irregV "finna" "fann" "funnit" ; + flyga_V = irregV "flyga" "flög" "flugit" ; + flyta_V = irregV "flyta" "flöt" "flutit" ; + förbehålla_V = irregV "förbehålla" "förbehöll" "förbehållit" ; + förbinda_V = irregV "förbinda" "förband" "förbundit" ; + förbjuda_V = irregV "förbjuda" "förbjöd" "förbjudit" ; + fördriva_V = irregV "fördriva" "fördrev" "fördrivit" ; + föreskriva_V = irregV "föreskriva" "föreskrev" "föreskrivit" ; + företaga_V = irregV "företaga" "företog" "företagit" ; + förfrysa_V = irregV "förfrysa" "förfrös" "förfrusit" ; + förlåta_V = irregV "förlåta" "förlät" "förlåtit" ; + förnimma_V = irregV "förnimma" "förnamm" "förnummit" ; + försitta_V = irregV "försitta" "försatt" "försuttit" ; + försvinna_V = irregV "försvinna" "försvann" "försvunnit" ; + förtiga_V = irregV "förtiga" "förteg" "förtigit" ; + frysa_V = irregV "frysa" "frös" "frusit" ; + gå_V = irregV "gå" "gick" "gått" ; + göra_V = mkV "göra" "gör" "gör" "gjorde" "gjort" "gjord" ; + genomdriva_V = irregV "genomdriva" "genomdrev" "genomdrivit" ; + gilla_V = irregV "gilla" "gall" "gillit" ; + giva_V = irregV "ge" "gav" "givit" ; + gjuta_V = irregV "gjuta" "gjöt" "gjutit" ; + glida_V = irregV "glida" "gled" "glidit" ; + gnida_V = irregV "gnida" "gned" "gnidit" ; + gråta_V = irregV "gråta" "grät" "gråtit" ; + gripa_V = irregV "gripa" "grep" "gripit" ; + hålla_V = irregV "hålla" "höll" "hållit" ; + hinna_V = irregV "hinna" "hann" "hunnit" ; + hugga_V = irregV "hugga" "högg" "huggit" ; + iakttaga_V = irregV "iakttaga" "iakttog" "iakttagit" ; + inbegripa_V = irregV "inbegripa" "inbegrep" "inbegripit" ; + inbjuda_V = irregV "inbjuda" "inbjöd" "inbjudit" ; + indraga_V = irregV "indraga" "indrog" "indragit" ; + innesluta_V = irregV "innesluta" "inneslöt" "inneslutit" ; + inskriva_V = irregV "inskriva" "inskrev" "inskrivit" ; + intaga_V = irregV "intaga" "intog" "intagit" ; + känna_V = irregV "känna" "kände" "känt" ; + klämma_V = regV "klämmer" ; + kliva_V = irregV "kliva" "klev" "klivit" ; + klyva_V = irregV "klyva" "klöv" "kluvit" ; + knipa_V = irregV "knipa" "knep" "knipit" ; + knyta_V = irregV "knyta" "knöt" "knutit" ; + komma_V = irregV "komma" "kom" "kommit" ; + krypa_V = irregV "krypa" "kröp" "krupit" ; + kunna_V = mkV "kunna" "kan" "kan" "kunde" "kunnat" "känd" ; + kvida_V = irregV "kvida" "kved" "kvidit" ; + låta_V = irregV "låta" "lät" "låtit" ; + leva_V = irregV "leva" "levde" "levt" ; + ligga_V = irregV "ligga" "låg" "legat" ; + ljuda_V = irregV "ljuda" "ljöd" "ljudit" ; + ljuga_V = irregV "ljuga" "ljög" "ljugit" ; + ljuta_V = irregV "ljuta" "ljöt" "ljutit" ; + lägga_V = irregV "lägga" "lade" "lagt" ; + mottaga_V = irregV "mottaga" "mottog" "mottagit" ; + nerstiga_V = irregV "nerstiga" "nersteg" "nerstigit" ; + niga_V = irregV "niga" "neg" "nigit" ; + njuta_V = irregV "njuta" "njöt" "njutit" ; + omgiva_V = irregV "omgiva" "omgav" "omgivit" ; + överfalla_V = irregV "överfalla" "överföll" "överfallit" ; + övergiva_V = irregV "övergiva" "övergav" "övergivit" ; + pipa_V = irregV "pipa" "pep" "pipit" ; + rida_V = irregV "rida" "red" "ridit" ; + rinna_V = irregV "rinna" "rann" "runnit" ; + riva_V = irregV "riva" "rev" "rivit" ; + ryta_V = irregV "ryta" "röt" "rutit" ; + säga_V = irregV "säga" "sade" "sagt" ; + se_V = irregV "se" "såg" "sett" ; + sitta_V = irregV "sitta" "satt" "suttit" ; + sjuda_V = irregV "sjuda" "sjöd" "sjudit" ; + sjunga_V = irregV "sjunga" "sjöng" "sjungit" ; + sjunka_V = irregV "sjunka" "sjönk" "sjunkit" ; + skära_V = mkV "skära" "skär" "skär" "skar" "skurit" "skuren" ; + skina_V = irregV "skina" "sken" "skinit" ; + skita_V = irregV "skita" "sket" "skitit" ; + skjuta_V = irregV "skjuta" "skjöt" "skjutit" ; + skrida_V = irregV "skrida" "skred" "skridit" ; + skrika_V = irregV "skrika" "skrek" "skrikit" ; + skriva_V = irregV "skriva" "skrev" "skrivit" ; + skryta_V = irregV "skryta" "skröt" "skrutit" ; + slå_V = irregV "slå" "slog" "slagit" ; + slinka_V = irregV "slinka" "slank" "slunkit" ; + slippa_V = irregV "slippa" "slapp" "sluppit" ; + slita_V = irregV "slita" "slet" "slitit" ; + sluta_V = irregV "sluta" "slöt" "slutit" ; + smörja_V = irregV "smörja" "smorjde" "smort" ; + smita_V = irregV "smita" "smet" "smitit" ; + snyta_V = irregV "snyta" "snöt" "snutit" ; + sova_V = irregV "sova" "sov" "sovit" ; + spinna_V = irregV "spinna" "spann" "spunnit" ; + spricka_V = irregV "spricka" "sprack" "spruckit" ; + sprida_V = irregV "sprida" "spred" "spridit" ; + springa_V = irregV "springa" "sprang" "sprungit" ; + stå_V = irregV "stå" "stod" "stått" ; + sticka_V = irregV "sticka" "stack" "stuckit" ; + stiga_V = irregV "stiga" "steg" "stigit" ; + stinka_V = irregV "stinka" "stank" "stunkit" ; + strida_V = irregV "strida" "stred" "stridit" ; + strypa_V = irregV "strypa" "ströp" "strupit" ; + suga_V = irregV "suga" "sög" "sugit" ; + supa_V = irregV "supa" "söp" "supit" ; + svälla_V = irregV "svälla" "svällde" "svällt" ; + svida_V = irregV "svida" "sved" "svidit" ; + svika_V = irregV "svika" "svek" "svikit" ; + sy_V = irregV "sy" "sydde" "sytt" ; + taga_V = irregV "taga" "tog" "tagit" ; + tiga_V = irregV "tiga" "teg" "tigit" ; + tillåta_V = irregV "tillåta" "tillät" "tillåtit" ; + tillsluta_V = irregV "tillsluta" "tillslöt" "tillslutit" ; + tjuta_V = irregV "tjuta" "tjöt" "tjutit" ; + tryta_V = irregV "tryta" "tröt" "trutit" ; + tvinga_V = irregV "tvinga" "tvang" "tvungit" ; + uppfinna_V = irregV "uppfinna" "uppfann" "uppfunnit" ; + uppgiva_V = irregV "uppgiva" "uppgav" "uppgivit" ; + upplåta_V = irregV "upplåta" "upplät" "upplåtit" ; + uppstiga_V = irregV "uppstiga" "uppsteg" "uppstigit" ; + upptaga_V = irregV "upptaga" "upptog" "upptagit" ; + utbjuda_V = irregV "utbjuda" "utbjöd" "utbjudit" ; + utbrista_V = irregV "utbrista" "utbrast" "utbrustit" ; + utesluta_V = irregV "utesluta" "uteslöt" "uteslutit" ; + utskriva_V = irregV "utskriva" "utskrev" "utskrivit" ; + veta_V = mk6V "veta" "vet" "vet" "visste" "vetat" (variants {}) ; + vända_V = irregV "vända" "vände" "vänt" ; + vina_V = irregV "vina" "ven" "vinit" ; + vinna_V = irregV "vinna" "vann" "vunnit" ; + vrida_V = irregV "vrida" "vred" "vridit" ; +} \ No newline at end of file diff --git a/lib/next-resource/swedish/IrregSweAbs.gf b/lib/next-resource/swedish/IrregSweAbs.gf new file mode 100644 index 000000000..b4da1aaa7 --- /dev/null +++ b/lib/next-resource/swedish/IrregSweAbs.gf @@ -0,0 +1,179 @@ +abstract IrregSweAbs = Cat ** { + fun + anfalla_V : V ; + angiva_V : V ; + angripa_V : V ; + anhålla_V : V ; + antaga_V : V ; + äta_V : V ; + återfinna_V : V ; + avbryta_V : V ; + avfalla_V : V ; + avhugga_V : V ; + avlida_V : V ; + avnjuta_V : V ; + avsitta_V : V ; + avskriva_V : V ; + avstiga_V : V ; + bära_V : V ; + bedraga_V : V ; + bedriva_V : V ; + befinna_V : V ; + begrava_V : V ; + behålla_V : V ; + beljuga_V : V ; + berida_V : V ; + besitta_V : V ; + beskriva_V : V ; + besluta_V : V ; + bestiga_V : V ; + bestrida_V : V ; + bidraga_V : V ; + bifalla_V : V ; + binda_V : V ; + bita_V : V ; + bjuda_V : V ; + bliva_V : V ; + borttaga_V : V ; + brinna_V : V ; + brista_V : V ; + bryta_V : V ; + dö_V : V ; + draga_V : V ; + dricka_V : V ; + driva_V : V ; + drypa_V : V ; + duga_V : V ; + dyka_V : V ; + erbjuda_V : V ; + erfara_V : V ; + erhålla_V : V ; + falla_V : V ; + fånga_V : V ; + fara_V : V ; + finna_V : V ; + flyga_V : V ; + flyta_V : V ; + förbehålla_V : V ; + förbinda_V : V ; + förbjuda_V : V ; + fördriva_V : V ; + föreskriva_V : V ; + företaga_V : V ; + förfrysa_V : V ; + förlåta_V : V ; + förnimma_V : V ; + försitta_V : V ; + försvinna_V : V ; + förtiga_V : V ; + frysa_V : V ; + gå_V : V ; + göra_V : V ; + genomdriva_V : V ; + gilla_V : V ; + giva_V : V ; + gjuta_V : V ; + glida_V : V ; + gnida_V : V ; + gråta_V : V ; + gripa_V : V ; + hålla_V : V ; + hinna_V : V ; + hugga_V : V ; + iakttaga_V : V ; + inbegripa_V : V ; + inbjuda_V : V ; + indraga_V : V ; + innesluta_V : V ; + inskriva_V : V ; + intaga_V : V ; + känna_V : V ; + klämma_V : V ; + kliva_V : V ; + klyva_V : V ; + knipa_V : V ; + knyta_V : V ; + komma_V : V ; + krypa_V : V ; + kunna_V : V ; + kvida_V : V ; + låta_V : V ; + leva_V : V ; + ligga_V : V ; + ljuda_V : V ; + ljuga_V : V ; + ljuta_V : V ; + lägga_V : V ; + mottaga_V : V ; + nerstiga_V : V ; + niga_V : V ; + njuta_V : V ; + omgiva_V : V ; + överfalla_V : V ; + övergiva_V : V ; + pipa_V : V ; + rida_V : V ; + rinna_V : V ; + riva_V : V ; + ryta_V : V ; + säga_V : V ; + se_V : V ; + sitta_V : V ; + sjuda_V : V ; + sjunga_V : V ; + sjunka_V : V ; + skära_V : V ; + skina_V : V ; + skita_V : V ; + skjuta_V : V ; + skrida_V : V ; + skrika_V : V ; + skriva_V : V ; + skryta_V : V ; + slå_V : V ; + slinka_V : V ; + slippa_V : V ; + slita_V : V ; + sluta_V : V ; + smörja_V : V ; + smita_V : V ; + snyta_V : V ; + sova_V : V ; + spinna_V : V ; + spricka_V : V ; + sprida_V : V ; + springa_V : V ; + stå_V : V ; + sticka_V : V ; + stiga_V : V ; + stinka_V : V ; + strida_V : V ; + strypa_V : V ; + suga_V : V ; + supa_V : V ; + svälla_V : V ; + svida_V : V ; + svika_V : V ; + sy_V : V ; + taga_V : V ; + tiga_V : V ; + tillåta_V : V ; + tillsluta_V : V ; + tjuta_V : V ; + tryta_V : V ; + tvinga_V : V ; + uppfinna_V : V ; + uppgiva_V : V ; + upplåta_V : V ; + uppstiga_V : V ; + upptaga_V : V ; + utbjuda_V : V ; + utbrista_V : V ; + utesluta_V : V ; + utskriva_V : V ; + vända_V : V ; + veta_V : V ; + vina_V : V ; + vinna_V : V ; + vrida_V : V ; +} diff --git a/lib/next-resource/swedish/LangSwe.gf b/lib/next-resource/swedish/LangSwe.gf new file mode 100644 index 000000000..a321acd1f --- /dev/null +++ b/lib/next-resource/swedish/LangSwe.gf @@ -0,0 +1,10 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete LangSwe of Lang = + GrammarSwe, + LexiconSwe + ** { + +flags startcat = Phr ; unlexer = text ; lexer = text ; + +} ; diff --git a/lib/next-resource/swedish/LexiconSwe.gf b/lib/next-resource/swedish/LexiconSwe.gf new file mode 100644 index 000000000..3bca3ec0f --- /dev/null +++ b/lib/next-resource/swedish/LexiconSwe.gf @@ -0,0 +1,366 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +concrete LexiconSwe of Lexicon = CatSwe ** + open Prelude, ParadigmsSwe, IrregSwe in { + +flags + optimize=values ; + +lin + airplane_N = regGenN "flygplan" neutrum ; + answer_V2S = mkV2S (regV "svarar") (mkPrep "till") ; + apartment_N = mk2N "lägenhet" "lägenheter" ; + apple_N = regGenN "äpple" neutrum ; + art_N = mk2N "konst" "konster" ; + ask_V2Q = mkV2Q (regV "frågar") noPrep ; + baby_N = regGenN "bebis" utrum ; + bad_A = irregA "dålig" "sämre" "sämst"; + bank_N = mk2N "bank" "banker" ; + beautiful_A = mk3A "vacker" "vackert" "vackra" ; + become_VA = mkVA (mkV "bli" "blir""bli" "blev" "blivit" "bliven") ; + beer_N = regGenN "öl" neutrum ; + beg_V2V = mkV2V (mkV "be" "ber""be" "bad" "bett" "bedd") noPrep (mkPrep "att") ; + big_A = irregA "stor" "större" "störst"; + bike_N = mk2N "cykel" "cyklar" ; + bird_N = mk2N "fågel" "fåglar" ; + black_A = mk2A "svart" "svart" ; + blue_A = mk2A "blå" "blått"; + boat_N = regGenN "båt" utrum ; + book_N = mkN "bok" "boken" "böcker" "böckerna" ; + boot_N = mk2N "stövel" "stövlar" ; + boss_N = mk2N "chef" "chefer" ; + boy_N = regGenN "pojke" utrum ; + bread_N = regGenN "bröd" neutrum ; + break_V2 = dirV2 (partV (mkV "slå" "slår" "slå" "slog" "slagit" "slagen") "sönder") ; + broad_A = mk2A "bred" "brett" ; + brother_N2 = mkN2 ((mkN "bror" "brodern" "bröder" "bröderna")) (mkPrep "till") ; + brown_A = regA "brun" ; + butter_N = regGenN "smör" neutrum ; + buy_V2 = dirV2 (mk2V "köpa" "köpte") ; + camera_N = regGenN "kamera" utrum ; + cap_N = regGenN "mössa" utrum ; + car_N = regGenN "bil" utrum ; + carpet_N = regGenN "matta" utrum ; + cat_N = mk2N "katt" "katter" ; + ceiling_N = regGenN "tak" neutrum ; + chair_N = regGenN "stol" utrum ; + cheese_N = regGenN "ost" utrum ; + child_N = regGenN "barn" neutrum ; + church_N = regGenN "kyrka" utrum ; + city_N = mkN "stad" "staden" "städer" "städerna" ; + clean_A = regA "ren" ; + clever_A = regA "klok" ; + close_V2 = dirV2 (mk2V "stänga" "stängde") ; + coat_N = regGenN "rock" utrum ; + cold_A = regA "kall" ; + come_V = komma_V ; + computer_N = mk2N "dator" "datorer" ; + country_N = mkN "land" "landet" "länder" "länderna" ; + cousin_N = mk2N "kusin" "kusiner" ; + cow_N = mk2N "ko" "kor" ; + die_V = (mkV "dö" "dör" "dö" "dog" "dött" "dödd") ; ---- + distance_N3 = mkN3 (mk2N "avstånd" "avstånd") (mkPrep "från") (mkPrep "till") ; + dirty_A = regA "smutsig" ; + doctor_N = mk2N "läkare" "läkare" ; + dog_N = regGenN "hund" utrum ; + door_N = regGenN "dörr" utrum ; + drink_V2 = dirV2 (irregV "dricka" "drack" "druckit") ; + easy_A2V = mkA2V (mk2A "lätt" "lätt") (mkPrep "för") ; + eat_V2 = dirV2 (irregV "äta" "åt" "ätit") ; + empty_A = mkA "tom" "tomt" "tomma" "tomma" "tommare" "tommast" "tommaste" ; + enemy_N = regGenN "fiende" neutrum ; + factory_N = mk2N "fabrik" "fabriker" ; + father_N2 = mkN2 ((mkN "far" "fadern" "fäder" "fäderna")) (mkPrep "till") ; + fear_VS = mkVS (regV "fruktar") ; + find_V2 = dirV2 (irregV "finna" "fann" "funnit") ; + fish_N = mk2N "fisk" "fiskar" ; + floor_N = regGenN "golv" neutrum ; + forget_V2 = dirV2 (mkV "glömma" "glömmer" "glöm" "glömde" "glömt" "glömd") ; + fridge_N = regGenN "kylskåp" neutrum ; + friend_N = mkN "vän" "vännen" "vänner" "vännerna" ; + fruit_N = mk2N "frukt" "frukter" ; + fun_AV = mkAV (regA "rolig") ; + garden_N = regGenN "trädgård" utrum ; + girl_N = regGenN "flicka" utrum ; + glove_N = regGenN "handske" utrum ; + gold_N = regGenN "guld" neutrum ; + good_A = mkA "god" "gott" "goda" "goda" "bättre" "bäst" "bästa" ; + go_V = (mkV "gå" "går" "gå" "gick" "gått" "gången") ; + green_A = regA "grön" ; + harbour_N = regGenN "hamn" utrum; + hate_V2 = dirV2 (regV "hatar") ; + hat_N = regGenN "hatt" utrum ; + have_V2 = dirV2 (mkV "ha" "har" "ha" "hade" "haft" "haft") ; ---- pp + hear_V2 = dirV2 (mkV "höra" "hör" "hör" "hörde" "hört" "hörd") ; + hill_N = regGenN "kulle" utrum ; +-- hope_VS = mkVS ((regV "önskar")) ; + hope_VS = mkVS (depV (regV "hoppar")) ; + horse_N = regGenN "häst" utrum ; + hot_A = regA "het" ; + house_N = regGenN "hus" neutrum ; + important_A = regA "viktig" ; + industry_N = mk2N "industri" "industrier" ; ---- "ien" ?? + iron_N = regGenN "järn" neutrum ; + king_N = (regGenN "kung" utrum) ; + know_V2 = dirV2 (mkV "veta" "vet" "vet" "visste" "vetat" "visst") ; + lake_N = mkN "sjö" "sjön" "sjöar" "sjöarna" ; + lamp_N = regGenN "lampa" utrum; + learn_V2 = dirV2 (reflV (mkV "lära" "lär" "lär" "lärde" "lärt" "lärd")) ; + leather_N = mkN "läder" "lädret" "läder" "lädren" ; + leave_V2 = dirV2 (regV "lämnar") ; + like_V2 = mkV2 (mk2V "tycka" "tyckte") (mkPrep "om") ; + listen_V2 = mkV2 (regV "lyssnar") (mkPrep "på") ; + live_V = (irregV "leva" "levde" "levt") ; ---- ? + long_A = irregA "lång" "längre" "längst" ; + lose_V2 = dirV2 (regV "förlora") ; + love_N = regGenN "kärlek" utrum ; + love_V2 = dirV2 (regV "älska") ; + man_N = (mkN "man" "mannen" "män" "männen") ; + married_A2 = mkA2 (mk2A "gift" "gift") (mkPrep "med") ; + meat_N = regGenN "kött" neutrum ; + milk_N = regGenN "mjölk" utrum ; ---- -ar? + moon_N = regGenN "måne" utrum ; + mother_N2 = mkN2 (mkN "mor" "modern" "mödrar" "mödrarna") (mkPrep "till") ; + mountain_N = regGenN "berg" neutrum ; + music_N = mk2N "musik" "musiker" ; ---- er ? + narrow_A = regA "smal" ; + new_A = mkA "ny" "nytt" "nya" "nya" "nyare" "nyast" "nyaste" ; + newspaper_N = regGenN "tidning" utrum ; + oil_N = regGenN "olja" utrum ; + old_A = mkA "gammal" "gammalt" "gamla" "gamla" "äldre" "äldst" "äldsta" ; + open_V2 = dirV2 (regV "öppna") ; + paint_V2A = mkV2A (regV "måla") noPrep ; + paper_N = mkN "papper" "pappret" "papper" "pappren" ; + paris_PN = regGenPN "Paris" neutrum ; + peace_N = regGenN "fred" utrum ; ---- ar? + pen_N = regGenN "penna" utrum ; + planet_N = mk2N "planet" "planeter" ; + plastic_N = mk2N "plast" "plaster" ; + play_V2 = dirV2 (regV "spela") ; + policeman_N = mk2N "polis" "poliser" ; + priest_N = mk2N "präst" "präster" ; + probable_AS = mkAS (regA "sannolik") ; + queen_N = regGenN "drottning" utrum ; + radio_N = mkN "radio" "radion" "radioapparater" "radioapparaterna" ; -- SAOL + rain_V0 = mkV0 (regV "regna") ; + read_V2 = dirV2 (mk2V "läsa" "läste") ; + red_A = mk2A "röd" "rött" ; + religion_N = mk2N "religion" "religioner" ; + restaurant_N = mk2N "restaurang" "restauranger" ; + river_N = mkN "å" "ån" "åar" "åarna" ; + rock_N = mkN "sten" "stenen" "stenar" "stenarna" ; + roof_N = regGenN "tak" neutrum ; + rubber_N = mkN "gummi" "gummit" "gummin" "gummina" ; + run_V = (irregV "springa" "sprang" "sprungit") ; + say_VS = mkVS (mkV "säga" "säger" "säg" "sade" "sagt" "sagd") ; + school_N = regGenN "skola" utrum; + science_N = mk2N "vetenskap" "vetenskaper" ; + sea_N = mkN "hav" "hav" ; + seek_V2 = dirV2 (mk2V "söka" "sökte") ; + see_V2 = dirV2 (mkV "se" "ser" "se" "såg" "sett" "sedd") ; + sell_V3 = dirV3 (irregV "sälja" "sålde" "sålt") (mkPrep "till") ; + send_V3 = dirV3 (regV "skicka") (mkPrep "till") ; + sheep_N = mk2N "får" "får" ; + ship_N = regGenN "skepp" neutrum ; + shirt_N = regGenN "skjorta" utrum ; + shoe_N = mk2N "sko" "skor" ; + shop_N = mk2N "affär" "affären" ; + short_A = regA "kort" ; + silver_N = mkN "silver" "silvret" "silver" "silvren" ; + sister_N = mk2N "syster" "systrar" ; + sleep_V = (irregV "sova" "sov" "sovit") ; + small_A = mkA "liten" "litet" "lilla" "små" "mindre" "minst" "minsta" ; + snake_N = regGenN "orm" utrum ; + sock_N = regGenN "strumpa" utrum ; + speak_V2 = dirV2 (regV "tala") ; + star_N = regGenN "stjärna" utrum ; + steel_N = regGenN "stål" utrum ; + stone_N = mkN "sten" "stenen" "stenar" "stenarna" ; + stove_N = regGenN "spis" utrum ; + student_N = mk2N "student" "studenter" ; + stupid_A = mk3A "dum" "dumt" "dumma" ; + sun_N = regGenN "sol" utrum ; + switch8off_V2 = dirV2 (partV (irregV "stänga" "stängde" "stängt") "av") ; + switch8on_V2 = dirV2 (partV (irregV "slå" "slog" "slagit") "på") ; + table_N = regGenN "bord" neutrum ; + talk_V3 = mkV3 (regV "prata") (mkPrep "till") (mkPrep "om") ; + teacher_N = mk2N "lärare" "lärare" ; + teach_V2 = dirV2 (regV "undervisa") ; + television_N = mk2N "television" "televisioner" ; + thick_A = regA "tjock" ; + thin_A = mk2A "tunn" "tunt" ; + train_N = regGenN "tåg" neutrum ; + travel_V = mk2V "resa" "reste" ; + tree_N = regGenN "träd" neutrum ; + ---- trousers_N = regGenN "trousers" ; ---- pl t ! + ugly_A = regA "ful" ; + understand_V2 = dirV2 (mkV "förstå" "förstår" "förstå" "förstod" "förstått" "förstådd") ; + university_N = regGenN "universitet" neutrum ; + village_N = mkN "by" "byn" "byar" "byarna" ; + wait_V2 = mkV2 (regV "vänta") (mkPrep "på") ; + walk_V = (mkV "gå" "går" "gå" "gick" "gått" "gången") ; + warm_A = regA "varm" ; + war_N = regGenN "krig" neutrum ; + watch_V2 = mkV2 (regV "titta") (mkPrep "på") ; + water_N = mkN "vatten" "vattnet" "vatten" "vattnen" ; + white_A = regA "vit" ; + window_N = mkN "fönster" "fönstret" "fönster" "fönstren" ; + wine_N = mkN "vin" "vinet" "viner" "vinerna" ; ---- + win_V2 = dirV2 (irregV "vinna" "vann" "vunnit") ; + woman_N = regGenN "kvinna" utrum ; + wonder_VQ = mkVQ (regV "undra") ; + wood_N = mkN "trä" "träet" "träen" "träena" ; ---- ? + write_V2 = dirV2 (irregV "skriva" "skrev" "skrivit") ; + yellow_A = regA "gul" ; + young_A = irregA "ung" "yngre" "yngst" ; + + do_V2 = dirV2 göra_V ; + now_Adv = mkAdv "nu" ; + already_Adv = mkAdv "redan" ; + song_N = mk2N "sång" "sånger" ; + add_V3 = mkV3 (partV (irregV "lägga" "lade" "lagt") "till") noPrep (mkPrep "till") ; + number_N = mkN "nummer" "numret" "numren" "numren" ; + put_V2 = mkV2 (mkV "sätta" "sätter" "sätt" "satte" "satt" "satt") noPrep ; + stop_V = regV "stanna" ; + jump_V = regV "hoppa" ; + + left_Ord = {s = "vänstra" ; isDet = True} ; + right_Ord = {s = "högra" ; isDet = True} ; + far_Adv = mkAdv "långt" ; + correct_A = regA "riktig" ; + dry_A = regA "torr" ; + dull_A = mk2A "slö" "slött"; + full_A = regA "full" ; + heavy_A = irregA "tung" "tyngre" "tyngst" ; + near_A = mkA "nära" "nära" "nära" "nära" "närmare" "närmast" "närmaste" ; + rotten_A = mk3A "rutten" "ruttet" "ruttna" ; + round_A = regA "rund" ; + sharp_A = regA "vass" ; + smooth_A = regA "slät" ; + straight_A = regA "rak" ; + wet_A = regA "våt" ; + wide_A = mk2A "bred" "brett" ; + animal_N = mk2N "djur" "djur" ; + ashes_N = mk2N "aska" "askor" ; + back_N = mk2N "rygg" "ryggar" ; + bark_N = mk2N "bark" "barkar" ; + belly_N = mk2N "mage" "magar" ; + blood_N = mk2N "blod" "blod" ; + bone_N = mk2N "ben" "ben" ; + breast_N = mk2N "bröst" "bröst" ; + cloud_N = mk2N "moln" "moln" ; + day_N = mk2N "dag" "dagar" ; + dust_N = mk2N "damm" "damm" ; + ear_N = mkN "öra" "örat" "öron" "öronen" ; + earth_N = mk2N "jord" "jordar" ; + egg_N = mk2N "ägg" "ägg" ; + eye_N = mkN "öga" "ögat" "ögon" "ögonen" ; + fat_N = mk2N "fett" "fett" ; + feather_N = mk2N "fjäder" "fjädrar" ; + fingernail_N = mkN "nagel" "nageln" "naglar" "naglarna"; + fire_N = mk2N "eld" "eldar" ; + flower_N = mk2N "blomma" "blommor" ; + fog_N = mk2N "dimma" "dimmor" ; + foot_N = mk2N "fot" "fötter" ; + forest_N = mk2N "skog" "skogar" ; + grass_N = mk2N "gräs" "gräs" ; + guts_N = mk2N "inälva" "inälvor" ; + hair_N = mk2N "hår" "hår" ; + hand_N = mk2N "hand" "händer" ; + head_N = mkN "huvud" "huvudet" "huvuden" "huvudena" ; + heart_N = mkN "hjärta" "hjärtat" "hjärtan" "hjärtana" ; + horn_N = mk2N "horn" "horn" ; + husband_N = (mk2N "make" "makar") ; + ice_N = mk2N "is" "isar" ; + knee_N = mkN "knä" "knäet" "knän" "knäna" ; + leaf_N = mk2N "löv" "löv" ; + leg_N = mk2N "ben" "ben" ; + liver_N = mkN "lever" "levern" "levrar" "levrarna"; + louse_N = mkN "lus" "lusen" "löss" "lössen" ; + mouth_N = mkN "mun" "munnen" "munnar" "munnarna" ; + name_N = mk2N "namn" "namn" ; + neck_N = mk2N "nacke" "nackar" ; + night_N = mk2N "natt" "nätter" ; + nose_N = mk2N "näsa" "näsor" ; + person_N = mk2N "person" "personer" ; + rain_N = mk2N "regn" "regn" ; + road_N = mk2N "väg" "vägar" ; + root_N = mk2N "rot" "rötter" ; + rope_N = mk2N "rep" "rep" ; + salt_N = mkN "salt" "saltet" "salter" "salterna"; + sand_N = mk2N "sand" "sander" ; + seed_N = mkN "frö" "fröet" "frön" "fröna" ; + skin_N = mk2N "skinn" "skinn" ; + sky_N = mk2N "himmel" "himlar" ; + smoke_N = mk2N "rök" "rökar" ; + snow_N = mkN "snö" "snön" "snöer" "snöerna" ; + stick_N = mk2N "pinne" "pinnar" ; + tail_N = mk2N "svans" "svansar" ; + tongue_N = mk2N "tunga" "tungor" ; + tooth_N = mk2N "tand" "tänder" ; + wife_N = mk2N "fru" "fruar" ; + wind_N = mk2N "vind" "vindar" ; + wing_N = mk2N "vinge" "vingar" ; + worm_N = mk2N "mask" "maskar" ; + year_N = mk2N "år" "år" ; + bite_V2 = dirV2 (bita_V) ; + blow_V = mk2V "blåsa" "blåste" ; + burn_V = brinna_V ; -- FIXME: bränna? + count_V2 = dirV2 (regV "räkna") ; + cut_V2 = dirV2 (skära_V) ; + dig_V = mk2V "gräva" "grävde" ; + fall_V = falla_V ; + fear_V2 = dirV2 (regV "frukta") ; + float_V = flyta_V ; + flow_V = rinna_V ; + fly_V = flyga_V ; + freeze_V = frysa_V ; + give_V3 = dirV3 giva_V (mkPrep "till"); + hit_V2 = dirV2 (slå_V) ; + hold_V2 = dirV2 (hålla_V) ; + hunt_V2 = dirV2 (regV "jaga") ; + kill_V2 = dirV2 (regV "döda") ; + laugh_V = regV "skratta" ; + lie_V = ligga_V ; + play_V = mk2V "leka" "lekte" ; + pull_V2 = dirV2 (draga_V) ; + push_V2 = dirV2 (mk2V "trycka" "tryckte") ; + rub_V2 = dirV2 (gnida_V) ; + scratch_V2 = dirV2 (regV "klia") ; + sew_V = sy_V ; + sing_V = sjunga_V ; + sit_V = sitta_V ; + smell_V = regV "lukta" ; + spit_V = regV "spotta" ; + split_V2 = dirV2 (klyva_V) ; + squeeze_V2 = dirV2 (klämma_V) ; + stab_V2 = dirV2 (sticka_V) ; + stand_V = stå_V ; + suck_V2 = dirV2 (suga_V) ; + swell_V = svälla_V ; + swim_V = regV "simma" ; + think_V = mk2V "tänka" "tänkte" ; + throw_V2 = dirV2 (regV "kasta") ; + tie_V2 = dirV2 (knyta_V) ; + turn_V = vända_V ; + vomit_V = mk2V "spy" "spydde" ; + wash_V2 = dirV2 (regV "tvätta") ; + wipe_V2 = dirV2 (regV "torka") ; + + breathe_V = depV (regV "anda") ; + fight_V2 = + mkV2 (mkV "slåss" "slåss" "slåss" "slogs" "slagits" "slagen") (mkPrep "med") ; + + grammar_N = mk1N "grammatikerna" ; + language_N = mk2N "språk" "språk" ; + rule_N = mkN "regel" "regeln" "regler" "reglerna" ; + + john_PN = regPN "Johan" ; + question_N = regN "fråga" ; + ready_A = regA "färdig" ; + reason_N = regN "anledning" ; + today_Adv = mkAdv "idag" ; + uncertain_A = mk3A "osäker" "osäkert" "osäkra" ; + + +} ; diff --git a/lib/next-resource/swedish/MorphoSwe.gf b/lib/next-resource/swedish/MorphoSwe.gf new file mode 100644 index 000000000..48180b781 --- /dev/null +++ b/lib/next-resource/swedish/MorphoSwe.gf @@ -0,0 +1,73 @@ +--# -path=.:../scandinavian:../common:../../prelude + +--1 A Simple Swedish Resource Morphology +-- +-- Aarne Ranta 2002 -- 2005 +-- +-- This resource morphology contains definitions needed in the resource +-- syntax. To build a lexicon, it is better to use $ParadigmsSwe$, which +-- gives a higher-level access to this module. + +resource MorphoSwe = CommonScand, ResSwe ** open Prelude, (Predef=Predef) in { + + +-- Verbs + +-- Heuristic to infer all participle forms from one. + +oper + ptPretAll : Str -> Str * Str = \funnen -> + case funnen of { + ko +"mmen" => ; + vun +"nen" => ; + bjud + "en" => ; + se + "dd" => ; + tal + "ad" => ; + kaen + "d" => ; + lekt => + } ; + + ptPretForms : Str -> AFormPos => Case => Str = \funnen -> \\a,c => + let + funfun = ptPretAll funnen + in + mkCase c (case a of { + (Strong (SgUtr)) => funnen ; + (Strong (SgNeutr)) => funfun.p1 ; + _ => funfun.p2 + } + ) ; + +-- For $Numeral$. + +param DForm = ental | ton | tiotal ; + +oper + LinDigit = {s : DForm => CardOrd => Str} ; + + cardOrd : Str -> Str -> CardOrd => Str = \tre,tredje -> + table { + NCard _ => tre ; + NOrd a => tredje ---- a + } ; + + cardReg : Str -> CardOrd => Str = \tio -> + cardOrd tio (tio + "nde") ; + + mkTal : (x1,_,_,_,x5 : Str) -> LinDigit = + \två, tolv, tjugo, andra, tolfte -> + {s = table { + ental => cardOrd två andra ; + ton => cardOrd tolv tolfte ; + tiotal => cardReg tjugo + } + } ; + + numPl : (CardOrd => Str) -> {s : CardOrd => Str ; n : Number} = \n -> + {s = n ; n = Pl} ; + + invNum : CardOrd = NCard Neutr ; + + +} ; + diff --git a/lib/next-resource/swedish/NounSwe.gf b/lib/next-resource/swedish/NounSwe.gf new file mode 100644 index 000000000..d866558a4 --- /dev/null +++ b/lib/next-resource/swedish/NounSwe.gf @@ -0,0 +1,2 @@ +concrete NounSwe of Noun = CatSwe ** NounScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/NumeralSwe.gf b/lib/next-resource/swedish/NumeralSwe.gf new file mode 100644 index 000000000..bf4186be2 --- /dev/null +++ b/lib/next-resource/swedish/NumeralSwe.gf @@ -0,0 +1,83 @@ +concrete NumeralSwe of Numeral = CatSwe ** open ResSwe, MorphoSwe in { + +lincat + Digit = {s : DForm => CardOrd => Str} ; + Sub10 = {s : DForm => CardOrd => Str ; n : Number} ; + Sub100, Sub1000, Sub1000000 = + {s : CardOrd => Str ; n : Number} ; + +lin + num x = x ; + + n2 = mkTal "två" "tolv" "tjugo" "andra" "tolfte" ; + n3 = mkTal "tre" "tretton" "trettio" "tredje" "trettonde" ; + n4 = mkTal "fyra" "fjorton" "fyrtio" "fjärde" "fjortonde" ; + n5 = mkTal "fem" "femton" "femtio" "femte" "femtonde" ; + n6 = mkTal "sex" "sexton" "sextio" "sjätte" "sextonde" ; + n7 = mkTal "sju" "sjutton" "sjuttio" "sjunde" "sjuttonde" ; + n8 = mkTal "åtta" "arton" "åttio" "åttonde" "artonde" ; + n9 = mkTal "nio" "nitton" "nittio" "nionde" "nittonde" ; + + pot01 = { + s = \\f => table { + NCard g => case g of {Neutr => "ett" ; _ => "en"} ; + _ => "första" + } ; + n = Sg + } ; + pot0 d = {s = \\f,g => d.s ! f ! g ; n = Pl} ; + pot110 = numPl (cardReg "tio") ; + pot111 = numPl (cardOrd "elva" "elfte") ; + pot1to19 d = numPl (d.s ! ton) ; + pot0as1 n = {s = n.s ! ental ; n = n.n} ; + pot1 d = numPl (d.s ! tiotal) ; + pot1plus d e = {s = \\g => d.s ! tiotal ! invNum ++ e.s ! ental ! g ; n = Pl} ; + pot1as2 n = n ; + pot2 d = + numPl (\\g => d.s ! ental ! invNum ++ cardOrd "hundra" "hundrade" ! g) ; + pot2plus d e = + {s = \\g => d.s ! ental ! invNum ++ "hundra" ++ e.s ! g ; n = Pl} ; + pot2as3 n = n ; + pot3 n = + numPl (\\g => n.s ! invNum ++ cardOrd "tusen" "tusende" ! g) ; + pot3plus n m = + {s = \\g => n.s ! invNum ++ "tusen" ++ m.s ! g ; n = Pl} ; + + lincat + Dig = TDigit ; + + lin + IDig d = d ; + + IIDig d i = { + s = \\o => d.s ! NCard neutrum ++ i.s ! o ; + n = Pl + } ; + + D_0 = mkDig "0" ; + D_1 = mk3Dig "1" "1:a" Sg ; + D_2 = mk2Dig "2" "2:a" ; + D_3 = mkDig "3" ; + D_4 = mkDig "4" ; + D_5 = mkDig "5" ; + D_6 = mkDig "6" ; + D_7 = mkDig "7" ; + D_8 = mkDig "8" ; + D_9 = mkDig "9" ; + + oper + mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ; + mkDig : Str -> TDigit = \c -> mk2Dig c (c + ":e") ; + + mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> { + s = table {NCard _ => c ; NOrd _ => o} ; + n = n + } ; + + TDigit = { + n : Number ; + s : CardOrd => Str + } ; + +} + diff --git a/lib/next-resource/swedish/ParadigmsSwe.gf b/lib/next-resource/swedish/ParadigmsSwe.gf new file mode 100644 index 000000000..e49fe2105 --- /dev/null +++ b/lib/next-resource/swedish/ParadigmsSwe.gf @@ -0,0 +1,647 @@ +--# -path=.:../scandinavian:../common:../abstract:../../prelude + +--1 Swedish Lexical Paradigms +-- +-- Aarne Ranta 2001 - 2006 +-- +-- 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. +-- +-- Closed categories (determiners, pronouns, conjunctions) are +-- accessed through the resource syntax API, $Structural.gf$. +-- +-- The main difference with $MorphoSwe.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 structure of functions for each word class $C$ is the following: +-- first we give a handful of patterns that aim to cover all +-- 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 [``IrregSwe`` ../../swedish/IrregSwe], +-- which covers many irregular verbs. + + +resource ParadigmsSwe = + open + (Predef=Predef), + Prelude, + CommonScand, + ResSwe, + MorphoSwe, + CatSwe in { + +--2 Parameters +-- +-- To abstract over gender names, we define the following identifiers. + +oper + Gender : Type ; + + utrum : Gender ; + neutrum : 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 ; + +-- Prepositions used in many-argument functions can be constructed from strings. + + mkPrep : Str -> Prep ; + noPrep : Prep ; -- empty string + + +--2 Nouns + +-- The following overloaded paradigm takes care of all noun formation. + + mkN : overload { + +-- The one-argument case takes the singular indefinite form and computes +-- the other forms and the gender by a simple heuristic. The heuristic is currently +-- to treat all words ending with "a" like "apa-apor", with "e" like "rike-riken", +-- and otherwise like "bil-bilar". + + mkN : (apa : Str) -> N ; + +-- The case with a string and gender makes it possible to treat +-- "lik" (neutrum) and "pojke" (utrum). + + mkN : (lik : Str) -> Gender -> N ; + +-- Giving two forms - the singular and plural indefinite - is sufficient for +-- most nouns. The paradigm deals correctly with the vowel contractions in +-- "nyckel - nycklar" such as "pojke - pojkar". + + mkN : (nyckel,nycklar : Str) -> N ; + +-- In the worst case, four forms are needed. + + mkN : (museum,museet,museer,museerna : Str) -> N + } ; + +-- All the functions above work quite as well to form *compound nouns*, +-- such as "fotboll". + + + +--3 Relational nouns +-- +-- Relational nouns ("kung av x") are nouns with a preposition. +-- As a special case, we provide regular nouns (formed with one-argument $mkN$) +-- with the preposition "av". + + mkN2 : overload { + mkN2 : Str -> N2 ; + mkN2 : N -> Prep -> N2 + } ; + +-- Three-place relational nouns ("förbindelse från x till y") +-- need two prepositions. + + mkN3 : N -> Prep -> Prep -> N3 ; + + +--3 Relational common noun phrases +-- +-- In some cases, you may want to make a complex $CN$ into a +-- relational noun (e.g. "den före detta maken till"). However, $N2$ and +-- $N3$ are purely lexical categories. But you can use the $AdvCN$ +-- and $PrepNP$ constructions to build phrases like this. + +-- +--3 Proper names and noun phrases +-- +-- Proper names, with a regular genitive, are formed from strings and +-- have the default gender utrum. + + mkPN : overload { + mkPN : Str -> PN ; + mkPN : Str -> Gender -> PN ; + +-- In the worst case, the genitive form is irregular. + + mkPN : (jesus,jesu : Str) -> Gender -> PN + } ; + + +--2 Adjectives + +-- Adjectives need one to seven forms. + + mkA : overload { + +-- Most adjectives are formed simply by adding endings to a stem. + + mkA : (billig : Str) -> A ; + +-- Some adjectives have a deviant neuter form. The following pattern +-- also recognizes the neuter formation "galen-galet" and forms the +-- proper plural and comparison forms "galna-galnare-galnast". + + mkA : (bred,brett : Str) -> A ; + +-- Umlaut in comparison forms is + + mkA : (tung,tyngre,tyngst : Str) -> A ; + +-- A few adjectives need 5 forms. + mkA : (god,gott,goda,battre,bast : Str) -> A ; + +-- Hardly any other adjective than "liten" needs the full 7 forms. + + mkA : (liten,litet,lilla,sma,mindre,minst,minsta : Str) -> A + } ; + +-- Comparison forms may be compound ("mera svensk" - "mest svensk"); +-- this behaviour can be forced on any adjective. + + compoundA : A -> A ; + + + + +--3 Two-place adjectives +-- +-- Two-place adjectives need a preposition for their second argument. + + mkA2 : A -> Prep -> A2 ; + + +--2 Adverbs + +-- Adverbs are not inflected. Most lexical ones have position +-- after the verb. Some can be preverbal in subordinate position +-- (e.g. "alltid"). + + mkAdv : Str -> Adv ; -- här + mkAdV : Str -> AdV ; -- alltid + +-- Adverbs modifying adjectives and sentences can also be formed. + + mkAdA : Str -> AdA ; + +--2 Verbs +-- +-- All verbs can be defined by the overloaded paradigm $mkV$. + + mkV : overload { + +-- The 'regular verb' (= one-place) case is inspired by Lexin. It uses the +-- present tense indicative form. The value is the first conjugation if the +-- argument ends with "ar" ("tala" - "talar" - "talade" - "talat"), +-- the second with "er" ("leka" - "leker" - "lekte" - "lekt", with the +-- variations like in "gräva", "vända", "tyda", "hyra"), and +-- the third in other cases ("bo" - "bor" - "bodde" - "bott"). +-- It is also possible to give the infinite form to it; they are treated +-- as if they were implicitly suffixed by "r". Moreover, deponent verbs +-- are recognized from the final "s" ("hoppas"). + + mkV : (stämmer : Str) -> V ; + +-- Most irregular verbs need just the conventional three forms. + + mkV : (dricka,drack,druckit : Str) -> V ; + +-- In the worst case, six forms are given. + + mkV : (gå,går,gå,gick,gått,gången : Str) -> V ; + +-- Particle verbs, such as "passa på", are formed by adding a string to a verb. + + mkV : V -> Str -> V + } ; + + +--3 Deponent verbs. +-- +-- Some words are used in passive forms only, e.g. "hoppas", some as +-- reflexive e.g. "ångra sig". Regular deponent verbs are also +-- handled by $mkV$ and recognized from the ending "s". + + depV : V -> V ; + reflV : V -> V ; + + +--3 Two-place verbs +-- +-- Two-place verbs need a preposition, which default to the 'empty preposition' +-- i.e. direct object. (transitive verbs). The simplest case is a regular +-- verb (as in $mkV$) with a direct object. +-- Notice that, if a particle is needed, it comes from the $V$. + + mkV2 : overload { + mkV2 : Str -> V2 ; + mkV2 : V -> V2 ; + mkV2 : V -> Prep -> V2 + } ; + + +--3 Three-place verbs +-- +-- Three-place (ditransitive) verbs need two prepositions, of which +-- the first one or both can be absent. The simplest case is a regular +-- verb (as in $mkV$) with no prepositions. + + mkV3 : overload { + mkV3 : Str -> V3 ; + mkV3 : V -> V3 ; + mkV3 : V -> Prep -> V3 ; + mkV3 : V -> Prep -> Prep -> V3 + } ; + +--3 Other complement patterns +-- +-- Verbs and adjectives can take complements such as sentences, +-- questions, verb phrases, and adjectives. + + mkV0 : V -> V0 ; + mkVS : V -> VS ; + mkV2S : V -> Prep -> V2S ; + mkVV : V -> VV ; + mkV2V : V -> Prep -> Prep -> V2V ; + mkVA : V -> VA ; + mkV2A : V -> Prep -> V2A ; + mkVQ : V -> VQ ; + mkV2Q : V -> Prep -> V2Q ; + + mkAS : A -> AS ; + mkA2S : A -> Prep -> A2S ; + mkAV : A -> AV ; + mkA2V : A -> Prep -> A2V ; + +-- Notice: categories $AS, A2S, AV, A2V$ are just $A$. +-- $V0$ is just $V$. + + V0 : Type ; + AS, A2S, AV, A2V : Type ; + +--. +--2 Definitions of the paradigms +-- +-- The definitions should not bother the user of the API. So they are +-- hidden from the document. + + Gender = ResSwe.Gender ; + Number = CommonScand.Number ; + Case = CommonScand.Case ; + utrum = Utr ; + neutrum = Neutr ; + singular = Sg ; + plural = Pl ; + nominative = Nom ; + genitive = Gen ; + + mkPrep p = {s = p ; lock_Prep = <>} ; + noPrep = mkPrep [] ; + + mkN = overload { + mkN : (apa : Str) -> N = regN ; + mkN : Str -> Gender -> N = regGenN ; + mkN : (nyckel, nycklar : Str) -> N = mk2N ; + mkN : (museum,museet,museer,museerna : Str) -> N = mk4N + } ; + + mk4N : (museum,museet,museer,museerna : Str) -> N = \apa,apan,apor,aporna -> { + s = nounForms apa apan apor aporna ; + g = case last apan of { + "n" => Utr ; + _ => Neutr + } + } ** {lock_N = <>} ; + + regN : Str -> N = \bil -> regGenN bil g where { + g = case of { + _ + "e" => Neutr ; + _ => Utr + } + } ; + + regGenN : Str -> Gender -> N = \bil, g -> case g of { + Utr => case last bil of { + "a" => decl1Noun bil ; + _ => decl2Noun bil + } ; + Neutr => case last bil of { + "e" => decl4Noun bil ; + _ => decl5Noun bil + } + } ** {lock_N = <>} ; + + mk1N : Str -> N = \bilarna -> case bilarna of { + ap + "orna" => decl1Noun (ap + "a") ; + bil + "arna" => decl2Noun bil ; + rad + "erna" => decl3Noun rad ; + rik + "ena" => decl4Noun (rik + "e") ; + husen => decl5Noun (Predef.tk 2 husen) + } ; + + mk2N : Str -> Str -> N = \bil,bilar -> + ifTok N bil bilar (decl5Noun bil) ( + case Predef.dp 2 bilar of { + "or" => case bil of { + _ + "a" => decl1Noun bil ; -- apa, apor + _ + "o" => mk4N bil (bil + "n") bilar (bilar + "na") ; -- ko,kor + _ => mk4N bil (bil + "en") bilar (bilar + "na") -- ros,rosor + } ; + "ar" => decl2Noun bil ; + "er" => case bil of { + _ + "or" => mk4N bil (bil + "n") bilar (bilar + "na") ; -- motor,motorn + _ => decl3gNoun bil bilar -- fot, fötter + } ; + "en" => decl4Noun bil ; -- rike, riken + _ => mk4N bil (bil + "et") bilar (bilar + "n") -- centrum, centra + }) ; + +-- School declensions. + + decl1Noun : Str -> N = \apa -> + let ap = init apa in + mk4N apa (apa + "n") (ap + "or") (ap + "orna") ; + + decl2Noun : Str -> N = \bil -> + let + bb : Str * Str = case bil of { + br + ("o" | "u" | "ö" | "å") => ; + pojk + "e" => ; + hi + "mme" + l@("l" | "r") => ; + nyck + "e" + l@("l" | "r") => ; + sock + "e" + "n" => ; + _ => + } ; + in mk4N bil bb.p2 bb.p1 (bb.p1 + "na") ; + + decl3Noun : Str -> N = \sak -> + case last sak of { + "e" => mk4N sak (sak + "n") (sak +"r") (sak + "rna") ; + "y" | "å" | "é" | "y" => mk4N sak (sak + "n") (sak +"er") (sak + "erna") ; + _ => mk4N sak (sak + "en") (sak + "er") (sak + "erna") + } ; + decl3gNoun : Str -> Str -> N = \sak,saker -> + case last sak of { + "e" => mk4N sak (sak + "n") saker (saker + "na") ; + "y" | "å" | "é" | "y" => mk4N sak (sak + "n") saker (saker + "na") ; + _ => mk4N sak (sak + "en") saker (saker + "na") + } ; + + decl4Noun : Str -> N = \rike -> + mk4N rike (rike + "t") (rike + "n") (rike + "na") ; + + decl5Noun : Str -> N = \lik -> + case lik of { + nu + "mme" + l@("l" | "r") => + mk4N lik (nu + "m" + l + "et") lik (nu + "m" + l + "en") ; + vad@(?+?+?+_) + "e" + l@("l" | "r") => + mk4N lik (vad + l + "et") lik (vad + l + "en") ; + _ + "are" => mk4N lik (lik + "n") lik (init lik + "na") ; -- kikare + _ => mk4N lik (lik + "et") lik (lik + "en") + } ; + + mkN2 = overload { + mkN2 : Str -> N2 = \s -> mmkN2 (regN s) (mkPrep "av") ; + mkN2 : N -> Prep -> N2 = mmkN2 + } ; + + mmkN2 : N -> Prep -> N2 ; + regN2 : Str -> Gender -> N2 ; + + + mmkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = mkComplement p.s} ; + regN2 n g = mmkN2 (regGenN n g) (mkPrep "av") ; + mkN3 = \n,p,q -> n ** + {lock_N3 = <> ; c2 = mkComplement p.s ; c3 = mkComplement q.s} ; + + mkPN = overload { + mkPN : Str -> PN = regPN ; + mkPN : Str -> Gender -> PN = regGenPN ; + mkPN : (jesus,jesu : Str) -> Gender -> PN = \jesus,jesu,g -> + {s = table {Nom => jesus ; Gen => jesu} ; g = g ; lock_PN = <>} ; + } ; + + regPN n = regGenPN n utrum ; + regGenPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ; + nounPN n = {s = n.s ! singular ! Indef ; g = n.g ; lock_PN = <>} ; + makeNP x y n g = + {s = table {NPPoss _ => y ; _ => x} ; a = agrP3 g n ; p = P3 ; + lock_NP = <>} ; + + mkA = overload { + mkA : (billig : Str) -> A = regA ; + mkA : (bred,brett : Str) -> A = mk2A ; + mkA : (tung,tyngre,tyngst : Str) -> A = irregA ; + mkA : (god,gott,goda,battre,bast : Str) -> A = + \liten,litet,lilla,mindre,minst -> + mk7A liten litet lilla lilla mindre minst (minst + "a") ; + mkA : (liten,litet,lilla,sma,mindre,minst,minsta : Str) -> A = mk7A + } ; + + + regA : Str -> A ; + mk2A : (bred,brett : Str) -> A ; + irregA : (tung,tyngre,tyngst : Str) -> A ; + mk7A : (liten,litet,lilla,sma,mindre,minst,minsta : Str) -> A ; + + mk7A a b c d e f g = mkAdjective a b c d e f g ** {isComp = False ; lock_A = <>} ; + regA fin = + let fint : Str = case fin of { + ru + "nd" => ru + "nt" ; + se + "dd" => se + "tt" ; + pla + "tt" => pla + "tt" ; + gla + "d" => gla + "tt" ; + _ => fin + "t" + } + in + mk3A fin fint (fin + "a") ; + irregA ung yngre yngst = + mk7A ung (ung + "t") (ung + "a") (ung + "a") yngre yngst (yngst+"a") ; + + mk3A ljummen ljummet ljumma = + mk7A + ljummen ljummet ljumma ljumma + (ljumma + "re") (ljumma + "st") (ljumma + "ste") ; + mk2A vid vitt = case of { + => mk3A vid vitt (gal + "na") ; + _ => mk3A vid vitt (vid + "a") + } ; + + compoundA adj = {s = adj.s ; isComp = True ; lock_A = <>} ; + + mkA2 a p = a ** {c2 = mkComplement p.s ; lock_A2 = <>} ; + + mkAdv x = ss x ** {lock_Adv = <>} ; + mkAdV x = ss x ** {lock_AdV = <>} ; + mkAdA x = ss x ** {lock_AdA = <>} ; + + mkV = overload { + mkV : (stämmer : Str) -> V = regV ; + mkV : (dricka,drack,druckit : Str) -> V = irregV ; + mkV : (supa,super,sup,söp,supit,supen : Str) -> V = mk6V ; + mkV : V -> Str -> V = partV + } ; + + mk6V = \finna,finner,finn,fann,funnit,funnen -> + let + funn = ptPretForms funnen ; + funnet = funn ! Strong SgNeutr ! Nom ; + funna = funn ! Strong Plg ! Nom + in + mkVerb finna finner finn fann funnit funnen funnet funna ** + {part = [] ; vtype=VAct ; lock_V = <>} ; + + regV leker = case leker of { + lek + "a" => conj1 leker ; --- bw compat + lek + "ar" => conj1 (lek + "a") ; + lek + "er" => conj2 (lek + "a") ; + bo + "r" => conj3 bo ; + ret + "as" => depV (conj1 (ret + "a")) ; + n + ("os" | "ys" | "ås" | "ös") => depV (conj3 (init leker)) ; + ret + "s" => depV (conj2 (ret + "a")) ; + _ => conj3 leker + } ; + + mk2V leka lekte = case of { + <_, _ + "ade"> => conj1 leka ; + <_ + "a", _> => conj2 leka ; + _ => conj3 leka + } ; + +-- school conjugations + + conj1 : Str -> V = \tala -> + mk6V tala (tala + "r") tala (tala +"de") (tala +"t") (tala +"d") ; + + conj2 : Str -> V = \leka -> + let lek = init leka in + case last lek of { + "l" | "m" | "n" | "v" | "g" => + let gom = case of { + _ + "mm" => init lek ; + _ => lek + } + in mk6V leka (lek + "er") gom (gom +"de") (gom +"t") (gom +"d") ; + "r" => + mk6V leka lek lek (lek +"de") (lek +"t") (lek +"d") ; + _ => case lek of { + _ + "nd" => + mk6V leka (lek + "er") lek (lek +"e") (init lek +"t") lek ; + _ => + mk6V leka (lek + "er") lek (lek +"te") (lek +"t") (lek +"t") + } + } ; + + conj3 : Str -> V = \bo -> + mk6V bo (bo + "r") bo (bo +"dde") (bo +"tt") (bo +"dd") ; + + irregV = \sälja, sålde, sålt -> + let + säljer = case last sälja of { + "a" => conj2 sälja ; + _ => conj3 sälja + } ; + såld = case Predef.dp 2 sålt of { + "it" => Predef.tk 2 sålt + "en" ; + "tt" => Predef.tk 2 sålt + "dd" ; + _ => init sålt + "d" + } + in + mk6V sälja (säljer.s ! VF (VPres Act)) (säljer.s ! (VF (VImper Act))) sålde sålt såld + ** {s1 = [] ; lock_V = <>} ; + + partV v p = {s = v.s ; part = p ; vtype = v.vtype ; lock_V = <>} ; + depV v = {s = v.s ; part = v.part ; vtype = VPass ; lock_V = <>} ; + reflV v = {s = v.s ; part = v.part ; vtype = VRefl ; lock_V = <>} ; + + mkV2 = overload { + mkV2 : (läser : Str) -> V2 = \v -> dirV2 (regV v) ; + mkV2 : V -> V2 = dirV2 ; + mkV2 : V -> Prep -> V2 = mmkV2 + } ; + + + mmkV2 v p = v ** {c2 = mkComplement p.s ; lock_V2 = <>} ; + dirV2 v = mmkV2 v noPrep ; + + mkV3 = overload { + mkV3 : Str -> V3 = \v -> dirdirV3 (regV v) ; + mkV3 : V -> V3 = dirdirV3 ; + mkV3 : V -> Prep -> V3 = dirV3 ; + mkV3 : V -> Prep -> Prep -> V3 = mmkV3 + } ; + + mmkV3 : V -> Prep -> Prep -> V3 ; -- tala, med, om + dirV3 : V -> Prep -> V3 ; -- ge, (acc),till + dirdirV3 : V -> V3 ; -- ge, (dat), (acc) + + + mmkV3 v p q = v ** {c2 = mkComplement p.s ; c3 = mkComplement q.s ; lock_V3 = <>} ; + dirV3 v p = mmkV3 v noPrep p ; + dirdirV3 v = dirV3 v noPrep ; + + mkV0 v = v ** {lock_V0 = <>} ; + mkVS v = v ** {lock_VS = <>} ; + mkVV v = v ** {c2 = mkComplement "att" ; lock_VV = <>} ; + mkVQ v = v ** {lock_VQ = <>} ; + + mkVA v = v ** {lock_VA = <>} ; + mkV2A v p = mmkV2 v p ** {lock_V2A = <>} ; + + V0 : Type = V ; +-- V2S, V2V, V2Q : Type = V2 ; + AS, A2S, AV : Type = A ; + A2V : Type = A2 ; + + mkV2S v p = mmkV2 v p ** {lock_V2S = <>} ; + mkV2V v p t = mmkV2 v p ** {c3 = mkComplement "att" ; lock_V2V = <>} ; + mkV2Q v p = mmkV2 v p ** {lock_V2Q = <>} ; + + 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_A = <>} ; + +----------Obsolete + +-- To form a noun phrase that can also be plural and have an irregular +-- genitive, you can use the worst-case function. + + makeNP : Str -> Str -> Number -> Gender -> NP ; + + + + regGenPN : Str -> Gender -> PN ; + regPN : Str -> PN ; -- utrum + +-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". + + nounPN : N -> PN ; + +-- Sometimes just the positive forms are irregular. + + mk3A : (galen,galet,galna : Str) -> A ; + + mk6V : (supa,super,sup,söp,supit,supen : Str) -> V ; + regV : (talar : Str) -> V ; + mk2V : (leka,lekte : Str) -> V ; + irregV : (dricka, drack, druckit : Str) -> V ; + + partV : V -> Str -> V ; + + mmkV2 : V -> Prep -> V2 ; + + dirV2 : V -> V2 ; + + +} ; diff --git a/lib/next-resource/swedish/PhraseSwe.gf b/lib/next-resource/swedish/PhraseSwe.gf new file mode 100644 index 000000000..8fccfc6d2 --- /dev/null +++ b/lib/next-resource/swedish/PhraseSwe.gf @@ -0,0 +1,2 @@ +concrete PhraseSwe of Phrase = CatSwe ** PhraseScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/QuestionSwe.gf b/lib/next-resource/swedish/QuestionSwe.gf new file mode 100644 index 000000000..642fd0353 --- /dev/null +++ b/lib/next-resource/swedish/QuestionSwe.gf @@ -0,0 +1,2 @@ +concrete QuestionSwe of Question = CatSwe ** QuestionScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/RelativeSwe.gf b/lib/next-resource/swedish/RelativeSwe.gf new file mode 100644 index 000000000..3bf74a3d6 --- /dev/null +++ b/lib/next-resource/swedish/RelativeSwe.gf @@ -0,0 +1,2 @@ +concrete RelativeSwe of Relative = CatSwe ** RelativeScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/ResSwe.gf b/lib/next-resource/swedish/ResSwe.gf new file mode 100644 index 000000000..7b5a52a88 --- /dev/null +++ b/lib/next-resource/swedish/ResSwe.gf @@ -0,0 +1,3 @@ +instance ResSwe of ResScand = DiffSwe ** open CommonScand, Prelude in { +} ; + diff --git a/lib/next-resource/swedish/SentenceSwe.gf b/lib/next-resource/swedish/SentenceSwe.gf new file mode 100644 index 000000000..553af3b46 --- /dev/null +++ b/lib/next-resource/swedish/SentenceSwe.gf @@ -0,0 +1,2 @@ +concrete SentenceSwe of Sentence = CatSwe ** SentenceScand with + (ResScand = ResSwe) ; diff --git a/lib/next-resource/swedish/StructuralSwe.gf b/lib/next-resource/swedish/StructuralSwe.gf new file mode 100644 index 000000000..98d54eb29 --- /dev/null +++ b/lib/next-resource/swedish/StructuralSwe.gf @@ -0,0 +1,127 @@ +concrete StructuralSwe of Structural = CatSwe ** + open MorphoSwe, ParadigmsSwe, Prelude in { + + flags optimize=all ; + + lin + above_Prep = ss "ovanför" ; + after_Prep = ss "efter" ; + by8agent_Prep = ss "av" ; + all_Predet = {s = gennumForms "all" "allt" "alla"} ; + almost_AdA, almost_AdN = ss "nästan" ; + although_Subj = ss "fast" ; + always_AdV = ss "alltid" ; + and_Conj = {s1 = [] ; s2 = "och" ; n = Pl} ; + because_Subj = ss "eftersom" ; + before_Prep = ss "före" ; + behind_Prep = ss "bakom" ; + between_Prep = ss "mellan" ; + both7and_DConj = sd2 "både" "och" ** {n = Pl} ; + but_PConj = ss "men" ; + by8means_Prep = ss "med" ; + can8know_VV, can_VV = + mkV "kunna" "kan" "kunn" "kunde" "kunnat" "kunnen" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + during_Prep = ss "under" ; + either7or_DConj = sd2 "antingen" "eller" ** {n = Sg} ; + everybody_NP = regNP "alla" "allas" Plg ; + every_Det = {s = \\_,_ => "varje" ; n = Sg ; det = DIndef} ; + everything_NP = regNP "allting" "alltings" SgNeutr ; + everywhere_Adv = ss "överallt" ; + few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ; +--- first_Ord = {s = "första" ; isDet = True} ; + for_Prep = ss "för" ; + from_Prep = ss "från" ; + he_Pron = MorphoSwe.mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ; + here_Adv = ss "här" ; + here7to_Adv = ss "hit" ; + here7from_Adv = ss "härifrån" ; + how_IAdv = ss "hur" ; + how8many_IDet = {s = \\_ => ["hur många"] ; n = Pl ; det = DDef Indef} ; + if_Subj = ss "om" ; + in8front_Prep = ss "framför" ; + i_Pron = MorphoSwe.mkNP "jag" "mig" "min" "mitt" "mina" SgUtr P1 ; + in_Prep = ss "i" ; + it_Pron = MorphoSwe.regNP "det" "dess" SgNeutr ; + less_CAdv = ss "mindre" ; + many_Det = {s = \\_,_ => "många" ; n = Pl ; det = DDef Indef} ; + more_CAdv = ss "mer" ; + most_Predet = {s = gennumForms ["den mesta"] ["det mesta"] ["de flesta"]} ; + much_Det = {s = \\_,_ => "mycket" ; n = Pl ; det = DDef Indef} ; + must_VV = + mkV "få" "måste" "få" "fick" "måst" "måst" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + no_Utt = ss ["nej"] ; + on_Prep = ss "på" ; +--- one_Quant = {s = \\_,_ => genderForms ["en"] ["ett"] ; n = Sg ; det = DIndef} ; + only_Predet = {s = \\_ => "bara"} ; + or_Conj = {s1 = [] ; s2 = "eller" ; n = Sg} ; + otherwise_PConj = ss "annars" ; + part_Prep = ss "av" ; + please_Voc = ss "tack" ; --- + possess_Prep = ss "av" ; + quite_Adv = ss "ganska" ; + she_Pron = MorphoSwe.mkNP "hon" "henne" "hennes" "hennes" "hennes" SgUtr P3 ; + so_AdA = ss "så" ; + someSg_Det = {s = \\_ => genderForms "någon" "något" ; n = Sg ; det = DIndef} ; + somePl_Det = {s = \\_,_ => "några" ; n = Pl ; det = DIndef} ; + somebody_NP = regNP "någon" "någons" SgUtr ; + something_NP = regNP "något" "någots" SgNeutr ; + somewhere_Adv = ss "någonstans" ; + that_Quant = + {s = table { + Sg => \\_,_ => genderForms ["den där"] ["det där"] ; + Pl => \\_,_,_ => ["de där"] + } ; + det = DDef Def + } ; + there_Adv = ss "där" ; + there7to_Adv = ss "dit" ; + there7from_Adv = ss "därifrån" ; + therefore_PConj = ss "därför" ; + they_Pron = MorphoSwe.mkNP "de" "dem" "deras" "deras" "deras" Plg P1 ; + this_Quant = + {s = table { + Sg => \\_,_ => genderForms ["den här"] ["det här"] ; + Pl => \\_,_,_ => ["de här"] + } ; + det = DDef Def + } ; + through_Prep = ss "genom" ; + too_AdA = ss "för" ; + to_Prep = ss "till" ; + under_Prep = ss "under" ; + very_AdA = ss "mycket" ; + want_VV = + mkV "vilja" "vill" "vilj" "ville" "velat" "velad" ** + {c2 = mkComplement [] ; lock_VV = <>} ; + we_Pron = MorphoSwe.mkNP "vi" "oss" "vår" "vårt" "våra" Plg P1 ; + whatSg_IP = {s = \\_ => "vad" ; gn = SgUtr} ; ---- infl + whatPl_IP = {s = \\_ => "vad" ; gn = Plg} ; ---- infl + when_IAdv = ss "när" ; + when_Subj = ss "när" ; + where_IAdv = ss "var" ; + which_IQuant = { + s = table { + Sg => genderForms "vilken" "vilket" ; + Pl => \\_ => "vilka" + } ; + det = DIndef + } ; + whoSg_IP = {s = vem.s ; gn = SgUtr} ; + whoPl_IP = {s = \\_ => "vilka" ; gn = Plg} ; + why_IAdv = ss "varför" ; + without_Prep = ss "utan" ; + with_Prep = ss "med" ; + yes_Utt = ss ["ja"] ; + youSg_Pron = MorphoSwe.mkNP "du" "dig" "din" "ditt" "dina" SgUtr P2 ; + youPl_Pron = MorphoSwe.mkNP "ni" "er" "er" "ert" "era" Plg P2 ; + youPol_Pron = MorphoSwe.mkNP "ni" "er" "er" "ert" "era" SgUtr P2 ; --- wrong in refl + +-- Auxiliaries that are used repeatedly. + + oper + vem = MorphoSwe.mkNP "vem" "vem" "vems" "vems" "vems" SgUtr P3 ; + +} + diff --git a/lib/next-resource/swedish/VerbSwe.gf b/lib/next-resource/swedish/VerbSwe.gf new file mode 100644 index 000000000..e918f4809 --- /dev/null +++ b/lib/next-resource/swedish/VerbSwe.gf @@ -0,0 +1,2 @@ +concrete VerbSwe of Verb = CatSwe ** VerbScand with + (ResScand = ResSwe) ;