Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
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
,
which covers irregular verbss.
resource ParadigmsEng = open (Predef=Predef), Prelude, MorphoEng, CatEng in {
To abstract over gender names, we define the following identifiers.
oper Gender : Type ; human : Gender ; nonhuman : Gender ; masculine : 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.
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 ;
A compound noun is an uninflected string attached to an inflected noun, such as baby boom, chief executive officer.
mkN : Str -> N -> N } ;
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 ;
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 } ;
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
Two-place adjectives need a preposition for their second argument.
mkA2 : A -> Prep -> A2 ;
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 ;
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.)
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 ;
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 };
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,_,_
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 V2S, V2V, V2Q
are in v 1.0 treated
just as synonyms of V2
, and the second argument is given
as an adverb. Likewise AS, A2S, AV, A2V
are just A
.
V0
is just V
.
V0, V2S, V2V, V2Q : Type ; AS, A2S, AV, A2V : Type ;