diff --git a/doc/resource.pdf b/doc/resource.pdf index 6c96b8f1a..befd7156f 100644 Binary files a/doc/resource.pdf and b/doc/resource.pdf differ diff --git a/lib/resource-1.0/abstract/Adjective.gf b/lib/resource-1.0/abstract/Adjective.gf index 1659d4caa..f62f9347a 100644 --- a/lib/resource-1.0/abstract/Adjective.gf +++ b/lib/resource-1.0/abstract/Adjective.gf @@ -16,7 +16,7 @@ abstract Adjective = Cat ** { UseA2 : A2 -> A ; -- divisible -- Sentence and question complements defined for all adjectival --- phrases, although the semantics is only clear for some adjective. +-- phrases, although the semantics is only clear for some adjectives. SentAP : AP -> SC -> AP ; -- great that she won, uncertain if she did diff --git a/lib/resource-1.0/abstract/Cat.gf b/lib/resource-1.0/abstract/Cat.gf index 64b13dc97..7e9ff2804 100644 --- a/lib/resource-1.0/abstract/Cat.gf +++ b/lib/resource-1.0/abstract/Cat.gf @@ -7,7 +7,7 @@ -- 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]. +-- 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 @@ -75,7 +75,7 @@ abstract Cat = Common ** { 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. "all the seven" + Det ; -- determiner phrase e.g. "those seven" Predet; -- predeterminer (prefixed Quant) e.g. "all" QuantSg;-- quantifier ('nucleus' of sing. Det) e.g. "every" QuantPl;-- quantifier ('nucleus' of plur. Det) e.g. "many" diff --git a/lib/resource-1.0/abstract/Common.gf b/lib/resource-1.0/abstract/Common.gf index 2209019cf..4ef52ae51 100644 --- a/lib/resource-1.0/abstract/Common.gf +++ b/lib/resource-1.0/abstract/Common.gf @@ -4,12 +4,12 @@ -- ${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 2 x 4 x 4 = 16 sentence forms. +-- 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. +-- Romance languages in [``ExtraRomance`` ../romance/ExtraRomance.gf]. abstract Common = { @@ -17,25 +17,25 @@ abstract Common = { --2 Top-level units --- Constructed in [Text Text.html]: $Text$. +-- Constructed in [``Text`` Text.html]: $Text$. Text ; -- text consisting of several phrases e.g. "He is here. Why?" --- Constructed in [Phrase Phrase.html]: +-- 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 conj. e.g. "therefore" --- Constructed in [Sentence Sentence.html]: +-- 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]. +-- 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" diff --git a/lib/resource-1.0/abstract/Conjunction.gf b/lib/resource-1.0/abstract/Conjunction.gf index 46d9030ba..c08a520ed 100644 --- a/lib/resource-1.0/abstract/Conjunction.gf +++ b/lib/resource-1.0/abstract/Conjunction.gf @@ -7,9 +7,10 @@ -- - distributed conjunction: both X,...,X and X -- -- --- *Note*. This module uses right-recursive lists. If backward --- compatibility with API 0.9 is needed, use --- [SeqConjunction SeqConjunction.html]. +-- $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 ** { @@ -44,3 +45,8 @@ abstract Conjunction = Cat ** { -- 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/resource-1.0/abstract/Grammar.gf b/lib/resource-1.0/abstract/Grammar.gf index dfc6291d5..97e66ffe2 100644 --- a/lib/resource-1.0/abstract/Grammar.gf +++ b/lib/resource-1.0/abstract/Grammar.gf @@ -1,7 +1,7 @@ --1 Grammar: the Main Module of the Resource Grammar --- This grammar a collection of the different grammar modules, --- To test the resource, import [Lang Lang.html], which also contains +-- 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 = diff --git a/lib/resource-1.0/abstract/Lang.gf b/lib/resource-1.0/abstract/Lang.gf index 0f0dc0af6..1c70f80a8 100644 --- a/lib/resource-1.0/abstract/Lang.gf +++ b/lib/resource-1.0/abstract/Lang.gf @@ -2,7 +2,7 @@ -- 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], +-- The grammar without a lexicon is [``Grammar`` Grammar.html], -- which may be more suitable to open in applications. abstract Lang = diff --git a/lib/resource-1.0/abstract/Noun.gf b/lib/resource-1.0/abstract/Noun.gf index cb4bc799a..8e2d1a5a9 100644 --- a/lib/resource-1.0/abstract/Noun.gf +++ b/lib/resource-1.0/abstract/Noun.gf @@ -15,7 +15,7 @@ abstract Noun = Cat ** { UsePN : PN -> NP ; -- John UsePron : Pron -> NP ; -- he --- Pronouns are defined in the module [Structural Structural.html]. +-- Pronouns are defined in the module [``Structural`` Structural.html]. -- A noun phrase already formed can be modified by a $Predet$erminer. @@ -45,7 +45,8 @@ abstract Noun = Cat ** { -- 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. +-- in e.g. Romance languages. They can be found in +-- [``Extra`` ../abstract/Extra.gf]. PossPron : Pron -> Quant ; -- my (house) @@ -111,7 +112,7 @@ abstract Noun = Cat ** { UseN3 : N3 -> CN ; -- flight -- Nouns can be modified by adjectives, relative clauses, and adverbs --- (the last rule will give rise to many 'PP attachement' ambiguities +-- (the last rule will give rise to many 'PP attachment' ambiguities -- when used in connection with verb phrases). AdjCN : AP -> CN -> CN ; -- big house diff --git a/lib/resource-1.0/abstract/Numeral.gf b/lib/resource-1.0/abstract/Numeral.gf index 0ad34d13c..e9c8d0f9b 100644 --- a/lib/resource-1.0/abstract/Numeral.gf +++ b/lib/resource-1.0/abstract/Numeral.gf @@ -6,13 +6,16 @@ -- which defines numerals for 88 languages. -- The resource grammar implementations add to this inflection (if needed) -- and ordinal numbers. - --- *Note*. Number 1 as defined +-- +-- *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 ** { diff --git a/lib/resource-1.0/abstract/Question.gf b/lib/resource-1.0/abstract/Question.gf index 7cc47e607..1898c46f2 100644 --- a/lib/resource-1.0/abstract/Question.gf +++ b/lib/resource-1.0/abstract/Question.gf @@ -24,6 +24,6 @@ abstract Question = Cat ** { -- More $IP$, $IDet$, and $IAdv$ are defined in --- [Structural Structural.html]. +-- [``Structural`` Structural.html]. } diff --git a/lib/resource-1.0/abstract/Relative.gf b/lib/resource-1.0/abstract/Relative.gf index fca58dba7..6a55f67e0 100644 --- a/lib/resource-1.0/abstract/Relative.gf +++ b/lib/resource-1.0/abstract/Relative.gf @@ -9,8 +9,9 @@ abstract Relative = Cat ** { 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]). +-- 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 -> Slash -> RCl ; -- whom John loves diff --git a/lib/resource-1.0/abstract/Sentence.gf b/lib/resource-1.0/abstract/Sentence.gf index 53b845156..6a7f4a807 100644 --- a/lib/resource-1.0/abstract/Sentence.gf +++ b/lib/resource-1.0/abstract/Sentence.gf @@ -6,7 +6,8 @@ abstract Sentence = Cat ** { -- 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) in [Tensed Tensed.html]. +-- Clauses are converted to $S$ (with fixed tense) with the +-- $UseCl$ function below. fun PredVP : NP -> VP -> Cl ; -- John walks @@ -53,7 +54,7 @@ abstract Sentence = Cat ** { -- These are the 2 x 4 x 4 = 16 forms generated by different -- combinations of tense, polarity, and --- anteriority, which are defined in [Tense Tense.html]. +-- anteriority, which are defined in [``Common`` Common.html]. fun UseCl : Tense -> Ant -> Pol -> Cl -> S ; diff --git a/lib/resource-1.0/abstract/Structural.gf b/lib/resource-1.0/abstract/Structural.gf index 32768a4c5..556cabc0a 100644 --- a/lib/resource-1.0/abstract/Structural.gf +++ b/lib/resource-1.0/abstract/Structural.gf @@ -2,8 +2,9 @@ -- -- Here we have some words belonging to closed classes and appearing -- in all languages we have considered. --- Sometimes they are not really meaningful, e.g. $we_Pron$ in Spanish --- should be replaced by masculine and feminine variants. +-- 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 ** { diff --git a/lib/resource-1.0/danish/ParadigmsDan.gf b/lib/resource-1.0/danish/ParadigmsDan.gf index f703813ca..9aa3bb14b 100644 --- a/lib/resource-1.0/danish/ParadigmsDan.gf +++ b/lib/resource-1.0/danish/ParadigmsDan.gf @@ -2,9 +2,9 @@ --1 Danish Lexical Paradigms -- --- Aarne Ranta 2003 +-- Aarne Ranta 2005 - 2006 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -21,8 +21,8 @@ -- regular cases. Then we give a worst-case function $mkC$, which serves as an -- escape to construct the most irregular words of type $C$. -- However, this function should only seldom be needed: we have a --- separate module $IrregularEng$, which covers all irregularly inflected --- words. +-- separate module [``IrregDan`` ../../danish/IrregDan.gf], +-- which haves a list of irregular verbs. resource ParadigmsDan = open @@ -67,12 +67,12 @@ oper -- 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,drenger,drengene : Str) -> N ; + mkN : (dreng,drengen,drenge,drengene : Str) -> N ; -- 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"/"r". +-- plural ending "er" or "r". regN : Str -> N ; @@ -94,24 +94,24 @@ oper --3 Compound nouns -- -- All the functions above work quite as well to form compound nouns, --- such as "fotboll". +-- such as "fodbold". --3 Relational nouns -- --- Relational nouns ("daughter of x") need a preposition. +-- 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". +-- 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 ("the connection from x to y") +-- Three-place relational nouns ("forbindelse fra x til y") -- need two prepositions. mkN3 : N -> Prep -> Prep -> N3 ; @@ -120,7 +120,7 @@ oper --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"). However, $N2$ and +-- 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. @@ -179,7 +179,7 @@ oper mk3ADeg : (galen,galet,galna : Str) -> A ; mk2ADeg : (bred,bredt : Str) -> A ; --- If comparison is formed by "mer, "mest", as in general for +-- If comparison is formed by "mer", "mest", as in general for -- long adjective, the following pattern is used: compoundA : A -> A ; -- -/mer/mest norsk @@ -188,7 +188,8 @@ oper --2 Adverbs -- Adverbs are not inflected. Most lexical ones have position --- after the verb. Some can be preverbal (e.g. "always"). +-- after the verb. Some can be close to the verb like the negation +-- "ikke" (e.g. "altid"). mkAdv : Str -> Adv ; mkAdV : Str -> AdV ; @@ -215,10 +216,10 @@ oper -- 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. - irregV : (drikke, drakk, drukket : Str) -> V ; + irregV : (drikke, drak, drukket : Str) -> V ; ---3 Verbs with "være" as auxiliary +--3 Verbs with 'være' as auxiliary -- -- By default, the auxiliary is "have". This function changes it to "være". @@ -228,15 +229,15 @@ oper --3 Verbs with a particle -- --- The particle, such as in "switch on", is given as a string. +-- The particle, such as in "passe på", is given as a string. partV : V -> Str -> V ; --3 Deponent verbs -- --- Some words are used in passive forms only, e.g. "hoppas", some as --- reflexive e.g. "ångra sig". +-- Some words are used in passive forms only, e.g. "undres", some as +-- reflexive e.g. "forestille sig". depV : V -> V ; reflV : V -> V ; @@ -256,8 +257,8 @@ oper -- 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 + mkV3 : V -> Prep -> Prep -> V3 ; -- snakke, med, om + dirV3 : V -> Prep -> V3 ; -- give,_,til dirdirV3 : V -> V3 ; -- give,_,_ --3 Other complement patterns diff --git a/lib/resource-1.0/english/ParadigmsEng.gf b/lib/resource-1.0/english/ParadigmsEng.gf index 226f6becb..d03c3e2b9 100644 --- a/lib/resource-1.0/english/ParadigmsEng.gf +++ b/lib/resource-1.0/english/ParadigmsEng.gf @@ -4,7 +4,7 @@ -- -- Aarne Ranta 2003--2005 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -21,10 +21,8 @@ -- regular cases. Then we give a worst-case function $mkC$, which serves as an -- escape to construct the most irregular words of type $C$. -- However, this function should only seldom be needed: we have a --- separate module $IrregularEng$, which covers all irregularly inflected --- words. --- --- The following modules are presupposed: +-- separate module [``IrregEng`` ../../english/IrregEng.gf], +-- which covers irregular verbss. resource ParadigmsEng = open (Predef=Predef), @@ -64,7 +62,7 @@ oper --2 Nouns --- Worst case: give all four forms and the semantic gender. +-- Worst case: give all four forms. mkN : (man,men,man's,men's : Str) -> N ; @@ -171,7 +169,7 @@ oper duplADeg : Str -> ADeg ; -- fat, fatter, fattest --- If comparison is formed by "more, "most", as in general for +-- If comparison is formed by "more", "most", as in general for -- long adjective, the following pattern is used: compoundADeg : A -> ADeg ; -- -/more/most ridiculous diff --git a/lib/resource-1.0/finnish/ParadigmsFin.gf b/lib/resource-1.0/finnish/ParadigmsFin.gf index d7c99d2b4..4d6ca939d 100644 --- a/lib/resource-1.0/finnish/ParadigmsFin.gf +++ b/lib/resource-1.0/finnish/ParadigmsFin.gf @@ -20,11 +20,7 @@ -- 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 $IrregularFin$, which covers all irregularly inflected --- words. --- --- The following modules are presupposed: +-- However, this function should only seldom be needed. resource ParadigmsFin = open (Predef=Predef), @@ -33,15 +29,14 @@ resource ParadigmsFin = open CatFin in { --- flags optimize=all ; flags optimize=noexpand ; --2 Parameters -- -- To abstract over gender, number, and (some) case names, -- we define the following identifiers. The application programmer --- should always use these constants instead of their definitions --- in $TypesInf$. +-- should always use these constants instead of the constructors +-- defined in $ResFin$. oper Number : Type ; @@ -72,8 +67,8 @@ oper --2 Nouns --- The worst case gives ten forms and the semantic gender. --- In practice just a couple of forms are needed, to define the different +-- The worst case gives ten forms. +-- In practice just a couple of forms are needed to define the different -- stems, vowel alternation, and vowel harmony. oper @@ -106,7 +101,7 @@ oper -- The rest of the noun paradigms are mostly covered by the three -- heuristics. -- --- Nouns with partitive "a"/"ä" are a large group. +-- Nouns with partitive "a","ä" are a large group. -- To determine for grade and vowel alternation, three forms are usually needed: -- singular nominative and genitive, and plural partitive. -- Examples: "talo", "kukko", "huippu", "koira", "kukka", "syylä", "särki"... @@ -132,11 +127,12 @@ oper nSylki : (sylki : Str) -> N ; -- Foreign words ending in consonants are actually similar to words like --- "malli"/"mallin"/"malleja", with the exception that the "i" is not attached +-- "malli"-"mallin"-"malleja", with the exception that the "i" is not attached -- to the singular nominative. Examples: "linux", "savett", "screen". --- The singular partitive form is used to get the vowel harmony. (N.B. more than --- 1-syllabic words ending in "n" would have variant plural genitive and --- partitive forms, like "sultanien"/"sultaneiden", which are not covered.) +-- The singular partitive form is used to get the vowel harmony. +-- (N.B. more than 1-syllabic words ending in "n" would have variant +-- plural genitive and partitive forms, like +-- "sultanien", "sultaneiden", which are not covered.) nLinux : (linuxia : Str) -> N ; @@ -151,7 +147,7 @@ oper nRae : (rae, rakeena : Str) -> N ; --- The following covers nouns with partitive "ta"/"tä", such as +-- The following covers nouns with partitive "ta","tä", such as -- "susi", "vesi", "pieni". To get all stems and the vowel harmony, it takes -- the singular nominative, genitive, and essive. @@ -281,6 +277,8 @@ oper vOlla : V ; +--3 Two-place verbs +-- -- Two-place verbs need a case, and can have a pre- or postposition. mkV2 : V -> Prep -> V2 ; @@ -291,7 +289,7 @@ oper -- Verbs with a direct (accusative) object -- are special, since their complement case is finally decided in syntax. --- But this is taken care of by $ClauseFin$. +-- But this is taken care of in $VerbFin$. dirV2 : V -> V2 ; @@ -301,9 +299,9 @@ oper -- 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 -> Case -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- acc, allat + mkV3 : V -> Prep -> Prep -> V3 ; -- puhua, allative, elative + dirV3 : V -> Case -> V3 ; -- siirtää, (accusative), illative + dirdirV3 : V -> V3 ; -- antaa, (accusative), (allative) --3 Other complement patterns diff --git a/lib/resource-1.0/french/ParadigmsFre.gf b/lib/resource-1.0/french/ParadigmsFre.gf index 99a64b80c..8f0a05374 100644 --- a/lib/resource-1.0/french/ParadigmsFre.gf +++ b/lib/resource-1.0/french/ParadigmsFre.gf @@ -2,9 +2,9 @@ --1 French Lexical Paradigms -- --- Aarne Ranta 2003 +-- Aarne Ranta 2001 - 2006 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -21,8 +21,8 @@ -- regular cases. Then we give a worst-case function $mkC$, which serves as an -- escape to construct the most irregular words of type $C$. -- However, this function should only seldom be needed: we have a --- separate module $IrregularEng$, which covers all irregularly inflected --- words. +-- separate module [``IrregFre`` ../../french/IrregFre.gf], +-- which covers all irregularly inflected verbs. resource ParadigmsFre = open @@ -116,7 +116,7 @@ oper --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"). However, $N2$ and +-- relational noun (e.g. "la vieille église de"). However, $N2$ and -- $N3$ are purely lexical categories. But you can use the $AdvCN$ -- and $PrepNP$ constructions to build phrases like this. @@ -125,9 +125,9 @@ oper -- -- Proper names need a string and a gender. - mkPN : Str -> Gender -> PN ; -- Jean + mkPN : Str -> Gender -> PN ; -- Jean - regPN : Str -> PN ; -- masculine + regPN : Str -> PN ; -- feminine if "-e", masculine otherwise -- To form a noun phrase that can also be plural, @@ -226,7 +226,7 @@ oper --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$. +-- (transitive verbs). mkV2 : V -> Prep -> V2 ; @@ -315,7 +315,12 @@ oper aN2 n = mkN2 n dative ; mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; - regPN x = mkPN x masculine ; + regPN x = mkPN x g where { + g = case last x of { + "e" => feminine ; + _ => masculine + } + } ; mkPN x g = {s = x ; g = g} ** {lock_PN = <>} ; mkNP x g n = {s = (pn2np (mkPN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; diff --git a/lib/resource-1.0/german/ParadigmsGer.gf b/lib/resource-1.0/german/ParadigmsGer.gf index bb7f3d1df..b053b86f0 100644 --- a/lib/resource-1.0/german/ParadigmsGer.gf +++ b/lib/resource-1.0/german/ParadigmsGer.gf @@ -4,7 +4,7 @@ -- -- Aarne Ranta & Harald Hammarström 2003--2006 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -21,8 +21,8 @@ -- 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 $IrregularGer$, which covers all irregularly inflected --- words. +-- separate module [``IrregGer`` ../../german/IrregGer.gf] +-- which covers irregularly inflected verbs. resource ParadigmsGer = open (Predef=Predef), @@ -65,7 +65,7 @@ oper -- and the gender. mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N ; - -- mann, mann, manne, mannes, männer, männern + -- mann, mann, manne, mannes, männer, männern -- The regular heuristics recognizes some suffixes, from which it -- guesses the gender and the declension: "e, ung, ion" give the @@ -100,7 +100,8 @@ oper -- The regular genitive is "s", omitted after "s". mkPN : (karolus, karoli : Str) -> PN ; -- karolus, karoli - regPN : (Johann : Str) -> PN ; -- Johann, Johanns ; Johannes, Johannes + regPN : (Johann : Str) -> PN ; + -- Johann, Johanns ; Johannes, Johannes --2 Adjectives @@ -202,9 +203,9 @@ oper -- 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 - accdatV3 : V -> V3 ; -- give,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- sprechen, mit, über + dirV3 : V -> Prep -> V3 ; -- senden,(accusative),nach + accdatV3 : V -> V3 ; -- give,accusative,dative --3 Other complement patterns -- diff --git a/lib/resource-1.0/italian/ParadigmsIta.gf b/lib/resource-1.0/italian/ParadigmsIta.gf index 8ba666543..3a98856ca 100644 --- a/lib/resource-1.0/italian/ParadigmsIta.gf +++ b/lib/resource-1.0/italian/ParadigmsIta.gf @@ -4,7 +4,7 @@ -- -- Aarne Ranta 2003 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -20,9 +20,9 @@ -- 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 $IrregularEng$, which covers all irregularly inflected --- words. +-- However, this function should only seldom be needed. For verbs, we have a +-- separate module [``BeschIta`` ../../italian/BeschIta.gf], +-- which covers the "Bescherelle" verb conjugations. resource ParadigmsIta = open @@ -55,8 +55,8 @@ oper -- Prepositions used in many-argument functions are either strings -- (including the 'accusative' empty string) or strings that --- amalgamate with the following word (the 'genitive' "de" and the --- 'dative' "ā"). +-- amalgamate with the following word (the 'genitive' "di" and the +-- 'dative' "a"). Prep : Type ; @@ -70,7 +70,7 @@ oper -- Worst case: give both two forms and the gender. - mkN : (uomi,uomini : Str) -> Gender -> N ; + mkN : (uomo,uomini : Str) -> Gender -> N ; -- The regular function takes the singular form and the gender, -- and computes the plural and the gender by a heuristic. @@ -87,7 +87,7 @@ oper --3 Compound nouns -- -- Some nouns are ones where the first part is inflected as a noun but --- the second part is not inflected. e.g. "numéro de téléphone". +-- the second part is not inflected. e.g. "numero di telefono". -- They could be formed in syntax, but we give a shortcut here since -- they are frequent in lexica. @@ -114,7 +114,7 @@ oper --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"). However, $N2$ and +-- relational noun (e.g. "la vecchia chiesa di"). However, $N2$ and -- $N3$ are purely lexical categories. But you can use the $AdvCN$ -- and $PrepNP$ constructions to build phrases like this. @@ -124,7 +124,7 @@ oper -- Proper names need a string and a gender. mkPN : Str -> Gender -> PN ; - regPN : Str -> PN ; -- masculine + regPN : Str -> PN ; -- feminine if "-a", otherwise masculine -- To form a noun phrase that can also be plural, -- you can use the worst-case function. @@ -145,7 +145,7 @@ oper -- These functions create postfix adjectives. To switch -- them to prefix ones (i.e. ones placed before the noun in --- modification, as in "petite maison"), the following function is +-- modification, as in "vecchia chiesa"), the following function is -- provided. prefA : A -> A ; @@ -169,7 +169,7 @@ oper compADeg : A -> A ; -- The regular pattern is the same as $regA$ for plain adjectives, --- with comparison by "plus". +-- with comparison by "pių". regADeg : Str -> A ; @@ -192,15 +192,15 @@ oper --2 Verbs -- --- Regular verbs are ones with the infinitive "er" or "ir", the --- latter with plural present indicative forms as "finissons". +-- Regular verbs are ones with the infinitive "are" or "ire", the +-- latter with singular present indicative forms as "finisco". -- The regular verb function is the first conjugation recognizes -- these endings, as well as the variations among --- "aimer, céder, placer, peser, jeter, placer, manger, assiéger, payer". +-- "amare, cominciare, mangiare, legare, cercare". regV : Str -> V ; - --- The module $BeschIta$ gives all the patterns of the "Bescherelle" + +-- The module $BeschIta$ gives (almost) all the patterns of the "Bescherelle" -- book. To use them in the category $V$, wrap them with the function verboV : Verbo -> V ; @@ -213,7 +213,7 @@ oper reflV : V -> V ; -- If $BeschIta$ does not give the desired result or feels difficult --- to consult, here is a worst-case function for "-ere" and "-ere" verbs, +-- to consult, here is a worst-case function for "-ire" and "-ere" verbs, -- taking 11 arguments. mkV : @@ -306,7 +306,13 @@ oper mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; mkPN x g = {s = x ; g = g} ** {lock_PN = <>} ; - regPN x = mkPN x masculine ; + regPN x = mkPN x g where { + g = case last x of { + "a" => feminine ; + _ => masculine + } + } ; + mkNP x g n = {s = (pn2np (mkPN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; mkA a b c d e = diff --git a/lib/resource-1.0/norwegian/ParadigmsNor.gf b/lib/resource-1.0/norwegian/ParadigmsNor.gf index 8cc30c9cb..2e1ca5e70 100644 --- a/lib/resource-1.0/norwegian/ParadigmsNor.gf +++ b/lib/resource-1.0/norwegian/ParadigmsNor.gf @@ -4,12 +4,13 @@ -- -- Aarne Ranta 2003 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. --- +-- It covers the "bokmål" variant of Norwegian. +-- -- Closed categories (determiners, pronouns, conjunctions) are --- accessed through the resource syntax API, $Structural.gf$. +-- 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 @@ -21,8 +22,8 @@ -- regular cases. Then we give a worst-case function $mkC$, which serves as an -- escape to construct the most irregular words of type $C$. -- However, this function should only seldom be needed: we have a --- separate module $IrregularEng$, which covers all irregularly inflected --- words. +-- separate module [``IrregNor`` ../../norwegian/IrregNor], +-- which covers irregularly inflected verbs. resource ParadigmsNor = open @@ -96,7 +97,7 @@ oper --3 Relational nouns -- --- Relational nouns ("daughter of x") need a preposition. +-- Relational nouns ("datter til x") need a preposition. mkN2 : N -> Prep -> N2 ; @@ -108,7 +109,8 @@ oper -- 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. +-- Three-place relational nouns ("forbindelse fra x til y") +-- need two prepositions. mkN3 : N -> Prep -> Prep -> N3 ; @@ -116,7 +118,7 @@ oper --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"). However, $N2$ and +-- 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. @@ -172,10 +174,10 @@ oper -- Sometimes just the positive forms are irregular. - mk3ADeg : (galen,galet,galna : Str) -> A ; + mk3ADeg : (galen,galet,galne : Str) -> A ; mk2ADeg : (bred,bredt : Str) -> A ; --- If comparison is formed by "mer, "mest", as in general for +-- If comparison is formed by "mer", "mest", as in general for -- long adjective, the following pattern is used: compoundA : A -> A ; -- -/mer/mest norsk @@ -184,10 +186,10 @@ oper --2 Adverbs -- Adverbs are not inflected. Most lexical ones have position --- after the verb. Some can be preverbal (e.g. "always"). +-- after the verb. Some follow the verb (e.g. "altid"). - mkAdv : Str -> Adv ; - mkAdV : Str -> AdV ; + mkAdv : Str -> Adv ; -- e.g. her + mkAdV : Str -> AdV ; -- e.g. altid -- Adverbs modifying adjectives and sentences can also be formed. @@ -214,7 +216,7 @@ oper irregV : (drikke, drakk, drukket : Str) -> V ; ---3 Verbs with "være" as auxiliary +--3 Verbs with 'være' as auxiliary -- -- By default, the auxiliary is "have". This function changes it to "være". @@ -223,14 +225,14 @@ oper --3 Verbs with a particle. -- --- The particle, such as in "switch on", is given as a string. +-- The particle, such as in "lukke opp", is given as a string. partV : V -> Str -> V ; --3 Deponent verbs. -- --- Some words are used in passive forms only, e.g. "hoppas", some as --- reflexive e.g. "ångra sig". +-- Some words are used in passive forms only, e.g. "trives", some as +-- reflexive e.g. "forestille seg". depV : V -> V ; reflV : V -> V ; @@ -249,9 +251,9 @@ oper -- 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,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- snakke, med, om + dirV3 : V -> Prep -> V3 ; -- gi,_,til + dirdirV3 : V -> V3 ; -- gi,_,_ --3 Other complement patterns -- diff --git a/lib/resource-1.0/spanish/ParadigmsSpa.gf b/lib/resource-1.0/spanish/ParadigmsSpa.gf index 42b2d665e..957867e6a 100644 --- a/lib/resource-1.0/spanish/ParadigmsSpa.gf +++ b/lib/resource-1.0/spanish/ParadigmsSpa.gf @@ -2,9 +2,9 @@ --1 Spanish Lexical Paradigms -- --- Aarne Ranta 2003 +-- Aarne Ranta 2004 - 2006 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -19,7 +19,9 @@ -- 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$. +-- escape to construct the most irregular words of type $C$. For +-- verbs, there is a fairly complete list of irregular verbs in +-- [``IrregSpa`` ../../spanish/IrregSpa.gf]. resource ParadigmsSpa = open @@ -53,7 +55,7 @@ oper -- Prepositions used in many-argument functions are either strings -- (including the 'accusative' empty string) or strings that -- amalgamate with the following word (the 'genitive' "de" and the --- 'dative' "ā"). +-- 'dative' "a"). Prep : Type ; @@ -69,7 +71,7 @@ oper -- Worst case: two forms (singular + plural), -- and the gender. - mkN : (_,_ : Str) -> Gender -> N ; -- uomo, uomini, masculine + mkN : (_,_ : Str) -> Gender -> N ; -- bastķn, bastones, masculine -- The regular function takes the singular form and the gender, -- and computes the plural and the gender by a heuristic. @@ -89,7 +91,7 @@ oper --3 Compound nouns -- -- Some nouns are ones where the first part is inflected as a noun but --- the second part is not inflected. e.g. "numéro de téléphone". +-- the second part is not inflected. e.g. "número de teléfono". -- They could be formed in syntax, but we give a shortcut here since -- they are frequent in lexica. @@ -125,8 +127,8 @@ oper -- -- Proper names need a string and a gender. - mkPN : Str -> Gender -> PN ; -- Jean - regPN : Str -> PN ; -- masculine + mkPN : Str -> Gender -> PN ; -- Juan + regPN : Str -> PN ; -- feminine for "-a", otherwise masculine -- To form a noun phrase that can also be plural, @@ -139,7 +141,7 @@ oper -- Non-comparison one-place adjectives need five forms in the worst -- case (masc and fem singular, masc plural, adverbial). - mkA : (solo,sola,soli,sole, solamente : Str) -> A ; + mkA : (solo,sola,solos,solas, solamiento : Str) -> A ; -- For regular adjectives, all other forms are derived from the -- masculine singular. The types of adjectives that are recognized are @@ -149,7 +151,7 @@ oper -- These functions create postfix adjectives. To switch -- them to prefix ones (i.e. ones placed before the noun in --- modification, as in "petite maison"), the following function is +-- modification, as in "bueno vino"), the following function is -- provided. prefA : A -> A ; @@ -236,9 +238,9 @@ oper -- Three-place (ditransitive) verbs need two prepositions, of which -- the first one or both can be absent. - mkV3 : V -> Prep -> Prep -> V3 ; -- parler, ā, de - dirV3 : V -> Prep -> V3 ; -- donner,_,ā - dirdirV3 : V -> V3 ; -- donner,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- hablar, a, di + dirV3 : V -> Prep -> V3 ; -- dar,(accusative),a + dirdirV3 : V -> V3 ; -- dar,(dative),(accusative) --3 Other complement patterns -- @@ -248,9 +250,9 @@ oper mkV0 : V -> V0 ; mkVS : V -> VS ; mkV2S : V -> Prep -> V2S ; - mkVV : V -> VV ; -- plain infinitive: "je veux parler" - deVV : V -> VV ; -- "j'essaie de parler" - aVV : V -> VV ; -- "j'arrive ā parler" + mkVV : V -> VV ; -- plain infinitive: "quiero hablar" + deVV : V -> VV ; -- "terminar de hablar" + aVV : V -> VV ; -- "aprender a hablar" mkV2V : V -> Prep -> Prep -> V2V ; mkVA : V -> VA ; mkV2A : V -> Prep -> Prep -> V2A ; @@ -303,7 +305,13 @@ oper mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; mkPN x g = {s = x ; g = g} ** {lock_PN = <>} ; - regPN x = mkPN x masculine ; + regPN x = mkPN x g where { + g = case last x of { + "a" => feminine ; + _ => masculine + } + } ; + mkNP x g n = {s = (pn2np (mkPN x g)).s; a = agrP3 g n ; hasClit = False} ** {lock_NP = <>} ; mkA a b c d e = diff --git a/lib/resource-1.0/swedish/ParadigmsSwe.gf b/lib/resource-1.0/swedish/ParadigmsSwe.gf index b57376765..6d692754c 100644 --- a/lib/resource-1.0/swedish/ParadigmsSwe.gf +++ b/lib/resource-1.0/swedish/ParadigmsSwe.gf @@ -2,9 +2,9 @@ --1 Swedish Lexical Paradigms -- --- Aarne Ranta 2003 +-- Aarne Ranta 2001 - 2006 -- --- This is an API to the user of the resource grammar +-- This is an API for the user of the resource grammar -- for adding lexical items. It gives functions for forming -- expressions of open categories: nouns, adjectives, verbs. -- @@ -21,8 +21,9 @@ -- regular cases. Then we give a worst-case function $mkC$, which serves as an -- escape to construct the most irregular words of type $C$. -- However, this function should only seldom be needed: we have a --- separate module $IrregularEng$, which covers all irregularly inflected --- words. +-- separate module [``IrregSwe`` ../../swedish/IrregSwe], +-- which covers many irregular verbs. + resource ParadigmsSwe = open @@ -99,7 +100,7 @@ oper --3 Relational nouns -- --- Relational nouns ("daughter of x") need a preposition. +-- Relational nouns ("dotter till x") need a preposition. mkN2 : N -> Prep -> N2 ; @@ -111,7 +112,8 @@ oper -- Use the function $mkPreposition$ or see the section on prepositions below to -- form other prepositions. -- --- Three-place relational nouns ("the connection from x to y") need two prepositions. +-- Three-place relational nouns ("förbindelse från x till y") +-- need two prepositions. mkN3 : N -> Prep -> Prep -> N3 ; @@ -119,7 +121,7 @@ oper --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"). However, $N2$ and +-- 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. @@ -175,10 +177,11 @@ oper --2 Adverbs -- Adverbs are not inflected. Most lexical ones have position --- after the verb. Some can be preverbal (e.g. "always"). +-- after the verb. Some can be preverbal in subordinate position +-- (e.g. "alltid"). - mkAdv : Str -> Adv ; - mkAdV : Str -> AdV ; + mkAdv : Str -> Adv ; -- här + mkAdV : Str -> AdV ; -- alltid -- Adverbs modifying adjectives and sentences can also be formed. @@ -205,7 +208,7 @@ oper mk2V : (leka,lekte : Str) -> V ; --- There is an extensive list of irregular verbs in the module $IrregularSwe$. +-- There is an extensive list of irregular verbs in the module $IrregSwe$. -- In practice, it is enough to give three forms, as in school books. irregV : (dricka, drack, druckit : Str) -> V ; @@ -239,9 +242,9 @@ oper -- Three-place (ditransitive) verbs need two prepositions, of which -- the first one or both can be absent. - mkV3 : V -> Prep -> Prep -> V3 ; -- tala med om - dirV3 : V -> Prep -> V3 ; -- ge _ till - dirdirV3 : V -> V3 ; -- ge _ _ + mkV3 : V -> Prep -> Prep -> V3 ; -- tala, med, om + dirV3 : V -> Prep -> V3 ; -- ge, (acc),till + dirdirV3 : V -> V3 ; -- ge, (dat), (acc) --3 Other complement patterns --