diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 000000000..02398d68c --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,8 @@ +resource: + gfdoc -txt2 ../lib/resource-1.0/abstract/*.gf + gfdoc -txt2 ../lib/resource-1.0/*/Paradigms*.gf + txt2tags --toc resource.txt +# cat resource-preamble resource.tex >final-resource.tex + sed -i 's/ion\*{/ion{/g' resource.tex + sed -i 's/\\paragraph{}//g' resource.tex + sed -i 's/}\\\\/}/g' resource.tex diff --git a/doc/final-resource.tex b/doc/final-resource.tex deleted file mode 100644 index bf7908195..000000000 --- a/doc/final-resource.tex +++ /dev/null @@ -1,5293 +0,0 @@ -\documentclass[11pt,a4paper]{article} -\usepackage{amsfonts,graphicx} -\usepackage{isolatin1} -\usepackage[pdfstartview=FitH,urlcolor=blue,colorlinks=true,bookmarks=true]{hyperref} -%%\usepackage[utf8x]{inputenc} -\pagestyle{plain} % do page numbering ('empty' turns off) -\frenchspacing % no aditional spaces after periods -\setlength{\parskip}{8pt}\parindent=0pt % no paragraph indentation - -\newcommand{\commOut}[1]{} -\newcommand{\subsubsubsection}[1]{\textbf{#1}.} - -\title{The GF Resource Grammar Library} -\author{Author: Aarne Ranta} -\begin{document} -\date{Last update: Tue Jun 13 11:43:19 2006} -\maketitle - -\tableofcontents - -\clearpage - - -This document is about the -GF Resource Grammar Library. It presuppose knowledge of GF and its -module system, knowledge that can be acquired e.g. from the GF -tutorial. We start with an introduction to the library, and proceed to -details with the aim of covering all that one needs to know -in order to use the library. -How to write one's own resource grammar (i.e. to implement the API for -a new language), is covered by a separate Resource-HOWTO document. - -\subsection*{Motivation} -The GF Resource Grammar Library contains grammar rules for -10 languages (some more are under construction). Its purpose -is to make these rules available for application programmers, -who can thereby concentrate on the semantic and stylistic -aspects of their grammars, without having to think about -grammaticality. The targeted level of application grammarians -is that of a skilled programmer with -a practical knowledge of the target languages, but without -theoretical knowledge about their grammars. -Such a combination of -skills is typical of programmers who want to localize -software to new languages. - -The current resource languages are - -\begin{itemize} -\item \texttt{Dan}ish -\item \texttt{Eng}lish -\item \texttt{Fin}nish -\item \texttt{Fre}nch -\item \texttt{Ger}man -\item \texttt{Ita}lian -\item \texttt{Nor}wegian -\item \texttt{Rus}sian -\item \texttt{Spa}nish -\item \texttt{Swe}dish -\end{itemize} - -The first three letters (\texttt{Dan} etc) are used in grammar module names. - -To give an example application, consider -music playing devices. In the application, -we may have a semantical category \texttt{Kind}, examples -of \texttt{Kind}s being \texttt{Song} and \texttt{Artist}. In German, for instance, \texttt{Song} -is linearized into the noun "Lied", but knowing this is not -enough to make the application work, because the noun must be -produced in both singular and plural, and in four different -cases. By using the resource grammar library, it is enough to -write - -\begin{verbatim} - lin Song = reg2N "Lied" "Lieder" neuter -\end{verbatim} -and the eight forms are correctly generated. The resource grammar -library contains a complete set of inflectional paradigms (such as -\texttt{regN2} here), enabling the definition of any lexical items. - -The resource grammar library is not only about inflectional paradigms - it -also has syntax rules. The music player application -might also want to modify songs with properties, such as "American", -"old", "good". The German grammar for adjectival modifications is -particularly complex, because adjectives have to agree in gender, -number, and case, and also depend on what determiner is used -("ein Amerikanisches Lied" vs. "das Amerikanische Lied"). All this -variation is taken care of by the resource grammar function - -\begin{verbatim} - fun AdjCN : AP -> CN -> CN -\end{verbatim} -The resource grammar implementation of the rule adding properties -to kinds is - -\begin{verbatim} - lin PropKind kind prop = AdjCN prop kind -\end{verbatim} -given that - -\begin{verbatim} - lincat Prop = AP - lincat Kind = CN -\end{verbatim} -The resource library API is devided into language-specific -and language-independet parts. To put it roughly, - -\begin{itemize} -\item the lexicon API is language-specific -\item the syntax API is language-independent -\end{itemize} - -Thus, to render the above example in French instead of German, we need to -pick a different linearization of \texttt{Song}, - -\begin{verbatim} - lin Song = regGenN "chanson" feminine -\end{verbatim} -But to linearize \texttt{PropKind}, we can use the very same rule as in German. -The resource function \texttt{AdjCN} has different implementations in the two -languages (e.g. a different word order in French), -but the application programmer need not care about the difference. - -\subsubsection*{A complete example} -To summarize the example, and also give a template for a programmer to work on, -here is the complete implementation of a small system with songs and properties. -The abstract syntax defines a "domain ontology": - -\begin{verbatim} - abstract Music = { - cat - Kind, - Property ; - fun - PropKind : Kind -> Property -> Kind ; - Song : Kind ; - American : Property ; - } -\end{verbatim} -The concrete syntax is defined by a functor (parametrize module), -independently of language, by opening -two interfaces: the resource \texttt{Grammar} and an application lexicon. - -\begin{verbatim} - incomplete concrete MusicI of Music = open Grammar, MusicLex in { - lincat - Kind = CN ; - Property = AP ; - lin - PropKind k p = AdjCN p k ; - Song = UseN song_N ; - American = PositA american_A ; - } -\end{verbatim} -The application lexicon \texttt{MusicLex} has an abstract syntax that extends -the resource category system \texttt{Cat}. - -\begin{verbatim} - abstract MusicLex = Cat ** { - fun - song_N : N ; - american_A : A ; - } -\end{verbatim} -Each language has its own concrete syntax, which opens the -inflectional paradigms module for that language: - -\begin{verbatim} - concrete MusicLexGer of MusicLex = CatGer ** open ParadigmsGer in { - lin - song_N = reg2N "Lied" "Lieder" neuter ; - american_A = regA "Amerikanisch" ; - } - - concrete MusicLexFre of MusicLex = CatFre ** open ParadigmsFre in { - lin - song_N = regGenN "chanson" feminine ; - american_A = regA "américain" ; - } -\end{verbatim} -The top-level \texttt{Music} grammars are obtained by -instantiating the two interfaces of \texttt{MusicI}: - -\begin{verbatim} - concrete MusicGer of Music = MusicI with - (Grammar = GrammarGer), - (MusicLex = MusicLexGer) ; - - concrete MusicFre of Music = MusicI with - (Grammar = GrammarFre), - (MusicLex = MusicLexFre) ; -\end{verbatim} -Both of these files can use the same \texttt{path}, defined as - -\begin{verbatim} - --# -path=.:present:prelude -\end{verbatim} -The \texttt{present} category contains the compiled resources, restricted to -present tense; \texttt{alltenses} has the full resources. - -To localize the music player system to a new language, -all that is needed is two modules, -one implementing \texttt{MusicLex} and the other -instantiating \texttt{Music}. The latter is -completely trivial, whereas the former one involves the choice of correct -vocabulary and inflectional paradigms. For instance, Finnish is added as follows: - -\begin{verbatim} - concrete MusicLexFin of MusicLex = CatFin ** open ParadigmsFin in { - lin - song_N = regN "kappale" ; - american_A = regA "amerikkalainen" ; - } - - concrete MusicFin of Music = MusicI with - (Grammar = GrammarFin), - (MusicLex = MusicLexFin) ; -\end{verbatim} -More work is of course needed if the language-independent linearizations in -MusicI are not satisfactory for some language. The resource grammar guarantees -that the linearizations are possible in all languages, in the sense of grammatical, -but they might of course be inadequate for stylistic reasons. Assume, -for the sake of argument, that adjectival modification does not sound good in -English, but that a relative clause would be preferrable. One can then start as -before, - -\begin{verbatim} - concrete MusicLexEng of MusicLex = CatEng ** open ParadigmsEng in { - lin - song_N = regN "song" ; - american_A = regA "American" ; - } - - concrete MusicEng0 of Music = MusicI with - (Grammar = GrammarEng), - (MusicLex = MusicLexEng) ; -\end{verbatim} -The module \texttt{MusicEng0} would not be used on the top level, however, but -another module would be built on top of it, with a restricted import from -\texttt{MusicEng0}. \texttt{MusicEng} inherits everything from \texttt{MusicEng0} -except \texttt{PropKind}, and -gives its own definition of this function: - -\begin{verbatim} - concrete MusicEng of Music = MusicEng0 - [PropKind] ** open GrammarEng in { - lin - PropKind k p = - RelCN k (UseRCl TPres ASimul PPos (RelVP IdRP (UseComp (CompAP p)))) ; - } -\end{verbatim} - -\subsubsection*{Parsing with resource grammars?} -The intended use of the resource grammar is as a library for writing -application grammars. It is not designed for parsing e.g. newspaper text. There -are several reasons why this is not practical: - -\begin{itemize} -\item Efficiency: the resource grammar uses complex data structures, in -particular, discontinuous constituents, which make parsing slow and the -parser size huge. -\item Completeness: the resource grammar does not necessarily cover all rules -of the language - only enough many to be able to express everything -in one way or another. -\item Lexicon: the resource grammar has a very small lexicon, only meant for test -purposes. -\item Semantics: the resource grammar has very little semantic control, and may -accept strange input or deliver strange interpretations. -\item Ambiguity: parsing in the resource grammar may return lots of results many -of which are implausible. -\end{itemize} - -All of these problems should be solved in application grammars. -The task of resource grammars is just to take care of low-level linguistic -details such as inflection, agreement, and word order. - -It is for the same reasons that resource grammars are not adequate for translation. -That the syntax API is implemented for different languages of course makes -it possible to translate via it - but there is no guarantee of translation -equivalence. Of course, the use of functor implementations such as \texttt{MusicI} -above only extends to those cases where the syntax API does give translation -equivalence - but this must be seen as a limiting case, and bigger applications -will often use only restricted inheritance of \texttt{MusicI}. - -\subsection*{To find rules in the resource grammar library} -\subsubsection*{Inflection paradigms} -Inflection paradigms are defined separately for each language \textit{L} -in the module \texttt{Paradigms}\textit{L}. To test them, the command -\texttt{cc} (= \texttt{compute\_concrete}) -can be used: - -\begin{verbatim} - > i -retain german/ParadigmsGer.gf - - > cc regN "Schlange" - { - s : Number => Case => Str = table Number { - Sg => table Case { - Nom => "Schlange" ; - Acc => "Schlange" ; - Dat => "Schlange" ; - Gen => "Schlange" - } ; - Pl => table Case { - Nom => "Schlangen" ; - Acc => "Schlangen" ; - Dat => "Schlangen" ; - Gen => "Schlangen" - } - } ; - g : Gender = Fem - } -\end{verbatim} -For the sake of convenience, every language implements these four paradigms: - -\begin{verbatim} - oper - regN : Str -> N ; -- regular nouns - regA : Str -> A : -- regular adjectives - regV : Str -> V ; -- regular verbs - dirV : V -> V2 ; -- direct transitive verbs -\end{verbatim} -It is often possible to initialize a lexicon by just using these functions, -and later revise it by using the more involved paradigms. For instance, in -German we cannot use \texttt{regN "Lied"} for \texttt{Song}, because the result would be a -Masculine noun with the plural form \texttt{"Liede"}. -The individual \texttt{Paradigms} modules -tell what cases are covered by the regular heuristics. - -As a limiting case, one could even initialize the lexicon for a new language -by copying the English (or some other already existing) lexicon. This would -produce language with correct grammar but with content words directly borrowed from -English - maybe not so strange in certain technical domains. - -\subsubsection*{Syntax rules} -Syntax rules should be looked for in the abstract modules defining the -API. There are around 10 such modules, each defining constructors for -a group of one or more related categories. For instance, the module -\texttt{Noun} defines how to construct common nouns, noun phrases, and determiners. -Thus the proper place to find out how nouns are modified with adjectives -is \texttt{Noun}, because the result of the construction is again a common noun. - -Browsing the libraries is helped by the gfdoc-generated HTML pages, -whose LaTeX versions are included in the present document. -However, this is still not easy, and the most efficient way is -probably to use the parser. -Even though parsing is not an intended end-user application -of resource grammars, it is a useful technique for application grammarians -to browse the library. To find out which resource function implements -a particular structure, one can just parse a string that exemplifies this -structure. For instance, to find out how sentences are built using -transitive verbs, write - -\begin{verbatim} - > i english/LangEng.gf - - > p -cat=Cl -fcfg "she loves him" - - PredVP (UsePron she_Pron) (ComplV2 love_V2 (UsePron he_Pron)) -\end{verbatim} -Parsing with the English resource grammar has an acceptable speed, but -with most languages it takes just too much resources even to build the -parser. However, examples parsed in one language can always be linearized into -other languages: - -\begin{verbatim} - > i italian/LangIta.gf - - > l PredVP (UsePron she_Pron) (ComplV2 love_V2 (UsePron he_Pron)) - - lo ama -\end{verbatim} -Therefore, one can use the English parser to write an Italian grammar, and also -to write a language-independent (incomplete) grammar. One can also parse strings -that are bizarre in English but the intended way of expression in another language. -For instance, the phrase for "I am hungry" in Italian is literally "I have hunger". -This can be built by parsing "I have beer" in LanEng and then writing - -\begin{verbatim} - lin IamHungry = - let beer_N = regGenN "fame" feminine - in - PredVP (UsePron i_Pron) (ComplV2 have_V2 - (DetCN (DetSg MassDet NoOrd) (UseN beer_N))) ; -\end{verbatim} -which uses ParadigmsIta.regGenN. - -\subsubsection*{Example-based grammar writing} -The technique of parsing with the resource grammar can be used in GF source files, -endowed with the suffix \texttt{.gfe} ("GF examples"). The suffix tells GF to preprocess -the file by replacing all expressions of the form - -\begin{verbatim} - in Module.Cat "example string" -\end{verbatim} -by the syntax trees obtained by parsing "example string" in \texttt{Cat} in \texttt{Module}. -For instance, - -\begin{verbatim} - lin IamHungry = - let beer_N = regGenN "fame" feminine - in - (in LangEng.Cl "I have beer") ; -\end{verbatim} -will result in the rule displayed in the previous section. The normal binding rules -of functional programming (and GF) guarantee that local bindings of identifiers -take precedence over constants of the same forms. Thus it is also possible to -linearize functions taking arguments in this way: - -\begin{verbatim} - lin - PropKind car_N old_A = in LangEng.CN "old car" ; -\end{verbatim} -However, the technique of example-based grammar writing has some limitations: - -\begin{itemize} -\item Ambiguity. If a string has several parses, the first one is returned, and -it may not be the intended one. The other parses are shown in a comment, from -where they must/can be picked manually. -\item Lexicality. The arguments of a function must be atomic identifiers, and are thus -not available for categories that have no lexical items. -For instance, the \texttt{PropKind} rule above gives the result -\begin{verbatim} - lin - PropKind car_N old_A = AdjCN (UseN car_N) (PositA old_A) ; -\end{verbatim} -However, it is possible to write a special lexicon that gives atomic rules for -all those categories that can be used as arguments, for instance, -\begin{verbatim} - fun - cat_CN : CN ; - old_AP : AP ; -\end{verbatim} -and then use this lexicon instead of the standard one included in \texttt{Lang}. -\end{itemize} - -\subsubsection*{Special-purpose APIs} -To give an analogy with the well-known type setting software, GF can be compared -with TeX and the resource grammar library with LaTeX. -Just like TeX frees the author -from thinking about low-level problems of page layout, so GF frees the grammarian -from writing parsing and generation algorithms. But quite a lot of knowledge of -\textit{how} to write grammars is still needed, and the resource grammar library helps -GF grammarians in a way similar to how the LaTeX macro package helps TeX authors. - -But even LaTeX is often too detailed and low-level, and users are encouraged to -develop their own macro packages. The same applies to GF resource grammars: -the application grammarian might not need all the choises that the resource -provides, but would prefer less writing and higher-level programming. -To this end, application grammarians may want to write their own views on the -resource grammar. An example of this is already provided, in -\texttt{mathematical/Predication}. -Instead of the \texttt{NP-VP} structure, it permits clause construction directly from -verbs and adjectives and their arguments: - -\begin{verbatim} - predV : V -> NP -> Cl ; -- "x converges" - predV2 : V2 -> NP -> NP -> Cl ; -- "x intersects y" - predV3 : V3 -> NP -> NP -> NP -> Cl ; -- "x intersects y at z" - predVColl : V -> NP -> NP -> Cl ; -- "x and y intersect" - predA : A -> NP -> Cl ; -- "x is even" - predA2 : A2 -> NP -> NP -> Cl ; -- "x is divisible by y" -\end{verbatim} -The implementation of this module is the functor \texttt{PredicationI}: - -\begin{verbatim} - predV v x = PredVP x (UseV v) ; - predV2 v x y = PredVP x (ComplV2 v y) ; - predV3 v x y z = PredVP x (ComplV3 v y z) ; - predVColl v x y = PredVP (ConjNP and_Conj (BaseNP x y)) (UseV v) ; - predA a x = PredVP x (UseComp (CompAP (PositA a))) ; - predA2 a x y = PredVP x (UseComp (CompAP (ComplA2 a y))) ; -\end{verbatim} -Of course, \texttt{Predication} can be opened together with \texttt{Grammar}, but using -the resulting grammar for parsing can be frustrating, since having both -ways of building clauses simultaneously available will produce spurious -ambiguities. But using just \texttt{Predication} without \texttt{Verb} -for parsing is a good idea, -since parsing is more efficient without rules producing verb phrases. - -The use of special-purpose APIs is to some extent just an alternative -to grammar writing by parsing, and its importance may decrease as parsing -with resource grammars becomes more practical. - -\subsection*{Overview of syntactic structures} -\subsubsection*{Texts. phrases, and utterances} -The outermost linguistic structure is \texttt{Text}. \texttt{Text}s are composed -from Phrases (\texttt{Phr}) followed by punctuation marks - either of ".", "?" or -"!" (with their proper variants in Spanish and Arabic). Here is an -example of a \texttt{Text} string. - -\begin{verbatim} - John walks. Why? He doesn't want to sleep! -\end{verbatim} -Phrases are mostly built from Utterances (\texttt{Utt}), which in turn are -declarative sentences, questions, or imperatives - but there -are also "one-word utterances" consisting of noun phrases -or other subsentential phrases. Some Phrases are atomic, -for instance "yes" and "no". Here are some examples of Phrases. - -\begin{verbatim} - yes - come on, John - but John walks - give me the stick please - don't you know that he is sleeping - a glass of wine - a glass of wine please -\end{verbatim} -There is no connection between the punctuation marks and the -types of utterances. This reflects the fact that the punctuation -mark in a real text is selected as a function of the speech act -rather than the grammatical form of an utterance. The following -text is thus well-formed. - -\begin{verbatim} - John walks. John walks? John walks! -\end{verbatim} -What is the difference between Phrase and Utterance? Just technical: -a Phrase is an Utterance with an optional leading conjunction ("but") -and an optional tailing vocative ("John", "please"). - -\subsubsection*{Sentences and clauses} -The richest of the categories below Utterance is \texttt{S}, Sentence. A Sentence -is formed from a Clause (\texttt{Cl}), by fixing its Tense, Anteriority, and Polarity. -The difference between Sentence and Clause is thus also rather technical. -For example, each of the following strings has a distinct syntax tree -in the category Sentence: - -\begin{verbatim} - John walks - John doesn't walk - John walked - John didn't walk - John has walked - John hasn't walked - John will walk - John won't walk - ... -\end{verbatim} -whereas in the category Clause all of them are just different forms of -the same tree. - -The following syntax tree of the Text "John walks." gives an overview -of the structural levels. - -\begin{verbatim} -Node Constructor Value type Other constructors ------------------------------------------------------------ - 1. TFullStop Text TQuestMark - 2. (PhrUtt Phr - 3. NoPConj PConj but_PConj - 4. (UttS Utt UttQS - 5. (UseCl S UseQCl - 6. TPres Tense TPast - 7. ASimul Anter AAnter - 8. PPos Pol PNeg - 9. (PredVP Cl -10. (UsePN NP UsePron, DetCN -11. john_PN) PN mary_PN -12. (UseV VP ComplV2, ComplV3 -13. walk_V)))) V sleep_V -14. NoVoc) Voc please_Voc -15. TEmpty Text -\end{verbatim} -Here are some examples of the results of changing constructors. - -\begin{verbatim} - 1. TFullStop -> TQuestMark John walks? - 3. NoPConj -> but_PConj But John walks. - 6. TPres -> TPast John walked. - 7. ASimul -> AAnter John has walked. - 8. PPos -> PNeg John doesn't walk. -11. john_PN -> mary_PN Mary walks. -13. walk_V -> sleep_V John sleeps. -14. NoVoc -> please_Voc John sleeps please. -\end{verbatim} -All constructors cannot of course be changed so freely, because the -resulting tree would not remain well-typed. Here are some changes involving -many constructors: - -\begin{verbatim} - 4- 5. UttS (UseCl ...) -> - UttQS (UseQCl (... QuestCl ...)) Does John walk? -10-11. UsePN john_PN -> - UsePron we_Pron We walk. -12-13. UseV walk_V -> - ComplV2 love_V2 this_NP John loves this. -\end{verbatim} - -\subsubsection*{Parts of sentences} -The linguistic phenomena mostly discussed in both traditional grammars and modern -syntax belong to the level of Clauses, that is, lines 9-13, and occasionally -to Sentences, lines 5-13. At this level, the major categories are -\texttt{NP} (Noun Phrase) and \texttt{VP} (Verb Phrase). A Clause typically -consists of just an \texttt{NP} and a \texttt{VP}. -The internal structure of both \texttt{NP} and \texttt{VP} can be very complex, -and these categories are mutually recursive: not only can a \texttt{VP} -contain an \texttt{NP}, - -\begin{verbatim} - [VP loves [NP Mary]] -\end{verbatim} -but also an \texttt{NP} can contain a \texttt{VP} - -\begin{verbatim} - [NP every man [RS who [VP walks]]] -\end{verbatim} -(a labelled bracketing like this is of course just a rough approximation of -a GF syntax tree, but still a useful device of exposition). - -Most of the resource modules thus define functions that are used inside -NPs and VPs. Here is a brief overview: - -\textbf{Noun}. How to construct NPs. The main three mechanisms -for constructing NPs are - -\begin{itemize} -\item from proper names: "John" -\item from pronouns: "we" -\item from common nouns by determiners: "this man" -\end{itemize} - -The \texttt{Noun} module also defines the construction of common nouns. -The most frequent ways are - -\begin{itemize} -\item lexical noun items: "man" -\item adjectival modification: "old man" -\item relative clause modification: "man who sleeps" -\item application of relational nouns: "successor of the number" -\end{itemize} - -\textbf{Verb}. -How to construct VPs. The main mechanism is verbs with their arguments, -for instance, - -\begin{itemize} -\item one-place verbs: "walks" -\item two-place verbs: "loves Mary" -\item three-place verbs: "gives her a kiss" -\item sentence-complement verbs: "says that it is cold" -\item VP-complement verbs: "wants to give her a kiss" -\end{itemize} - -A special verb is the copula, "be" in English but not even realized -by a verb in all languages. -A copula can take different kinds of complement: - -\begin{itemize} -\item an adjectival phrase: "(John is) old" -\item an adverb: "(John is) here" -\item a noun phrase: "(John is) a man" -\end{itemize} - -\textbf{Adjective}. -How to constuct \texttt{AP}s. The main ways are - -\begin{itemize} -\item positive forms of adjectives: "old" -\item comparative forms with object of comparison: "older than John" -\end{itemize} - -\textbf{Adverb}. -How to construct \texttt{Adv}s. The main ways are - -\begin{itemize} -\item from adjectives: "slowly" -\item as prepositional phrases: "in the car" -\end{itemize} - -\subsubsection*{Modules and their names} -The resource modules are named after the kind of -phrases that are constructed in them, -and they can be roughly classified by the "level" or "size" of expressions that are -formed in them: - -\begin{itemize} -\item Larger than sentence: \texttt{Text}, \texttt{Phrase} -\item Same level as sentence: \texttt{Sentence}, \texttt{Question}, \texttt{Relative} -\item Parts of sentence: \texttt{Adjective}, \texttt{Adverb}, \texttt{Noun}, \texttt{Verb} -\item Cross-cut (coordination): \texttt{Conjunction} -\end{itemize} - -Because of mutual recursion such as in embedded sentences, this classification is -not a complete order. However, no mutual dependence is needed between the -modules in a formal sense - they can all be compiled separately. This is due -to the module \texttt{Cat}, which defines the type system common to the other modules. -For instance, the types \texttt{NP} and \texttt{VP} are defined in \texttt{Cat}, -and the module \texttt{Verb} only -needs to know what is given in \texttt{Cat}, not what is given in \texttt{Noun}. To implement -a rule such as - -\begin{verbatim} - Verb.ComplV2 : V2 -> NP -> VP -\end{verbatim} -it is enough to know the linearization type of \texttt{NP} -(as well as those of \texttt{V2} and \texttt{VP}, all -given in \texttt{Cat}). It is not necessary to know what -ways there are to build \texttt{NP}s (given in \texttt{Noun}), since all these ways must -conform to the linearization type defined in \texttt{Cat}. Thus the format of -category-specific modules is as follows: - -\begin{verbatim} - abstract Adjective = Cat ** {...} - abstract Noun = Cat ** {...} - abstract Verb = Cat ** {...} -\end{verbatim} - -\subsubsection*{Top-level grammar and lexicon} -The module \texttt{Grammar} collects all the category-specific modules into -a complete grammar: - -\begin{verbatim} - abstract Grammar = - Adjective, Noun, Verb, ..., Structural, Idiom -\end{verbatim} -The module \texttt{Structural} is a lexicon of structural words (function words), -such as determiners. - -The module \texttt{Idiom} is a collection of idiomatic structures whose -implementation is very language-dependent. An example is existential -structures ("there is", "es gibt", "il y a", etc). - -The module \texttt{Lang} combines \texttt{Grammar} with a \texttt{Lexicon} of -ca. 350 content words: - -\begin{verbatim} - abstract Lang = Grammar, Lexicon -\end{verbatim} -Using \texttt{Lang} instead of \texttt{Grammar} as a library may give -for free some words needed in an application. But its main purpose is to -help testing the resource library. It does not seem possible to maintain -a general-purpose multilingual lexicon, and this is the form that the module -\texttt{Lexicon} has. - -\subsubsection*{Language-specific syntactic structures} -The API collected in \texttt{Grammar} has been designed to be implementable for -all languages in the resource package. It does contain some rules that -are strange or superfluous in some languages; for instance, the distinction -between definite and indefinite articles does not apply to Finnish and Russian. -But such rules are still easy to implement: they only create some superfluous -ambiguity in the languages in question. - -But the library makes no claim that all languages should have exactly the same -abstract syntax. The common API is therefore extended by language-dependent -rules. The top level of each languages looks as follows (with English as example): - -\begin{verbatim} - abstract English = Grammar, ExtraEngAbs, DictEngAbs -\end{verbatim} -where \texttt{ExtraEngAbs} is a collection of syntactic structures specific to English, -and \texttt{DictEngAbs} is an English dictionary -(at the moment, it consists of \texttt{IrregEngAbs}, -the irregular verbs of English). Each of these language-specific grammars has -the potential to grow into a full-scale grammar of the language. These grammar -can also be used as libraries, but the possibility of using functors is lost. - -To give a better overview of language-specific structures, -modules like \texttt{ExtraEngAbs} -are built from a language-independent module \texttt{ExtraAbs} -by restricted inheritance: - -\begin{verbatim} - abstract ExtraEngAbs = Extra [f,g,...] -\end{verbatim} -Thus any category and function in \texttt{Extra} may be shared by a subset of all -languages. One can see this set-up as a matrix, which tells -what \texttt{Extra} structures -are implemented in what languages. For the common API in \texttt{Grammar}, the matrix -is filled with 1's (everything is implemented in every language). - -Language-specific extensions and the use of restricted -inheritance is a recent addition to the resource grammar library, and -has only been exploited in a very small scale so far. - - -\section{API Documentation} -\subsection{Top-level modules} - -\subsubsection{Grammar} -This grammar a collection of the different grammar modules, -To test the resource, import \htmladdnormallink{Lang}{Lang.html}, which also contains -a lexicon. - -\begin{verbatim} - abstract Grammar = - Noun, - Verb, - Adjective, - Adverb, - Numeral, - Sentence, - Question, - Relative, - Conjunction, - Phrase, - Text, - Structural, - Idiom - ** {} ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Grammar with lexicon} -This grammar is just a collection of the different modules, -and the one that can be imported when one wants to test the -grammar. A module without a lexicon is \htmladdnormallink{Grammar}{Grammar.html}, -which may be more suitable to open in applications. - -\begin{verbatim} - abstract Lang = - Grammar, - Lexicon - ** {} ; -\end{verbatim} - -\subsection{Type system} -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{The category system} -The category system is central to the library in the sense -that the other modules (\texttt{Adjective}, \texttt{Adverb}, \texttt{Noun}, \texttt{Verb} etc) -communicate through it. This means that a e.g. a function using -\texttt{NP}s in \texttt{Verb} need not know how \texttt{NP}s are constructed in \texttt{Noun}: -it is enough that both \texttt{Verb} and \texttt{Noun} use the same type \texttt{NP}, -which is given here in \texttt{Cat}. - -Some categories are inherited from \htmladdnormallink{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 -\texttt{AdA, AdN, AdV, Adv, Ant, CAdv, IAdv, PConj, Phr}, -\texttt{Pol, SC, Tense, Text, Utt, Voc}. - -Moreover, the list categories \texttt{ListAdv, ListAP, ListNP, ListS} -are defined on \texttt{Conjunction} and only used locally there. - -\begin{verbatim} - abstract Cat = Common ** { - - cat -\end{verbatim} - -\subsubsubsection{Sentences and clauses} -Constructed in \htmladdnormallink{Sentence}{Sentence.html}, and also in -\htmladdnormallink{Idiom}{Idiom.html}. - -\begin{verbatim} - 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" - Slash ; -- clause missing NP (S/NP in GPSG) e.g. "she looks at" - Imp ; -- imperative e.g. "look at this" -\end{verbatim} - -\subsubsubsection{Questions and interrogatives} -Constructed in \htmladdnormallink{Question}{Question.html}. - -\begin{verbatim} - 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. "which" -\end{verbatim} - -\subsubsubsection{Relative clauses and pronouns} -Constructed in \htmladdnormallink{Relative}{Relative.html}. - -\begin{verbatim} - RCl ; -- relative clause, with all tenses e.g. "in which she lives" - RP ; -- relative pronoun e.g. "in which" -\end{verbatim} - -\subsubsubsection{Verb phrases} -Constructed in \htmladdnormallink{Verb}{Verb.html}. - -\begin{verbatim} - VP ; -- verb phrase e.g. "is very warm" - Comp ; -- complement of copula, such as AP e.g. "very warm" -\end{verbatim} - -\subsubsubsection{Adjectival phrases} -Constructed in \htmladdnormallink{Adjective}{Adjective.html}. - -\begin{verbatim} - AP ; -- adjectival phrase e.g. "very warm" -\end{verbatim} - -\subsubsubsection{Nouns and noun phrases} -Constructed in \htmladdnormallink{Noun}{Noun.html}. -Many atomic noun phrases e.g. \textit{everybody} -are constructed in \htmladdnormallink{Structural}{Structural.html}. -The determiner structure is - -\begin{verbatim} -Predet (QuantSg | QuantPl Num) Ord -\end{verbatim} -as defined in \htmladdnormallink{Noun}{Noun.html}. - -\begin{verbatim} - 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" - 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" - Quant ; -- quantifier with both sg and pl e.g. "this/these" - Num ; -- cardinal number (used with QuantPl) e.g. "seven" - Ord ; -- ordinal number (used in Det) e.g. "seventh" -\end{verbatim} - -\subsubsubsection{Numerals} -Constructed in \htmladdnormallink{Numeral}{Numeral.html}. - -\begin{verbatim} - Numeral;-- cardinal or ordinal, e.g. "five/fifth" -\end{verbatim} - -\subsubsubsection{Structural words} -Constructed in \htmladdnormallink{Structural}{Structural.html}. - -\begin{verbatim} - Conj ; -- conjunction, e.g. "and" - DConj ; -- distributed conj. e.g. "both - and" - Subj ; -- subjunction, e.g. "if" - Prep ; -- preposition, or just case e.g. "in" -\end{verbatim} - -\subsubsubsection{Words of open classes} -These are constructed in \htmladdnormallink{Lexicon}{Lexicon.html} and in -additional lexicon modules. - -\begin{verbatim} - 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. "ask" - VA ; -- adjective-complement verb e.g. "look" - 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" - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Infrastructure with common implementations.} -This module defines the categories that uniformly have the linearization -\texttt{\{s : Str\}} in all languages. -Moreover, this module defines the abstract parameters of tense, polarity, and -anteriority, which are used in \htmladdnormallink{Phrase}{Phrase.html} to generate different -forms of sentences. Together they give 2 x 4 x 4 = 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 \textit{passé simple} of -Romance languages. - -\begin{verbatim} - abstract Common = { - - cat -\end{verbatim} - -\subsubsubsection{Top-level units} -Constructed in \htmladdnormallink{Text}{Text.html}: \texttt{Text}. - -\begin{verbatim} - Text ; -- text consisting of several phrases e.g. "He is here. Why?" -\end{verbatim} - -Constructed in \htmladdnormallink{Phrase}{Phrase.html}: - -\begin{verbatim} - 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" -\end{verbatim} - -Constructed in \htmladdnormallink{Sentence}{Sentence.html}: - -\begin{verbatim} - SC ; -- embedded sentence or question e.g. "that it rains" -\end{verbatim} - -\subsubsubsection{Adverbs} -Constructed in \htmladdnormallink{Adverb}{Adverb.html}. -Many adverbs are constructed in \htmladdnormallink{Structural}{Structural.html}. - -\begin{verbatim} - 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" -\end{verbatim} - -\subsubsubsection{Tense, polarity, and anteriority} -\begin{verbatim} - Tense ; -- tense: present, past, future, conditional - Pol ; -- polarity: positive, negative - Ant ; -- anteriority: 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 - - } -\end{verbatim} - -\subsection{Phrase category modules} -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Adjectives and adjectival phrases} -\begin{verbatim} - abstract Adjective = Cat ** { - - fun -\end{verbatim} - -The principal ways of forming an adjectival phrase are -positive, comparative, relational, reflexive-relational, and -elliptic-relational. -(The superlative use is covered in \htmladdnormallink{Noun}{Noun.html}.\texttt{SuperlA}.) - -\begin{verbatim} - PositA : A -> AP ; -- warm - ComparA : A -> NP -> AP ; -- warmer than Spain - ComplA2 : A2 -> NP -> AP ; -- divisible by 2 - ReflA2 : A2 -> AP ; -- divisible by itself - UseA2 : A2 -> A ; -- divisible -\end{verbatim} - -Sentence and question complements defined for all adjectival -phrases, although the semantics is only clear for some adjective. - -\begin{verbatim} - SentAP : AP -> SC -> AP ; -- great that she won, uncertain if she did -\end{verbatim} - -An adjectival phrase can be modified by an \textbf{adadjective}, such as \textit{very}. - -\begin{verbatim} - AdAP : AdA -> AP -> AP ; -- very uncertain -\end{verbatim} - -The formation of adverbs from adjective (e.g. \textit{quickly}) is covered -by \htmladdnormallink{Adverb}{Adverb.html}. - -\begin{verbatim} - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Adverbs and adverbial phrases} -\begin{verbatim} - abstract Adverb = Cat ** { - - fun -\end{verbatim} - -The two main ways of forming adverbs are from adjectives and by -prepositions from noun phrases. - -\begin{verbatim} - PositAdvAdj : A -> Adv ; -- quickly - PrepNP : Prep -> NP -> Adv ; -- in the house -\end{verbatim} - -Comparative adverbs have a noun phrase or a sentence as object of -comparison. - -\begin{verbatim} - ComparAdvAdj : CAdv -> A -> NP -> Adv ; -- more quickly than John - ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more quickly than he runs -\end{verbatim} - -Adverbs can be modified by 'adadjectives', just like adjectives. - -\begin{verbatim} - AdAdv : AdA -> Adv -> Adv ; -- very quickly -\end{verbatim} - -Subordinate clauses can function as adverbs. - -\begin{verbatim} - SubjS : Subj -> S -> Adv ; -- when he arrives - AdvSC : SC -> Adv ; -- that he arrives ---- REMOVE? -\end{verbatim} - -Comparison adverbs also work as numeral adverbs. - -\begin{verbatim} - AdnCAdv : CAdv -> AdN ; -- more (than five) - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Coordination} -Coordination is defined for many different categories; here is -a sample. The rules apply to \textbf{lists} of two or more elements, -and define two general patterns: - -\begin{itemize} -\item ordinary conjunction: X,...X and X -\item distributed conjunction: both X,...,X and X -\end{itemize} - -\textbf{Note}. This module uses right-recursive lists. If backward -compatibility with API 0.9 is needed, use -\htmladdnormallink{SeqConjunction}{SeqConjunction.html}. - -\begin{verbatim} - abstract Conjunction = Cat ** { -\end{verbatim} - -\subsubsubsection{Rules} -\begin{verbatim} - fun - ConjS : Conj -> [S] -> S ; -- "John walks and Mary runs" - ConjAP : Conj -> [AP] -> AP ; -- "even and prime" - ConjNP : Conj -> [NP] -> NP ; -- "John or Mary" - ConjAdv : Conj -> [Adv] -> Adv ; -- "quickly or slowly" - - DConjS : DConj -> [S] -> S ; -- "either John walks or Mary runs" - DConjAP : DConj -> [AP] -> AP ; -- "both even and prime" - DConjNP : DConj -> [NP] -> NP ; -- "either John or Mary" - DConjAdv : DConj -> [Adv] -> Adv; -- "both badly and slowly" -\end{verbatim} - -\subsubsubsection{Categories} -These categories are only used in this module. - -\begin{verbatim} - cat - [S]{2} ; - [Adv]{2} ; - [NP]{2} ; - [AP]{2} ; -\end{verbatim} - -\subsubsubsection{List constructors} -The list constructors are derived from the list notation and therefore -not given explicitly. But here are their type signatures: - -\begin{verbatim} - -- BaseC : C -> C -> [C] ; -- for C = S, AP, NP, Adv - -- ConsC : C -> [C] -> [C] ; - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Idiomatic expressions} -\begin{verbatim} - abstract Idiom = Cat ** { -\end{verbatim} - -This module defines constructions that are formed in fixed ways, -often different even in closely related languages. - -\begin{verbatim} - fun - ImpersCl : VP -> Cl ; -- it rains - GenericCl : VP -> Cl ; -- one sleeps - - CleftNP : NP -> RS -> Cl ; -- it is you who did it - CleftAdv : Adv -> S -> Cl ; -- it is yesterday she arrived - - 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 - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{The construction of nouns, noun phrases, and determiners} -\begin{verbatim} - abstract Noun = Cat ** { -\end{verbatim} - -\subsubsubsection{Noun phrases} -The three main types of noun phrases are - -\begin{itemize} -\item common nouns with determiners -\item proper names -\item pronouns -\end{itemize} - -\begin{verbatim} - fun - DetCN : Det -> CN -> NP ; -- the man - UsePN : PN -> NP ; -- John - UsePron : Pron -> NP ; -- he -\end{verbatim} - -Pronouns are defined in the module \htmladdnormallink{Structural}{Structural.html}. -A noun phrase already formed can be modified by a \texttt{Predet}erminer. - -\begin{verbatim} - PredetNP : Predet -> NP -> NP; -- only the man -\end{verbatim} - -A noun phrase can also be postmodified by the past participle of a -verb or by an adverb. - -\begin{verbatim} - PPartNP : NP -> V2 -> NP ; -- the number squared - AdvNP : NP -> Adv -> NP ; -- Paris at midnight -\end{verbatim} - -\subsubsubsection{Determiners} -The determiner has a fine-grained structure, in which a 'nucleus' -quantifier and two optional parts can be discerned. -The cardinal numeral is only available for plural determiners. -(This is modified from CLE by further dividing their \texttt{Num} into -cardinal and ordinal.) - -\begin{verbatim} - DetSg : QuantSg -> Ord -> Det ; -- this best man - DetPl : QuantPl -> Num -> Ord -> Det ; -- these five best men -\end{verbatim} - -Quantifiers that have both forms can be used in both ways. - -\begin{verbatim} - SgQuant : Quant -> QuantSg ; -- this - PlQuant : Quant -> QuantPl ; -- these -\end{verbatim} - -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. - -\begin{verbatim} - PossPron : Pron -> Quant ; -- my (house) -\end{verbatim} - -All parts of the determiner can be empty, except \texttt{Quant}, which is -the \textit{kernel} of a determiner. - -\begin{verbatim} - NoNum : Num ; - NoOrd : Ord ; -\end{verbatim} - -\texttt{Num} consists of either digits or numeral words. - -\begin{verbatim} - NumInt : Int -> Num ; -- 51 - NumNumeral : Numeral -> Num ; -- fifty-one -\end{verbatim} - -The construction of numerals is defined in \htmladdnormallink{Numeral}{Numeral.html}. -\texttt{Num} can be modified by certain adverbs. - -\begin{verbatim} - AdNum : AdN -> Num -> Num ; -- almost 51 -\end{verbatim} - -\texttt{Ord} consists of either digits or numeral words. - -\begin{verbatim} - OrdInt : Int -> Ord ; -- 51st - OrdNumeral : Numeral -> Ord ; -- fifty-first -\end{verbatim} - -Superlative forms of adjectives behave syntactically in the same way as -ordinals. - -\begin{verbatim} - OrdSuperl : A -> Ord ; -- largest -\end{verbatim} - -Definite and indefinite constructions are sometimes realized as -neatly distinct words (Spanish \textit{un, unos ; el, los}) but also without -any particular word (Finnish; Swedish definites). - -\begin{verbatim} - DefArt : Quant ; -- the (house), the (houses) - IndefArt : Quant ; -- a (house), (houses) -\end{verbatim} - -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. - -\begin{verbatim} - MassDet : QuantSg ; -- (beer) -\end{verbatim} - -Other determiners are defined in \htmladdnormallink{Structural}{Structural.html}. - -\subsubsubsection{Common nouns} -Simple nouns can be used as nouns outright. - -\begin{verbatim} - UseN : N -> CN ; -- house -\end{verbatim} - -Relational nouns take one or two arguments. - -\begin{verbatim} - ComplN2 : N2 -> NP -> CN ; -- son of the king - ComplN3 : N3 -> NP -> N2 ; -- flight from Moscow (to Paris) -\end{verbatim} - -Relational nouns can also be used without their arguments. -The semantics is typically derivative of the relational meaning. - -\begin{verbatim} - UseN2 : N2 -> CN ; -- son - UseN3 : N3 -> CN ; -- flight -\end{verbatim} - -Nouns can be modified by adjectives, relative clauses, and adverbs -(the last rule will give rise to many 'PP attachement' ambiguities -when used in connection with verb phrases). - -\begin{verbatim} - AdjCN : AP -> CN -> CN ; -- big house - RelCN : CN -> RS -> CN ; -- house that John owns - AdvCN : CN -> Adv -> CN ; -- house on the hill -\end{verbatim} - -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 \htmladdnormallink{Verb}{Verb.html}. - -\begin{verbatim} - SentCN : CN -> SC -> CN ; -- fact that John smokes, question if he does -\end{verbatim} - -\subsubsubsection{Apposition} -This is certainly overgenerating. - -\begin{verbatim} - ApposCN : CN -> NP -> CN ; -- number x, numbers x and y - - } ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Numerals} -This grammar defines numerals from 1 to 999999. -The implementations are adapted from the -\htmladdnormallink{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. -\textbf{Note}. Number 1 as defined -in the category \texttt{Numeral} here should not be used in the formation of -noun phrases, and should therefore be removed. Instead, one should use -\htmladdnormallink{Structural}{Structural.html}\texttt{.one\_Quant}. This makes the grammar simpler -because we can assume that numbers form plural noun phrases. - -\begin{verbatim} - 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 - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Phrases and utterances} -\begin{verbatim} - abstract Phrase = Cat ** { -\end{verbatim} - -When a phrase is built from an utterance it can be prefixed -with a phrasal conjunction (such as \textit{but}, \textit{therefore}) -and suffixing with a vocative (typically a noun phrase). - -\begin{verbatim} - fun - PhrUtt : PConj -> Utt -> Voc -> Phr ; -- But go home my friend. -\end{verbatim} - -Utterances are formed from sentences, questions, and imperatives. - -\begin{verbatim} - UttS : S -> Utt ; -- John walks - UttQS : QS -> Utt ; -- is it good - UttImpSg : Pol -> Imp -> Utt; -- (don't) help yourself - UttImpPl : Pol -> Imp -> Utt; -- (don't) help yourselves -\end{verbatim} - -There are also 'one-word utterances'. A typical use of them is -as answers to questions. -\textbf{Note}. This list is incomplete. More categories could be covered. -Moreover, in many languages e.g. noun phrases in different cases -can be used. - -\begin{verbatim} - UttIP : IP -> Utt ; -- who - UttIAdv : IAdv -> Utt ; -- why - UttNP : NP -> Utt ; -- this man - UttAdv : Adv -> Utt ; -- here - UttVP : VP -> Utt ; -- to sleep -\end{verbatim} - -The phrasal conjunction is optional. A sentence conjunction -can also used to prefix an utterance. - -\begin{verbatim} - NoPConj : PConj ; - PConjConj : Conj -> PConj ; -- and -\end{verbatim} - -The vocative is optional. Any noun phrase can be made into vocative, -which may be overgenerating (e.g. \textit{I}). - -\begin{verbatim} - NoVoc : Voc ; - VocNP : NP -> Voc ; -- my friend - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Questions and interrogative pronouns} -\begin{verbatim} - abstract Question = Cat ** { -\end{verbatim} - -A question can be formed from a clause ('yes-no question') or -with an interrogative. - -\begin{verbatim} - fun - QuestCl : Cl -> QCl ; -- does John walk - QuestVP : IP -> VP -> QCl ; -- who walks - QuestSlash : IP -> Slash -> QCl ; -- who does John love - QuestIAdv : IAdv -> Cl -> QCl ; -- why does John walk - QuestIComp : IComp -> NP -> QCl ; -- where is John -\end{verbatim} - -Interrogative pronouns can be formed with interrogative -determiners. - -\begin{verbatim} - IDetCN : IDet -> Num -> Ord -> CN -> IP; -- which five best songs - AdvIP : IP -> Adv -> IP ; -- who in Europe - - PrepIP : Prep -> IP -> IAdv ; -- with whom - - CompIAdv : IAdv -> IComp ; -- where -\end{verbatim} - -More \texttt{IP}, \texttt{IDet}, and \texttt{IAdv} are defined in -\htmladdnormallink{Structural}{Structural.html}. - -\begin{verbatim} - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Relative clauses and pronouns} -\begin{verbatim} - abstract Relative = Cat ** { - - fun -\end{verbatim} - -The simplest way to form a relative clause is from a clause by -a pronoun similar to \textit{such that}. - -\begin{verbatim} - RelCl : Cl -> RCl ; -- such that John loves her -\end{verbatim} - -The more proper ways are from a verb phrase (formed in \htmladdnormallink{Verb}{Verb.html}) -or a sentence with a missing noun phrase (formed in \htmladdnormallink{Sentence}{Sentence.html}). - -\begin{verbatim} - RelVP : RP -> VP -> RCl ; -- who loves John - RelSlash : RP -> Slash -> RCl ; -- whom John loves -\end{verbatim} - -Relative pronouns are formed from an 'identity element' by prefixing -or suffixing (depending on language) prepositional phrases. - -\begin{verbatim} - IdRP : RP ; -- which - FunRP : Prep -> NP -> RP -> RP ; -- all the roots of which - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Sentences, clauses, imperatives, and sentential complements} -\begin{verbatim} - abstract Sentence = Cat ** { -\end{verbatim} - -\subsubsubsection{Clauses} -The \texttt{NP VP} predication rule form a clause whose linearization -gives a table of all tense variants, positive and negative. -Clauses are converted to \texttt{S} (with fixed tense) in \htmladdnormallink{Tensed}{Tensed.html}. - -\begin{verbatim} - fun - PredVP : NP -> VP -> Cl ; -- John walks -\end{verbatim} - -Using an embedded sentence as a subject is treated separately. -This can be overgenerating. E.g. \textit{whether you go} as subject -is only meaningful for some verb phrases. - -\begin{verbatim} - PredSCVP : SC -> VP -> Cl ; -- that you go makes me happy -\end{verbatim} - -\subsubsubsection{Clauses missing object noun phrases} -This category is a variant of the 'slash category' \texttt{S/NP} of -GPSG and categorial grammars, which in turn replaces -movement transformations in the formation of questions -and relative clauses. Except \texttt{SlashV2}, the construction -rules can be seen as special cases of function composition, in -the style of CCG. -\textbf{Note} the set is not complete and lacks e.g. verbs with more than 2 places. - -\begin{verbatim} - SlashV2 : NP -> V2 -> Slash ; -- (whom) he sees - SlashVVV2 : NP -> VV -> V2 -> Slash; -- (whom) he wants to see - AdvSlash : Slash -> Adv -> Slash ; -- (whom) he sees tomorrow - SlashPrep : Cl -> Prep -> Slash ; -- (with whom) he walks -\end{verbatim} - -\subsubsubsection{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 \htmladdnormallink{Phrase}{Phrase.html}. - -\begin{verbatim} - ImpVP : VP -> Imp ; -- go -\end{verbatim} - -\subsubsubsection{Embedded sentences} -Sentences, questions, and infinitival phrases can be used as -subjects and (adverbial) complements. - -\begin{verbatim} - EmbedS : S -> SC ; -- that you go - EmbedQS : QS -> SC ; -- whether you go - EmbedVP : VP -> SC ; -- to go -\end{verbatim} - -\subsubsubsection{Sentences} -These are the 2 x 4 x 4 = 16 forms generated by different -combinations of tense, polarity, and -anteriority, which are defined in \htmladdnormallink{Tense}{Tense.html}. - -\begin{verbatim} - fun - UseCl : Tense -> Ant -> Pol -> Cl -> S ; - UseQCl : Tense -> Ant -> Pol -> QCl -> QS ; - UseRCl : Tense -> Ant -> Pol -> RCl -> RS ; - - } -\end{verbatim} - -Examples for English \texttt{S}/\texttt{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 -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Structural Words} - -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. \texttt{we\_Pron} in Spanish -should be replaced by masculine and feminine variants. - -\begin{verbatim} - abstract Structural = Cat ** { - - fun -\end{verbatim} - -This is an alphabetical list of structural words - -\begin{verbatim} - 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 : DConj ; - but_PConj : PConj ; - by8agent_Prep : Prep ; - by8means_Prep : Prep ; - can8know_VV : VV ; - can_VV : VV ; - during_Prep : Prep ; - either7or_DConj : DConj ; - every_Det : Det ; - everybody_NP : NP ; - everything_NP : NP ; - everywhere_Adv : Adv ; - first_Ord : Ord ; - few_Det : Det ; - from_Prep : Prep ; - he_Pron : Pron ; - here_Adv : Adv ; - here7to_Adv : Adv ; - here7from_Adv : Adv ; - how_IAdv : IAdv ; - how8many_IDet : IDet ; - i_Pron : Pron ; - if_Subj : Subj ; - in8front_Prep : Prep ; - in_Prep : Prep ; - it_Pron : Pron ; - less_CAdv : CAdv ; - many_Det : Det ; - more_CAdv : CAdv ; - most_Predet : Predet ; - much_Det : Det ; - must_VV : VV ; - no_Phr : Phr ; - on_Prep : Prep ; - one_Quant : QuantSg ; - only_Predet : Predet ; - or_Conj : Conj ; - otherwise_PConj : PConj ; - part_Prep : Prep ; - please_Voc : Voc ; - possess_Prep : Prep ; - 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 ; - that_NP : NP ; - there_Adv : Adv ; - there7to_Adv : Adv ; - there7from_Adv : Adv ; - therefore_PConj : PConj ; - these_NP : NP ; - they_Pron : Pron ; - this_Quant : Quant ; - this_NP : NP ; - those_NP : NP ; - through_Prep : Prep ; - to_Prep : Prep ; - too_AdA : AdA ; - under_Prep : Prep ; - very_AdA : AdA ; - want_VV : VV ; - we_Pron : Pron ; - whatPl_IP : IP ; - whatSg_IP : IP ; - when_IAdv : IAdv ; - when_Subj : Subj ; - where_IAdv : IAdv ; - whichPl_IDet : IDet ; - whichSg_IDet : IDet ; - whoPl_IP : IP ; - whoSg_IP : IP ; - why_IAdv : IAdv ; - with_Prep : Prep ; - without_Prep : Prep ; - yes_Phr : Phr ; - youSg_Pron : Pron ; - youPl_Pron : Pron ; - youPol_Pron : Pron ; - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{Texts} -\begin{verbatim} - abstract Text = Common ** { - - fun - TEmpty : Text ; - TFullStop : Phr -> Text -> Text ; - TQuestMark : Phr -> Text -> Text ; - TExclMark : Phr -> Text -> Text ; - - } -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - - -\subsubsection{The construction of verb phrases} -\begin{verbatim} - abstract Verb = Cat ** { -\end{verbatim} - -\subsubsubsection{Complementization rules} -Verb phrases are constructed from verbs by providing their -complements. There is one rule for each verb category. - -\begin{verbatim} - fun - UseV : V -> VP ; -- sleep - ComplV2 : V2 -> NP -> VP ; -- use it - ComplV3 : V3 -> NP -> NP -> VP ; -- send a message to her - - ComplVV : VV -> VP -> VP ; -- want to run - ComplVS : VS -> S -> VP ; -- know that she runs - ComplVQ : VQ -> QS -> VP ; -- ask if she runs - - ComplVA : VA -> AP -> VP ; -- look red - ComplV2A : V2A -> NP -> AP -> VP ; -- paint the house red -\end{verbatim} - -\subsubsubsection{Other ways of forming verb phrases} -Verb phrases can also be constructed reflexively and from -copula-preceded complements. - -\begin{verbatim} - ReflV2 : V2 -> VP ; -- use itself - UseComp : Comp -> VP ; -- be warm -\end{verbatim} - -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 (\textit{is used}), but other -auxiliary verbs are possible (Ger. \textit{wird angewendet}, It. -\textit{viene usato}), as well as special verb forms (Fin. \textit{käytetään}, -Swe. \textit{används}). - -\textbf{Note}. the rule can be overgenerating, since the \texttt{V2} need not -take a direct object. - -\begin{verbatim} - PassV2 : V2 -> VP ; -- be used -\end{verbatim} - -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. - -\begin{verbatim} - AdvVP : VP -> Adv -> VP ; -- sleep here - AdVVP : AdV -> VP -> VP ; -- always sleep -\end{verbatim} - -\textbf{Agents of passives} are constructed as adverbs with the -preposition \htmladdnormallink{Structural}{Structural.html}\texttt{.8agent\_Prep}. - -\subsubsubsection{Complements to copula} -Adjectival phrases, noun phrases, and adverbs can be used. - -\begin{verbatim} - CompAP : AP -> Comp ; -- (be) small - CompNP : NP -> Comp ; -- (be) a soldier - CompAdv : Adv -> Comp ; -- (be) here -\end{verbatim} - -\subsubsubsection{Coercions} -Verbs can change subcategorization patterns in systematic ways, -but this is very much language-dependent. The following two -work in all the languages we cover. - -\begin{verbatim} - UseVQ : VQ -> V2 ; -- ask (a question) - UseVS : VS -> V2 ; -- know (a secret) - - } -\end{verbatim} - -\subsection{Inflectional paradigms} -Author: -Last update: Tue Jun 13 11:43:19 2006 - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../scandinavian:../common:../abstract:../../prelude - - -\subsubsection{Danish Lexical Paradigms} -Aarne Ranta 2003 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -\begin{verbatim} - resource ParadigmsDan = - open - (Predef=Predef), - Prelude, - CommonScand, - ResDan, - MorphoDan, - CatDan in { -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - utrum : Gender ; - neutrum : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -To abstract over case names, we define the following. - -\begin{verbatim} - Case : Type ; - - nominative : Case ; - genitive : Case ; -\end{verbatim} - -Prepositions used in many-argument functions are just strings. - -\begin{verbatim} - Preposition : Type = Str ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give all four forms. The gender is computed from the -last letter of the second form (if \textit{n}, then \texttt{utrum}, otherwise \texttt{neutrum}). - -\begin{verbatim} - mkN : (dreng,drengen,drenger,drengene : Str) -> N ; -\end{verbatim} - -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 \texttt{utrum} with the -plural ending \textit{er///}r//. - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -Giving gender manually makes the heuristic more reliable. - -\begin{verbatim} - regGenN : Str -> Gender -> N ; -\end{verbatim} - -This function takes the singular indefinite and definite forms; the -gender is computed from the definite form. - -\begin{verbatim} - mk2N : (bil,bilen : Str) -> N ; -\end{verbatim} - -This function takes the singular indefinite and definite and the plural -indefinite - -\begin{verbatim} - mk3N : (bil,bilen,biler : Str) -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -All the functions above work quite as well to form compound nouns, -such as \textit{fotboll}. - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{daughter of x}) need a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common preposition is \textit{av}, and the following is a -shortcut for regular, \texttt{nonhuman} relational nouns with \textit{av}. - -\begin{verbatim} - regN2 : Str -> Gender -> N2 ; -\end{verbatim} - -Use the function \texttt{mkPreposition} or see the section on prepositions below to -form other prepositions. - -Three-place relational nouns (\textit{the connection from x to y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). However, \texttt{N2} and -\texttt{N3} are purely lexical categories. But you can use the \texttt{AdvCN} -and \texttt{PrepNP} constructions to build phrases like this. - -\subsubsubsection{Proper names and noun phrases} -Proper names, with a regular genitive, are formed as follows - -\begin{verbatim} - regPN : Str -> Gender -> PN ; -- John, John's -\end{verbatim} - -Sometimes you can reuse a common noun as a proper name, e.g. \textit{Bank}. - -\begin{verbatim} - nounPN : N -> PN ; -\end{verbatim} - -To form a noun phrase that can also be plural and have an irregular -genitive, you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Str -> Number -> Gender -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives need three forms: - -\begin{verbatim} - mkA : (galen,galet,galne : Str) -> A ; -\end{verbatim} - -For regular adjectives, the other forms are derived. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -In most cases, two forms are enough. - -\begin{verbatim} - mk2A : (stor,stort : Str) -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -Comparison adjectives may need as many as five forms. - -\begin{verbatim} - mkADeg : (stor,stort,store,storre,storst : Str) -> A ; -\end{verbatim} - -The regular pattern works for many adjectives, e.g. those ending -with \textit{ig}. - -\begin{verbatim} - regADeg : Str -> A ; -\end{verbatim} - -Just the comparison forms can be irregular. - -\begin{verbatim} - irregADeg : (tung,tyngre,tyngst : Str) -> A ; -\end{verbatim} - -Sometimes just the positive forms are irregular. - -\begin{verbatim} - mk3ADeg : (galen,galet,galna : Str) -> A ; - mk2ADeg : (bred,bredt : Str) -> A ; -\end{verbatim} - -If comparison is formed by \textit{mer, //mest}, as in general for// -long adjective, the following pattern is used: - -\begin{verbatim} - compoundA : A -> A ; -- -/mer/mest norsk -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. Some can be preverbal (e.g. \textit{always}). - -\begin{verbatim} - mkAdv : Str -> Adv ; - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Prepositions} -A preposition is just a string. - -\begin{verbatim} - mkPreposition : Str -> Preposition ; -\end{verbatim} - -\subsubsubsection{Verbs} -The worst case needs six forms. - -\begin{verbatim} - mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; -\end{verbatim} - -The 'regular verb' function is the first conjugation. - -\begin{verbatim} - regV : (snakke : Str) -> V ; -\end{verbatim} - -The almost regular verb function needs the infinitive and the preteritum. - -\begin{verbatim} - mk2V : (leve,levde : Str) -> V ; -\end{verbatim} - -There is an extensive list of irregular verbs in the module \texttt{IrregDan}. -In practice, it is enough to give three forms, as in school books. - -\begin{verbatim} - irregV : (drikke, drakk, drukket : Str) -> V ; -\end{verbatim} - -\subsubsubsection{Verbs with //være// as auxiliary} -By default, the auxiliary is \textit{have}. This function changes it to \textit{være}. - -\begin{verbatim} - vaereV : V -> V ; -\end{verbatim} - -\subsubsubsection{Verbs with a particle} -The particle, such as in \textit{switch on}, is given as a string. - -\begin{verbatim} - partV : V -> Str -> V ; -\end{verbatim} - -\subsubsubsection{Deponent verbs} -Some words are used in passive forms only, e.g. \textit{hoppas}, some as -reflexive e.g. \textit{Ã¥ngra sig}. - -\begin{verbatim} - depV : V -> V ; - reflV : V -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about - dirV3 : V -> Str -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- give,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Str -> V2S ; - mkVV : V -> VV ; - mkV2V : V -> Str -> Str -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Str -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Str -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Str -> A2S ; - mkAV : A -> AV ; - mkA2V : A -> Str -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2A, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2A, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../abstract:../../prelude:../common - - -\subsubsection{English Lexical Paradigms} -Aarne Ranta 2003--2005 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -The following modules are presupposed: - -\begin{verbatim} - resource ParadigmsEng = open - (Predef=Predef), - Prelude, - MorphoEng, - CatEng - in { -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - human : Gender ; - nonhuman : Gender ; - masculine : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -To abstract over case names, we define the following. - -\begin{verbatim} - Case : Type ; - - nominative : Case ; - genitive : Case ; -\end{verbatim} - -Prepositions are used in many-argument functions for rection. - -\begin{verbatim} - Preposition : Type ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give all four forms and the semantic gender. - -\begin{verbatim} - mkN : (man,men,man's,men's : Str) -> N ; -\end{verbatim} - -The regular function captures the variants for nouns ending with -\textit{s},\textit{sh},\textit{x},\textit{z} or \textit{y}: \textit{kiss - kisses}, \textit{flash - flashes}; -\textit{fly - flies} (but \textit{toy - toys}), - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -In practice the worst case is just: give singular and plural nominative. - -\begin{verbatim} - mk2N : (man,men : Str) -> N ; -\end{verbatim} - -All nouns created by the previous functions are marked as -\texttt{nonhuman}. If you want a \texttt{human} noun, wrap it with the following -function: - -\begin{verbatim} - genderN : Gender -> N -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -A compound noun ia an uninflected string attached to an inflected noun, -such as \textit{baby boom}, \textit{chief executive officer}. - -\begin{verbatim} - compoundN : Str -> N -> N ; -\end{verbatim} - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{daughter of x}) need a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common preposition is \textit{of}, and the following is a -shortcut for regular relational nouns with \textit{of}. - -\begin{verbatim} - regN2 : Str -> N2 ; -\end{verbatim} - -Use the function \texttt{mkPreposition} or see the section on prepositions below to -form other prepositions. - -Three-place relational nouns (\textit{the connection from x to y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). - -\begin{verbatim} - cnN2 : CN -> Preposition -> N2 ; - cnN3 : CN -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Proper names and noun phrases} -Proper names, with a regular genitive, are formed as follows - -\begin{verbatim} - regPN : Str -> Gender -> PN ; -- John, John's -\end{verbatim} - -Sometimes you can reuse a common noun as a proper name, e.g. \textit{Bank}. - -\begin{verbatim} - nounPN : N -> PN ; -\end{verbatim} - -To form a noun phrase that can also be plural and have an irregular -genitive, you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Str -> Number -> Gender -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives need two forms: one for -the adjectival and one for the adverbial form (\textit{free - freely}) - -\begin{verbatim} - mkA : (free,freely : Str) -> A ; -\end{verbatim} - -For regular adjectives, the adverbial form is derived. This holds -even for cases with the variation \textit{happy - happily}. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -Comparison adjectives may two more forms. - -\begin{verbatim} - ADeg : Type ; - - mkADeg : (good,better,best,well : Str) -> ADeg ; -\end{verbatim} - -The regular pattern recognizes two common variations: -\textit{-e} (\textit{rude} - \textit{ruder} - \textit{rudest}) and -\textit{-y} (\textit{happy - happier - happiest - happily}) - -\begin{verbatim} - regADeg : Str -> ADeg ; -- long, longer, longest -\end{verbatim} - -However, the duplication of the final consonant is nor predicted, -but a separate pattern is used: - -\begin{verbatim} - duplADeg : Str -> ADeg ; -- fat, fatter, fattest -\end{verbatim} - -If comparison is formed by \textit{more, //most}, as in general for// -long adjective, the following pattern is used: - -\begin{verbatim} - compoundADeg : A -> ADeg ; -- -/more/most ridiculous -\end{verbatim} - -From a given \texttt{ADeg}, it is possible to get back to \texttt{A}. - -\begin{verbatim} - adegA : ADeg -> A ; -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. Some can be preverbal (e.g. \textit{always}). - -\begin{verbatim} - mkAdv : Str -> Adv ; - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Prepositions} -A preposition as used for rection in the lexicon, as well as to -build \texttt{PP}s in the resource API, just requires a string. - -\begin{verbatim} - mkPreposition : Str -> Preposition ; - mkPrep : Str -> Prep ; -\end{verbatim} - -(These two functions are synonyms.) - -\subsubsubsection{Verbs} -Except for \textit{be}, the worst case needs five forms: the infinitive and -the third person singular present, the past indicative, and the -past and present participles. - -\begin{verbatim} - mkV : (go, goes, went, gone, going : Str) -> V ; -\end{verbatim} - -The regular verb function recognizes the special cases where the last -character is \textit{y} (\textit{cry - cries} but \textit{buy - buys}) or \textit{s}, \textit{sh}, \textit{x}, \textit{z} -(\textit{fix - fixes}, etc). - -\begin{verbatim} - regV : Str -> V ; -\end{verbatim} - -The following variant duplicates the last letter in the forms like -\textit{rip - ripped - ripping}. - -\begin{verbatim} - regDuplV : Str -> V ; -\end{verbatim} - -There is an extensive list of irregular verbs in the module \texttt{IrregularEng}. -In practice, it is enough to give three forms, -e.g. \textit{drink - drank - drunk}, with a variant indicating consonant -duplication in the present participle. - -\begin{verbatim} - irregV : (drink, drank, drunk : Str) -> V ; - irregDuplV : (get, got, gotten : Str) -> V ; -\end{verbatim} - -\subsubsubsection{Verbs with a particle.} -The particle, such as in \textit{switch on}, is given as a string. - -\begin{verbatim} - partV : V -> Str -> V ; -\end{verbatim} - -\subsubsubsection{Reflexive verbs} -By default, verbs are not reflexive; this function makes them that. - -\begin{verbatim} - reflV : V -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about - dirV3 : V -> Preposition -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- give,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Str -> V2S ; - mkVV : V -> VV ; - mkV2V : V -> Str -> Str -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Str -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Str -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Str -> A2S ; - mkAV : A -> AV ; - mkA2V : A -> Str -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2A, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2A, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../abstract:../common:../../prelude - - -\subsubsection{Finnish Lexical Paradigms} -Aarne Ranta 2003--2005 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{MorphoFin.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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularFin}, which covers all irregularly inflected -words. - -The following modules are presupposed: - -\begin{verbatim} - resource ParadigmsFin = open - (Predef=Predef), - Prelude, - MorphoFin, - CatFin - in { -\end{verbatim} - -flags optimize=all ; - -\begin{verbatim} - flags optimize=noexpand ; -\end{verbatim} - -\subsubsubsection{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 \texttt{TypesInf}. - -\begin{verbatim} - oper - Number : Type ; - - singular : Number ; - plural : Number ; - - Case : Type ; - nominative : Case ; - genitive : Case ; - partitive : Case ; - translative : Case ; - inessive : Case ; - elative : Case ; - illative : Case ; - adessive : Case ; - ablative : Case ; - allative : Case ; -\end{verbatim} - -The following type is used for defining \textbf{rection}, i.e. complements -of many-place verbs and adjective. A complement can be defined by -just a case, or a pre/postposition and a case. - -\begin{verbatim} - prePrep : Case -> Str -> Prep ; -- ilman, partitive - postPrep : Case -> Str -> Prep ; -- takana, genitive - postGenPrep : Str -> Prep ; -- takana - casePrep : Case -> Prep ; -- adessive -\end{verbatim} - -\subsubsubsection{Nouns} -The worst case gives ten forms and the semantic gender. -In practice just a couple of forms are needed, to define the different -stems, vowel alternation, and vowel harmony. - -\begin{verbatim} - oper - mkN : (talo, talon, talona, taloa, taloon, - taloina,taloissa,talojen,taloja,taloihin : Str) -> N ; -\end{verbatim} - -The regular noun heuristic takes just one form (singular -nominative) and analyses it to pick the correct paradigm. -It does automatic grade alternation, and is hence not usable -for words like \textit{auto} (whose genitive would become \textit{audon}). - -\begin{verbatim} - regN : (talo : Str) -> N ; -\end{verbatim} - -If \texttt{regN} does not give the correct result, one can try and give -two or three forms as follows. Examples of the use of these -functions are given in \texttt{BasicFin}. Most notably, \texttt{reg2N} is used -for nouns like \textit{kivi - kiviä}, which would otherwise become like -\textit{rivi - rivejä}. \texttt{regN3} is used e.g. for -\textit{sydän - sydämen - sydämiä}, which would otherwise become -\textit{sydän - sytämen}. - -\begin{verbatim} - reg2N : (savi,savia : Str) -> N ; - reg3N : (vesi,veden,vesiä : Str) -> N ; -\end{verbatim} - -Some nouns have an unexpected singular partitive, e.g. \textit{meri}, \textit{lumi}. - -\begin{verbatim} - sgpartN : (meri : N) -> (merta : Str) -> N ; - nMeri : (meri : Str) -> N ; -\end{verbatim} - -The rest of the noun paradigms are mostly covered by the three -heuristics. - -Nouns with partitive \textit{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: \textit{talo}, \textit{kukko}, \textit{huippu}, \textit{koira}, \textit{kukka}, \textit{syylä}, \textit{särki}... - -\begin{verbatim} - nKukko : (kukko,kukon,kukkoja : Str) -> N ; -\end{verbatim} - -A special case are nouns with no alternations: -the vowel harmony is inferred from the last letter, -which must be one of \textit{o}, \textit{u}, \textit{ö}, \textit{y}. - -\begin{verbatim} - nTalo : (talo : Str) -> N ; -\end{verbatim} - -Another special case are nouns where the last two consonants -undergo regular weak-grade alternation: -\textit{kukko - kukon}, \textit{rutto - ruton}, \textit{hyppy - hypyn}, \textit{sampo - sammon}, -\textit{kunto - kunnon}, \textit{sisältö - sisällön}, . - -\begin{verbatim} - nLukko : (lukko : Str) -> N ; -\end{verbatim} - -\textit{arpi - arven}, \textit{sappi - sapen}, \textit{kampi - kammen};\textit{sylki - syljen} - -\begin{verbatim} - nArpi : (arpi : Str) -> N ; - nSylki : (sylki : Str) -> N ; -\end{verbatim} - -Foreign words ending in consonants are actually similar to words like -\textit{malli///}mallin\textit{/}malleja\textit{, with the exception that the //i} is not attached -to the singular nominative. Examples: \textit{linux}, \textit{savett}, \textit{screen}. -The singular partitive form is used to get the vowel harmony. (N.B. more than -1-syllabic words ending in \textit{n} would have variant plural genitive and -partitive forms, like \textit{sultanien///}sultaneiden//, which are not covered.) - -\begin{verbatim} - nLinux : (linuxia : Str) -> N ; -\end{verbatim} - -Nouns of at least 3 syllables ending with \textit{a} or \textit{ä}, like \textit{peruna}, \textit{tavara}, -\textit{rytinä}. - -\begin{verbatim} - nPeruna : (peruna : Str) -> N ; -\end{verbatim} - -The following paradigm covers both nouns ending in an aspirated \textit{e}, such as -\textit{rae}, \textit{perhe}, \textit{savuke}, and also many ones ending in a consonant -(\textit{rengas}, \textit{kätkyt}). The singular nominative and essive are given. - -\begin{verbatim} - nRae : (rae, rakeena : Str) -> N ; -\end{verbatim} - -The following covers nouns with partitive \textit{ta///}tä//, such as -\textit{susi}, \textit{vesi}, \textit{pieni}. To get all stems and the vowel harmony, it takes -the singular nominative, genitive, and essive. - -\begin{verbatim} - nSusi : (susi,suden,sutta : Str) -> N ; -\end{verbatim} - -Nouns ending with a long vowel, such as \textit{puu}, \textit{pää}, \textit{pii}, \textit{leikkuu}, -are inflected according to the following. - -\begin{verbatim} - nPuu : (puu : Str) -> N ; -\end{verbatim} - -One-syllable diphthong nouns, such as \textit{suo}, \textit{tie}, \textit{työ}, are inflected by -the following. - -\begin{verbatim} - nSuo : (suo : Str) -> N ; -\end{verbatim} - -Many adjectives but also nouns have the nominative ending \textit{nen} which in other -cases becomes \textit{s}: \textit{nainen}, \textit{ihminen}, \textit{keltainen}. -To capture the vowel harmony, we use the partitive form as the argument. - -\begin{verbatim} - nNainen : (naista : Str) -> N ; -\end{verbatim} - -The following covers some nouns ending with a consonant, e.g. -\textit{tilaus}, \textit{kaulin}, \textit{paimen}, \textit{laidun}. - -\begin{verbatim} - nTilaus : (tilaus,tilauksena : Str) -> N ; -\end{verbatim} - -Special case: - -\begin{verbatim} - nKulaus : (kulaus : Str) -> N ; -\end{verbatim} - -The following covers nouns like \textit{nauris} and adjectives like \textit{kallis}, \textit{tyyris}. -The partitive form is taken to get the vowel harmony. - -\begin{verbatim} - nNauris : (naurista : Str) -> N ; -\end{verbatim} - -Separately-written compound nouns, like \textit{sambal oelek}, \textit{Urho Kekkonen}, -have only their last part inflected. - -\begin{verbatim} - compN : Str -> N -> N ; -\end{verbatim} - -Nouns used as functions need a case, of which by far the commonest is -the genitive. - -\begin{verbatim} - mkN2 : N -> Prep -> N2 ; - genN2 : N -> N2 ; - - mkN3 : N -> Prep -> Prep -> N3 ; -\end{verbatim} - -Proper names can be formed by using declensions for nouns. -The plural forms are filtered away by the compiler. - -\begin{verbatim} - mkPN : N -> PN ; - mkNP : N -> Number -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives are just like nouns. - -\begin{verbatim} - mkA : N -> A ; -\end{verbatim} - -Two-place adjectives need a case for the second argument. - -\begin{verbatim} - mkA2 : A -> Prep -> A2 ; -\end{verbatim} - -Comparison adjectives have three forms. The comparative and the superlative -are always inflected in the same way, so the nominative of them is actually -enough (except for the superlative \textit{paras} of \textit{hyvä}). - -\begin{verbatim} - mkADeg : (kiva : N) -> (kivempaa,kivinta : Str) -> A ; -\end{verbatim} - -The regular adjectives are based on \texttt{regN} in the positive. - -\begin{verbatim} - regA : (punainen : Str) -> A ; -\end{verbatim} - -\subsubsubsection{Verbs} -The grammar does not cover the potential mood and some nominal -forms. One way to see the coverage is to linearize a verb to -a table. -The worst case needs twelve forms, as shown in the following. - -\begin{verbatim} - mkV : (tulla,tulee,tulen,tulevat,tulkaa,tullaan, - tuli,tulin,tulisi,tullut,tultu,tullun : Str) -> V ; -\end{verbatim} - -The following heuristics cover more and more verbs. - -\begin{verbatim} - regV : (soutaa : Str) -> V ; - reg2V : (soutaa,souti : Str) -> V ; - reg3V : (soutaa,soudan,souti : Str) -> V ; -\end{verbatim} - -The subject case of verbs is by default nominative. This dunction can change it. - -\begin{verbatim} - subjcaseV : V -> Case -> V ; -\end{verbatim} - -The rest of the paradigms are special cases mostly covered by the heuristics. -A simple special case is the one with just one stem and without grade alternation. - -\begin{verbatim} - vValua : (valua : Str) -> V ; -\end{verbatim} - -With two forms, the following function covers a variety of verbs, such as -\textit{ottaa}, \textit{käyttää}, \textit{löytää}, \textit{huoltaa}, \textit{hiihtää}, \textit{siirtää}. - -\begin{verbatim} - vKattaa : (kattaa, katan : Str) -> V ; -\end{verbatim} - -When grade alternation is not present, just a one-form special case is needed -(\textit{poistaa}, \textit{ryystää}). - -\begin{verbatim} - vOstaa : (ostaa : Str) -> V ; -\end{verbatim} - -The following covers -\textit{juosta}, \textit{piestä}, \textit{nousta}, \textit{rangaista}, \textit{kävellä}, \textit{surra}, \textit{panna}. - -\begin{verbatim} - vNousta : (nousta, nousen : Str) -> V ; -\end{verbatim} - -This is for one-syllable diphthong verbs like \textit{juoda}, \textit{syödä}. - -\begin{verbatim} - vTuoda : (tuoda : Str) -> V ; -\end{verbatim} - -All the patterns above have \texttt{nominative} as subject case. -If another case is wanted, use the following. - -\begin{verbatim} - caseV : Case -> V -> V ; -\end{verbatim} - -The verbs \textit{be} is special. - -\begin{verbatim} - vOlla : V ; -\end{verbatim} - -Two-place verbs need a case, and can have a pre- or postposition. - -\begin{verbatim} - mkV2 : V -> Prep -> V2 ; -\end{verbatim} - -If the complement needs just a case, the following special function can be used. - -\begin{verbatim} - caseV2 : V -> Case -> V2 ; -\end{verbatim} - -Verbs with a direct (accusative) object -are special, since their complement case is finally decided in syntax. -But this is taken care of by \texttt{ClauseFin}. - -\begin{verbatim} - dirV2 : V -> V2 ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about - dirV3 : V -> Case -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- acc, allat -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Prep -> V2S ; - mkVV : V -> VV ; - mkV2V : V -> Prep -> V2V ; - mkVA : V -> Prep -> VA ; - mkV2A : V -> Prep -> Prep -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Prep -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Prep -> A2S ; - mkAV : A -> AV ; - mkA2V : A -> Prep -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -The definitions should not bother the user of the API. So they are -hidden from the document. -Author: -Last update: Tue Jun 13 11:43:19 2006 - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../romance:../common:../abstract:../../prelude - - -\subsubsection{French Lexical Paradigms} -Aarne Ranta 2003 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{MorphoFre.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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -\begin{verbatim} - resource ParadigmsFre = - open - (Predef=Predef), - Prelude, - CommonRomance, - ResFre, - MorphoFre, - CatFre in { - - flags optimize=all ; -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - masculine : Gender ; - feminine : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -Prepositions used in many-argument functions are either strings -(including the 'accusative' empty string) or strings that -amalgamate with the following word (the 'genitive' \textit{de} and the -'dative' \textit{à }). - -\begin{verbatim} - Preposition : Type ; - - accusative : Preposition ; - genitive : Preposition ; - dative : Preposition ; - - mkPreposition : Str -> Preposition ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give both two forms and the gender. - -\begin{verbatim} - mkN : (oeil,yeux : Str) -> Gender -> N ; -\end{verbatim} - -The regular function takes the singular form, -and computes the plural and the gender by a heuristic. The plural -heuristic currently -covers the cases \textit{pas-pas}, \textit{prix-prix}, \textit{nez-nez}, -\textit{bijou-bijoux}, \textit{cheveu-cheveux}, \textit{plateau-plateaux}, \textit{cheval-chevaux}. -The gender heuristic is less reliable: it treats as feminine all -nouns ending with \textit{e} and \textit{ion}, all others as masculine. -If in doubt, use the \texttt{cc} command to test! - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -Adding gender information widens the scope of the foregoing function. - -\begin{verbatim} - regGenN : Str -> Gender -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -Some nouns are ones where the first part is inflected as a noun but -the second part is not inflected. e.g. \textit{numéro de téléphone}. -They could be formed in syntax, but we give a shortcut here since -they are frequent in lexica. - -\begin{verbatim} - compN : N -> Str -> N ; -\end{verbatim} - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{fille de x}) need a case and a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common cases are the genitive \textit{de} and the dative \textit{à }, -with the empty preposition. - -\begin{verbatim} - deN2 : N -> N2 ; - aN2 : N -> N2 ; -\end{verbatim} - -Three-place relational nouns (\textit{la connection de x à y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). However, \texttt{N2} and -\texttt{N3} are purely lexical categories. But you can use the \texttt{AdvCN} -and \texttt{PrepNP} constructions to build phrases like this. - -\subsubsubsection{Proper names and noun phrases} -Proper names need a string and a gender. - -\begin{verbatim} - mkPN : Str -> Gender -> PN ; -- Jean -\end{verbatim} - -To form a noun phrase that can also be plural, -you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Gender -> Number -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives need four forms in the worst -case (masc and fem singular, masc plural, adverbial). - -\begin{verbatim} - mkA : (banal,banale,banaux,banalement : Str) -> A ; -\end{verbatim} - -For regular adjectives, all other forms are derived from the -masculine singular. The heuristic takes into account certain -deviant endings: \textit{banal- -banaux}, \textit{chinois- -chinois}, -\textit{heureux-heureuse-heureux}, \textit{italien-italienne}, \textit{jeune-jeune}, -\textit{amer-amère}, \textit{carré- - -carrément}, \textit{joli- - -joliment}. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -These functions create postfix adjectives. To switch -them to prefix ones (i.e. ones placed before the noun in -modification, as in \textit{petite maison}), the following function is -provided. - -\begin{verbatim} - prefA : A -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -\subsubsubsection{Comparison adjectives} -Comparison adjectives are in the worst case put up from two -adjectives: the positive (\textit{bon}), and the comparative (\textit{meilleure}). - -\begin{verbatim} - mkADeg : A -> A -> A ; -\end{verbatim} - -If comparison is formed by \textit{plus}, as usual in French, -the following pattern is used: - -\begin{verbatim} - compADeg : A -> A ; -\end{verbatim} - -For prefixed adjectives, the following function is -provided. - -\begin{verbatim} - prefA : A -> A ; -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. - -\begin{verbatim} - mkAdv : Str -> Adv ; -\end{verbatim} - -Some appear next to the verb (e.g. \textit{toujours}). - -\begin{verbatim} - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Verbs} -Irregular verbs are given in the module \texttt{VerbsFre}. -If a verb should be missing in that list, the module -\texttt{BeschFre} gives all the patterns of the \textit{Bescherelle} book. - -Regular verbs are ones with the infinitive \textit{er} or \textit{ir}, the -latter with plural present indicative forms as \textit{finissons}. -The regular verb function is the first conjugation recognizes -these endings, as well as the variations among -\textit{aimer, céder, placer, peser, jeter, placer, manger, assiéger, payer}. - -\begin{verbatim} - regV : Str -> V ; -\end{verbatim} - -Sometimes, however, it is not predictable which variant of the \textit{er} -conjugation is to be selected. Then it is better to use the function -that gives the third person singular present indicative and future -((\textit{il}) \textit{jette}, \textit{jettera}) as second argument. - -\begin{verbatim} - reg3V : (jeter,jette,jettera : Str) -> V ; -\end{verbatim} - -The function \texttt{regV} gives all verbs the compound auxiliary \textit{avoir}. -To change it to \textit{être}, use the following function. Reflexive implies \textit{être}. - -\begin{verbatim} - etreV : V -> V ; - reflV : V -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -You can reuse a \texttt{V2} verb in \texttt{V}. - -\begin{verbatim} - v2V : V2 -> V ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à , de - dirV3 : V -> Preposition -> V3 ; -- donner,_,à - dirdirV3 : V -> V3 ; -- donner,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Preposition -> V2S ; - mkVV : V -> VV ; -- plain infinitive: "je veux parler" - deVV : V -> VV ; -- "j'essaie de parler" - aVV : V -> VV ; -- "j'arrive à parler" - mkV2V : V -> Preposition -> Preposition -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Preposition -> Preposition -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Preposition -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Preposition -> A2S ; - mkAV : A -> Preposition -> AV ; - mkA2V : A -> Preposition -> Preposition -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../common:../abstract:../../prelude - - -\subsubsection{German Lexical Paradigms} -Aarne Ranta \& Harald Hammarström 2003--2006 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{MorphoGer.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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularGer}, which covers all irregularly inflected -words. - -\begin{verbatim} - resource ParadigmsGer = open - (Predef=Predef), - Prelude, - MorphoGer, - CatGer - in { -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - masculine : Gender ; - feminine : Gender ; - neuter : Gender ; -\end{verbatim} - -To abstract over case names, we define the following. - -\begin{verbatim} - Case : Type ; - - nominative : Case ; - accusative : Case ; - dative : Case ; - genitive : Case ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give all four singular forms, two plural forms (others + dative), -and the gender. - -\begin{verbatim} - mkN : (x1,_,_,_,_,x6 : Str) -> Gender -> N ; - -- mann, mann, manne, mannes, männer, männern -\end{verbatim} - -The regular heuristics recognizes some suffixes, from which it -guesses the gender and the declension: \textit{e, ung, ion} give the -feminine with plural ending \textit{-n, -en}, and the rest are masculines -with the plural \textit{-e} (without Umlaut). - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -The 'almost regular' case is much like the information given in an ordinary -dictionary. It takes the singular and plural nominative and the -gender, and infers the other forms from these. - -\begin{verbatim} - reg2N : (x1,x2 : Str) -> Gender -> N ; -\end{verbatim} - -Relational nouns need a preposition. The most common is \textit{von} with -the dative. Some prepositions are constructed in \htmladdnormallink{StructuralGer}{StructuralGer.html}. - -\begin{verbatim} - mkN2 : N -> Prep -> N2 ; - vonN2 : N -> N2 ; -\end{verbatim} - -Use the function \texttt{mkPrep} or see the section on prepositions below to -form other prepositions. - -Three-place relational nouns (\textit{die Verbindung von x nach y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Prep -> Prep -> N3 ; -\end{verbatim} - -\subsubsubsection{Proper names and noun phrases} -Proper names, with a regular genitive, are formed as follows -The regular genitive is \textit{s}, omitted after \textit{s}. - -\begin{verbatim} - mkPN : (karolus, karoli : Str) -> PN ; -- karolus, karoli - regPN : (Johann : Str) -> PN ; -- Johann, Johanns ; Johannes, Johannes -\end{verbatim} - -\subsubsubsection{Adjectives} -Adjectives need three forms, one for each degree. - -\begin{verbatim} - mkA : (x1,_,x3 : Str) -> A ; -- gut,besser,beste -\end{verbatim} - -The regular adjective formation works for most cases, and includes -variations such as \textit{teuer - teurer}, \textit{böse - böser}. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -Invariable adjective are a special case. - -\begin{verbatim} - invarA : Str -> A ; -- prima -\end{verbatim} - -Two-place adjectives are formed by adding a preposition to an adjective. - -\begin{verbatim} - mkA2 : A -> Prep -> A2 ; -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are just strings. - -\begin{verbatim} - mkAdv : Str -> Adv ; -\end{verbatim} - -\subsubsubsection{Prepositions} -A preposition is formed from a string and a case. - -\begin{verbatim} - mkPrep : Str -> Case -> Prep ; -\end{verbatim} - -Often just a case with the empty string is enough. - -\begin{verbatim} - accPrep : Prep ; - datPrep : Prep ; - genPrep : Prep ; -\end{verbatim} - -A couple of common prepositions (always with the dative). - -\begin{verbatim} - von_Prep : Prep ; - zu_Prep : Prep ; -\end{verbatim} - -\subsubsubsection{Verbs} -The worst-case constructor needs six forms: - -\begin{itemize} -\item Infinitive, -\item 3p sg pres. indicative, -\item 2p sg imperative, -\item 1/3p sg imperfect indicative, -\item 1/3p sg imperfect subjunctive (because this uncommon form can have umlaut) -\item the perfect participle -\end{itemize} - -\begin{verbatim} - mkV : (x1,_,_,_,_,x6 : Str) -> V ; -- geben, gibt, gib, gab, gäbe, gegeben -\end{verbatim} - -Weak verbs are sometimes called regular verbs. - -\begin{verbatim} - regV : Str -> V ; -- führen -\end{verbatim} - -Irregular verbs use Ablaut and, in the worst cases, also Umlaut. - -\begin{verbatim} - irregV : (x1,_,_,_,x5 : Str) -> V ; -- sehen, sieht, sah, sähe, gesehen -\end{verbatim} - -To remove the past participle prefix \textit{ge}, e.g. for the verbs -prefixed by \textit{be-, ver-}. - -\begin{verbatim} - no_geV : V -> V ; -\end{verbatim} - -To add a movable suffix e.g. \textit{auf(fassen)}. - -\begin{verbatim} - prefixV : Str -> V -> V ; -\end{verbatim} - -To change the auxiliary from \textit{haben} (default) to \textit{sein} and -vice-versa. - -\begin{verbatim} - seinV : V -> V ; - habenV : V -> V ; -\end{verbatim} - -Reflexive verbs can take reflexive pronouns of different cases. - -\begin{verbatim} - reflV : V -> Case -> V ; -\end{verbatim} - -\subsubsubsection{Two-place verbs} -Two-place verbs need a preposition, except the special case with direct object -(accusative, transitive verbs). There is also a case for dative objects. - -\begin{verbatim} - mkV2 : V -> Prep -> V2 ; - - dirV2 : V -> V2 ; - datV2 : V -> V2 ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about - dirV3 : V -> Prep -> V3 ; -- give,_,to - accdatV3 : V -> V3 ; -- give,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Prep -> V2S ; - mkVV : V -> VV ; - mkV2V : V -> 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 ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2A, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2A, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../romance:../common:../abstract:../../prelude - - -\subsubsection{Italian Lexical Paradigms} -Aarne Ranta 2003 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{MorphoIta.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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -\begin{verbatim} - resource ParadigmsIta = - open - (Predef=Predef), - Prelude, - CommonRomance, - ResIta, - MorphoIta, - BeschIta, - CatIta in { - - flags optimize=all ; -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - masculine : Gender ; - feminine : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -Prepositions used in many-argument functions are either strings -(including the 'accusative' empty string) or strings that -amalgamate with the following word (the 'genitive' \textit{de} and the -'dative' \textit{à }). - -\begin{verbatim} - Preposition : Type ; - - accusative : Preposition ; - genitive : Preposition ; - dative : Preposition ; - - mkPreposition : Str -> Preposition ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give both two forms and the gender. - -\begin{verbatim} - mkN : (uomi,uomini : Str) -> Gender -> N ; -\end{verbatim} - -The regular function takes the singular form and the gender, -and computes the plural and the gender by a heuristic. -The heuristic says that the gender is feminine for nouns -ending with \textit{a}, and masculine for all other words. - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -To force a different gender, use one of the following functions. - -\begin{verbatim} - mascN : N -> N ; - femN : N -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -Some nouns are ones where the first part is inflected as a noun but -the second part is not inflected. e.g. \textit{numéro de téléphone}. -They could be formed in syntax, but we give a shortcut here since -they are frequent in lexica. - -\begin{verbatim} - compN : N -> Str -> N ; -\end{verbatim} - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{figlio di x}) need a case and a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common cases are the genitive \textit{di} and the dative \textit{a}, -with the empty preposition. - -\begin{verbatim} - diN2 : N -> N2 ; - aN2 : N -> N2 ; -\end{verbatim} - -Three-place relational nouns (\textit{la connessione di x a y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). However, \texttt{N2} and -\texttt{N3} are purely lexical categories. But you can use the \texttt{AdvCN} -and \texttt{PrepNP} constructions to build phrases like this. - -\subsubsubsection{Proper names and noun phrases} -Proper names need a string and a gender. - -\begin{verbatim} - mkPN : Str -> Gender -> PN ; -- Jean -\end{verbatim} - -To form a noun phrase that can also be plural, -you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Gender -> Number -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives need five forms in the worst -case (masc and fem singular, masc plural, adverbial). - -\begin{verbatim} - mkA : (solo,sola,soli,sole, solamente : Str) -> A ; -\end{verbatim} - -For regular adjectives, all other forms are derived from the -masculine singular. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -These functions create postfix adjectives. To switch -them to prefix ones (i.e. ones placed before the noun in -modification, as in \textit{petite maison}), the following function is -provided. - -\begin{verbatim} - prefA : A -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -\subsubsubsection{Comparison adjectives} -Comparison adjectives are in the worst case put up from two -adjectives: the positive (\textit{buono}), and the comparative (\textit{migliore}). - -\begin{verbatim} - mkADeg : A -> A -> A ; -\end{verbatim} - -If comparison is formed by \textit{più}, as usual in Italian, -the following pattern is used: - -\begin{verbatim} - compADeg : A -> A ; -\end{verbatim} - -The regular pattern is the same as \texttt{regA} for plain adjectives, -with comparison by \textit{plus}. - -\begin{verbatim} - regADeg : Str -> A ; -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. - -\begin{verbatim} - mkAdv : Str -> Adv ; -\end{verbatim} - -Some appear next to the verb (e.g. \textit{sempre}). - -\begin{verbatim} - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Verbs} -Regular verbs are ones with the infinitive \textit{er} or \textit{ir}, the -latter with plural present indicative forms as \textit{finissons}. -The regular verb function is the first conjugation recognizes -these endings, as well as the variations among -\textit{aimer, céder, placer, peser, jeter, placer, manger, assiéger, payer}. - -\begin{verbatim} - regV : Str -> V ; -\end{verbatim} - -The module \texttt{BeschIta} gives all the patterns of the \textit{Bescherelle} -book. To use them in the category \texttt{V}, wrap them with the function - -\begin{verbatim} - verboV : Verbo -> V ; -\end{verbatim} - -The function \texttt{regV} gives all verbs the compound auxiliary \textit{avere}. -To change it to \textit{essere}, use the following function. -Reflexive implies \textit{essere}. - -\begin{verbatim} - essereV : V -> V ; - reflV : V -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -You can reuse a \texttt{V2} verb in \texttt{V}. - -\begin{verbatim} - v2V : V2 -> V ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à , de - dirV3 : V -> Preposition -> V3 ; -- donner,_,à - dirdirV3 : V -> V3 ; -- donner,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Preposition -> V2S ; - mkVV : V -> VV ; -- plain infinitive: "je veux parler" - deVV : V -> VV ; -- "j'essaie de parler" - aVV : V -> VV ; -- "j'arrive à parler" - mkV2V : V -> Preposition -> Preposition -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Preposition -> Preposition -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Preposition -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Preposition -> A2S ; - mkAV : A -> Preposition -> AV ; - mkA2V : A -> Preposition -> Preposition -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -\subsubsubsection{The definitions of the paradigms} -The definitions should not bother the user of the API. So they are -hidden from the document. -Author: -Last update: Tue Jun 13 11:43:19 2006 - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../scandinavian:../common:../abstract:../../prelude - - -\subsubsection{Norwegian Lexical Paradigms} -Aarne Ranta 2003 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -\begin{verbatim} - resource ParadigmsNor = - open - (Predef=Predef), - Prelude, - CommonScand, - ResNor, - MorphoNor, - CatNor in { -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - masculine : Gender ; - feminine : Gender ; - neutrum : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -To abstract over case names, we define the following. - -\begin{verbatim} - Case : Type ; - - nominative : Case ; - genitive : Case ; -\end{verbatim} - -Prepositions used in many-argument functions are just strings. - -\begin{verbatim} - Preposition : Type = Str ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give all four forms. The gender is computed from the -last letter of the second form (if \textit{n}, then \texttt{utrum}, otherwise \texttt{neutrum}). - -\begin{verbatim} - mkN : (dreng,drengen,drenger,drengene : Str) -> N ; -\end{verbatim} - -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 \textit{e} are feminine like \textit{kvinne}, -all others are masculine like \textit{bil}. -If in doubt, use the \texttt{cc} command to test! - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -Giving gender manually makes the heuristic more reliable. - -\begin{verbatim} - regGenN : Str -> Gender -> N ; -\end{verbatim} - -This function takes the singular indefinite and definite forms; the -gender is computed from the definite form. - -\begin{verbatim} - mk2N : (bil,bilen : Str) -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -All the functions above work quite as well to form compound nouns, -such as \textit{fotboll}. - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{daughter of x}) need a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common preposition is \textit{av}, and the following is a -shortcut for regular, \texttt{nonhuman} relational nouns with \textit{av}. - -\begin{verbatim} - regN2 : Str -> Gender -> N2 ; -\end{verbatim} - -Use the function \texttt{mkPreposition} or see the section on prepositions below to -form other prepositions. - -Three-place relational nouns (\textit{the connection from x to y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). However, \texttt{N2} and -\texttt{N3} are purely lexical categories. But you can use the \texttt{AdvCN} -and \texttt{PrepNP} constructions to build phrases like this. - -\subsubsubsection{Proper names and noun phrases} -Proper names, with a regular genitive, are formed as follows - -\begin{verbatim} - regPN : Str -> Gender -> PN ; -- John, John's -\end{verbatim} - -Sometimes you can reuse a common noun as a proper name, e.g. \textit{Bank}. - -\begin{verbatim} - nounPN : N -> PN ; -\end{verbatim} - -To form a noun phrase that can also be plural and have an irregular -genitive, you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Str -> Number -> Gender -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives need three forms: - -\begin{verbatim} - mkA : (galen,galet,galne : Str) -> A ; -\end{verbatim} - -For regular adjectives, the other forms are derived. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -In most cases, two forms are enough. - -\begin{verbatim} - mk2A : (stor,stort : Str) -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -Comparison adjectives may need as many as five forms. - -\begin{verbatim} - mkADeg : (stor,stort,store,storre,storst : Str) -> A ; -\end{verbatim} - -The regular pattern works for many adjectives, e.g. those ending -with \textit{ig}. - -\begin{verbatim} - regADeg : Str -> A ; -\end{verbatim} - -Just the comparison forms can be irregular. - -\begin{verbatim} - irregADeg : (tung,tyngre,tyngst : Str) -> A ; -\end{verbatim} - -Sometimes just the positive forms are irregular. - -\begin{verbatim} - mk3ADeg : (galen,galet,galna : Str) -> A ; - mk2ADeg : (bred,bredt : Str) -> A ; -\end{verbatim} - -If comparison is formed by \textit{mer, //mest}, as in general for// -long adjective, the following pattern is used: - -\begin{verbatim} - compoundA : A -> A ; -- -/mer/mest norsk -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. Some can be preverbal (e.g. \textit{always}). - -\begin{verbatim} - mkAdv : Str -> Adv ; - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Prepositions} -A preposition is just a string. - -\begin{verbatim} - mkPreposition : Str -> Preposition ; -\end{verbatim} - -\subsubsubsection{Verbs} -The worst case needs six forms. - -\begin{verbatim} - mkV : (spise,spiser,spises,spiste,spist,spis : Str) -> V ; -\end{verbatim} - -The 'regular verb' function is the first conjugation. - -\begin{verbatim} - regV : (snakke : Str) -> V ; -\end{verbatim} - -The almost regular verb function needs the infinitive and the preteritum. - -\begin{verbatim} - mk2V : (leve,levde : Str) -> V ; -\end{verbatim} - -There is an extensive list of irregular verbs in the module \texttt{IrregNor}. -In practice, it is enough to give three forms, as in school books. - -\begin{verbatim} - irregV : (drikke, drakk, drukket : Str) -> V ; -\end{verbatim} - -\subsubsubsection{Verbs with //være// as auxiliary} -By default, the auxiliary is \textit{have}. This function changes it to \textit{være}. - -\begin{verbatim} - vaereV : V -> V ; -\end{verbatim} - -\subsubsubsection{Verbs with a particle.} -The particle, such as in \textit{switch on}, is given as a string. - -\begin{verbatim} - partV : V -> Str -> V ; -\end{verbatim} - -\subsubsubsection{Deponent verbs.} -Some words are used in passive forms only, e.g. \textit{hoppas}, some as -reflexive e.g. \textit{Ã¥ngra sig}. - -\begin{verbatim} - depV : V -> V ; - reflV : V -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about - dirV3 : V -> Str -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- give,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Str -> V2S ; - mkVV : V -> VV ; - mkV2V : V -> Str -> Str -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Str -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Str -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Str -> A2S ; - mkAV : A -> AV ; - mkA2V : A -> Str -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2A, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2A, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../abstract:../../prelude:../common - - -\subsubsection{Russian Lexical Paradigms} -Janna Khegai 2003--2005 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -The following modules are presupposed: - -\begin{verbatim} - resource ParadigmsRus = open - (Predef=Predef), - Prelude, - MorphoRus, - CatRus, - NounRus - in { - - flags coding=utf8 ; -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - masculine : Gender ; - feminine : Gender ; - neuter : Gender ; -\end{verbatim} - -To abstract over case names, we define the following. - -\begin{verbatim} - Case : Type ; - - nominative : Case ; - genitive : Case ; - dative : Case ; - accusative : Case ; - instructive : Case ; - prepositional : Case ; -\end{verbatim} - -In some (written in English) textbooks accusative case -is put on the second place. However, we follow the case order -standard for Russian textbooks. -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -\subsubsubsection{Nouns} -Best case: indeclinabe nouns: \textit{úþфõ}, \textit{ÿðûьтþ}, \textit{Ã’ã×}. - -\begin{verbatim} - Animacy: Type ; - - animate: Animacy; - inanimate: Animacy; - - mkIndeclinableNoun: Str -> Gender -> Animacy -> N ; -\end{verbatim} - -Worst case - give six singular forms: -Nominative, Genetive, Dative, Accusative, Instructive and Prepositional; -corresponding six plural forms and the gender. -May be the number of forms needed can be reduced, -but this requires a separate investigation. -Animacy parameter (determining whether the Accusative form is equal -to the Nominative or the Genetive one) is actually of no help, -since there are a lot of exceptions and the gain is just one form less. - -\begin{verbatim} - mkN : (_,_,_,_,_,_,_,_,_,_,_,_ : Str) -> Gender -> Animacy -> N ; - - -- üуöчøýð, üуöчøýы, üуöчøýõ, üуöчøýу, üуöчøýþù, üуöчøýõ - -- üуöчøýы, üуöчøý, üуöчøýðü, üуöчøý, üуöчøýðüø, üуöчøýðх -\end{verbatim} - -The regular function captures the variants for some popular nouns -endings below: - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -Here are some common patterns. The list is far from complete. -Feminine patterns. - -\begin{verbatim} - nMashina : Str -> N ; -- feminine, inanimate, ending with "-ð", Inst -"üðшøý-þù" - nEdinica : Str -> N ; -- feminine, inanimate, ending with "-ð", Inst -"õôøýøц-õù" - nZhenchina : Str -> N ; -- feminine, animate, ending with "-a" - nNoga : Str -> N ; -- feminine, inanimate, ending with "ó_ú_х-a" - nMalyariya : Str -> N ; -- feminine, inanimate, ending with "-øÑÂ" - nTetya : Str -> N ; -- feminine, animate, ending with "-ÑÂ" - nBol : Str -> N ; -- feminine, inanimate, ending with "-ь"(soft sign) -\end{verbatim} - -Neuter patterns. - -\begin{verbatim} - nObezbolivauchee : Str -> N ; -- neutral, inanimate, ending with "-ee" - nProizvedenie : Str -> N ; -- neutral, inanimate, ending with "-e" - nChislo : Str -> N ; -- neutral, inanimate, ending with "-o" - nZhivotnoe : Str -> N ; -- masculine, inanimate, ending with "-õýь" -\end{verbatim} - -Masculine patterns. -Ending with consonant: - -\begin{verbatim} - nPepel : Str -> N ; -- masculine, inanimate, ending with "-õû"- "ÿõÿ-ûð" - - nBrat: Str -> N ; -- animate, ñрðт-ьѠ- nStul: Str -> N ; -- same as above, but inanimate - nMalush : Str -> N ; -- üðûышõù - nPotolok : Str -> N ; -- ÿþтþû-þú - ÿþтþû-úð - - -- the next four differ in plural nominative and/or accusative form(s) : - nBank: Str -> N ; -- ñðýú-ø (Nom=Acc) - nStomatolog : Str -> N ; -- same as above, but animate - nAdres : Str -> N ; -- ðôрõÑÂ-ð (Nom=Acc) - nTelefon : Str -> N ; -- тõûõфþý-ы (Nom=Acc) - - nNol : Str -> N ; -- masculine, inanimate, ending with "-ь" (soft sign) - nUroven : Str -> N ; -- masculine, inanimate, ending with "-õýь" -\end{verbatim} - -Nouns used as functions need a preposition. The most common is with Genitive. - -\begin{verbatim} - mkFun : N -> Prep -> N2 ; - mkN2 : N -> N2 ; - mkN3 : N -> Prep -> Prep -> N3 ; -\end{verbatim} - -Proper names. - -\begin{verbatim} - mkPN : Str -> Gender -> Animacy -> PN ; -- "Øòðý", "Üðшð" - nounPN : N -> PN ; -\end{verbatim} - -On the top level, it is maybe \texttt{CN} that is used rather than \texttt{N}, and -\texttt{NP} rather than \texttt{PN}. - -\begin{verbatim} - mkCN : N -> CN ; - mkNP : Str -> Gender -> Animacy -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison (only positive degree) one-place adjectives need 28 (4 by 7) -forms in the worst case: -Masculine $|$ Feminine $|$ Neutral $|$ Plural -Nominative -Genitive -Dative -Accusative Inanimate -Accusative Animate -Instructive -Prepositional -Notice that 4 short forms, which exist for some adjectives are not included -in the current description, otherwise there would be 32 forms for -positive degree. -mkA : ( : Str) -$>$ A ; -The regular function captures the variants for some popular adjective -endings below: - -\begin{verbatim} - regA : Str -> Str -> A ; -\end{verbatim} - -Invariable adjective is a special case. - -\begin{verbatim} - adjInvar : Str -> A ; -- khaki, mini, hindi, netto -\end{verbatim} - -Some regular patterns depending on the ending. - -\begin{verbatim} - AStaruyj : Str -> Str -> A ; -- ending with "-ыù" - AMalenkij : Str -> Str -> A ; -- ending with "-øù", Gen - "üðûõýьú-þóþ" - AKhoroshij : Str -> Str -> A ; -- ending with "-øù", Gen - "хþрþш-õóþ" - AMolodoj : Str -> Str -> A ; -- ending with "-þù", - -- plural - üþûþô-ыõ" - AKakoj_Nibud : Str -> Str -> Str -> A ; -- ending with "-þù", - -- plural - "úðú-øõ" -\end{verbatim} - -Two-place adjectives need a preposition and a case as extra arguments. - -\begin{verbatim} - mkA2 : A -> Str -> Case -> A2 ; -- "ôõûøü ýð" -\end{verbatim} - -Comparison adjectives need a positive adjective -(28 forms without short forms). -Taking only one comparative form (non-syntaxic) and -only one superlative form (syntaxic) we can produce the -comparison adjective with only one extra argument - -non-syntaxic comparative form. -Syntaxic forms are based on the positive forms. -mkADeg : A -$>$ Str -$>$ ADeg ; -On top level, there are adjectival phrases. The most common case is -just to use a one-place adjective. -ap : A -$>$ IsPostfixAdj -$>$ AP ; - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. Some can be preverbal (e.g. \textit{always}). - -\begin{verbatim} - mkAdv : Str -> Adv ; -\end{verbatim} - -\subsubsubsection{Verbs} -In our lexicon description (\textit{Verbum}) there are 62 forms: -2 (Voice) by \{ 1 (infinitive) + [2(number) by 3 (person)](imperative) + -[ [2(Number) by 3(Person)](present) + [2(Number) by 3(Person)](future) + -4(GenNum)(past) ](indicative)+ 4 (GenNum) (subjunctive) \} -Participles (Present and Past) and Gerund forms are not included, -since they fuction more like Adjectives and Adverbs correspondingly -rather than verbs. Aspect regarded as an inherent parameter of a verb. -Notice, that some forms are never used for some verbs. Actually, -the majority of verbs do not have many of the forms. - -\begin{verbatim} - Voice: Type; - Aspect: Type; -\end{verbatim} - -Tense : Type; - -\begin{verbatim} - Bool: Type; - Conjugation: Type ; - - first: Conjugation; -- "óуÃȄÂ-Õшь, óуÃȄÂ-Õü" - firstE: Conjugation; -- Verbs with vowel "ё": "ôðёшь" (give), "ÿьёшь" (drink) - second: Conjugation; -- "òøô-Øшь, òøô-Øü" - mixed: Conjugation; -- "хþч-Õшь - хþт-Øü" - dolzhen: Conjugation; -- irregular - - true: Bool; - false: Bool; - - active: Voice ; - passive: Voice ; - imperfective: Aspect; - perfective: Aspect ; -\end{verbatim} - -present : Tense ; -past : Tense ; -The worst case need 6 forms of the present tense in indicative mood -(\textit{Ѡñõóу}, \textit{ты ñõöøшь}, \textit{þý ñõöøт}, \textit{üы ñõöøü}, \textit{òы ñõöøтõ}, \textit{þýø ñõóут}), -a past form (singular, masculine: \textit{Ѡñõöðû}), an imperative form -(singular, second person: \textit{ñõóø}), an infinitive (\textit{ñõöðть}). -Inherent aspect should also be specified. - -\begin{verbatim} - mkVerbum : Aspect -> (_,_,_,_,_,_,_,_,_ : Str) -> V ; -\end{verbatim} - -Common conjugation patterns are two conjugations: -first - verbs ending with \textit{-ðть/-ÑÂть} and second - \textit{-øть/-õть}. -Instead of 6 present forms of the worst case, we only need -a present stem and one ending (singular, first person): -\textit{Ѡûюñ-ûю}, \textit{Ѡöô-у}, etc. To determine where the border -between stem and ending lies it is sufficient to compare -first person from with second person form: -\textit{Ѡûюñ-ûю}, \textit{ты ûюñ-øшь}. Stems shoud be the same. -So the definition for verb \textit{ûюñøть} looks like: -regV Imperfective Second \textit{ûюñ} \textit{ûю} \textit{ûюñøû} \textit{ûюñø} \textit{ûюñøть}; - -\begin{verbatim} - regV :Aspect -> Conjugation -> (_,_,_,_,_ : Str) -> V ; -\end{verbatim} - -For writing an application grammar one usualy doesn't need -the whole inflection table, since each verb is used in -a particular context that determines some of the parameters -(Tense and Voice while Aspect is fixed from the beginning) for certain usage. -The \textit{V} type, that have these parameters fixed. -We can extract the \textit{V} from the lexicon. -mkV: Verbum -$>$ Voice -$>$ V ; -mkPresentV: Verbum -$>$ Voice -$>$ V ; -Two-place verbs, and the special case with direct object. Notice that -a particle can be included in a \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Str -> Case -> V2 ; -- "òþùтø ò ôþü"; "ò", accusative - mkV3 : V -> Str -> Str -> Case -> Case -> V3 ; -- "ÑÂûþöøть ÿøÑÂьüþ ò úþýòõрт" - dirV2 : V -> V2 ; -- "òøôõть", "ûюñøть" - tvDirDir : V -> V3 ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../romance:../common:../abstract:../../prelude - - -\subsubsection{Spanish Lexical Paradigms} -Aarne Ranta 2003 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{MorphoSpa.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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. - -\begin{verbatim} - resource ParadigmsSpa = - open - (Predef=Predef), - Prelude, - CommonRomance, - ResSpa, - MorphoSpa, - BeschSpa, - CatSpa in { - - flags optimize=all ; -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - masculine : Gender ; - feminine : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -Prepositions used in many-argument functions are either strings -(including the 'accusative' empty string) or strings that -amalgamate with the following word (the 'genitive' \textit{de} and the -'dative' \textit{à }). - -\begin{verbatim} - Preposition : Type ; - - accusative : Preposition ; - genitive : Preposition ; - dative : Preposition ; - - mkPreposition : Str -> Preposition ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: two forms (singular + plural), -and the gender. - -\begin{verbatim} - mkN : (_,_ : Str) -> Gender -> N ; -- uomo, uomini, masculine -\end{verbatim} - -The regular function takes the singular form and the gender, -and computes the plural and the gender by a heuristic. -The heuristic says that the gender is feminine for nouns -ending with \textit{a} or \textit{z}, and masculine for all other words. -Nouns ending with \textit{a}, \textit{o}, \textit{e} have the plural with \textit{s}, -those ending with \textit{z} have \textit{ces} in plural; all other nouns -have \textit{es} as plural ending. The accent is not dealt with. - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -To force a different gender, use one of the following functions. - -\begin{verbatim} - mascN : N -> N ; - femN : N -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -Some nouns are ones where the first part is inflected as a noun but -the second part is not inflected. e.g. \textit{numéro de téléphone}. -They could be formed in syntax, but we give a shortcut here since -they are frequent in lexica. - -\begin{verbatim} - compN : N -> Str -> N ; -\end{verbatim} - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{fille de x}) need a case and a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common cases are the genitive \textit{de} and the dative \textit{a}, -with the empty preposition. - -\begin{verbatim} - deN2 : N -> N2 ; - aN2 : N -> N2 ; -\end{verbatim} - -Three-place relational nouns (\textit{la connessione di x a y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). However, \texttt{N2} and -\texttt{N3} are purely lexical categories. But you can use the \texttt{AdvCN} -and \texttt{PrepNP} constructions to build phrases like this. - -\subsubsubsection{Proper names and noun phrases} -Proper names need a string and a gender. - -\begin{verbatim} - mkPN : Str -> Gender -> PN ; -- Jean -\end{verbatim} - -To form a noun phrase that can also be plural, -you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Gender -> Number -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Non-comparison one-place adjectives need five forms in the worst -case (masc and fem singular, masc plural, adverbial). - -\begin{verbatim} - mkA : (solo,sola,soli,sole, solamente : Str) -> A ; -\end{verbatim} - -For regular adjectives, all other forms are derived from the -masculine singular. The types of adjectives that are recognized are -\textit{alto}, \textit{fuerte}, \textit{util}. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -These functions create postfix adjectives. To switch -them to prefix ones (i.e. ones placed before the noun in -modification, as in \textit{petite maison}), the following function is -provided. - -\begin{verbatim} - prefA : A -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -\subsubsubsection{Comparison adjectives} -Comparison adjectives are in the worst case put up from two -adjectives: the positive (\textit{bueno}), and the comparative (\textit{mejor}). - -\begin{verbatim} - mkADeg : A -> A -> A ; -\end{verbatim} - -If comparison is formed by \textit{mas}, as usual in Spanish, -the following pattern is used: - -\begin{verbatim} - compADeg : A -> A ; -\end{verbatim} - -The regular pattern is the same as \texttt{regA} for plain adjectives, -with comparison by \textit{mas}. - -\begin{verbatim} - regADeg : Str -> A ; -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. - -\begin{verbatim} - mkAdv : Str -> Adv ; -\end{verbatim} - -Some appear next to the verb (e.g. \textit{siempre}). - -\begin{verbatim} - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Verbs} -Regular verbs are ones inflected like \textit{cortar}, \textit{deber}, or \textit{vivir}. -The regular verb function is the first conjugation (\textit{ar}) recognizes -the variations corresponding to the patterns -\textit{actuar, cazar, guiar, pagar, sacar}. The module \texttt{BeschSpa} gives -the complete set of \textit{Bescherelle} conjugations. - -\begin{verbatim} - regV : Str -> V ; -\end{verbatim} - -The module \texttt{BeschSpa} gives all the patterns of the \textit{Bescherelle} -book. To use them in the category \texttt{V}, wrap them with the function - -\begin{verbatim} - verboV : Verbum -> V ; -\end{verbatim} - -To form reflexive verbs: - -\begin{verbatim} - reflV : V -> V ; -\end{verbatim} - -Verbs with a deviant passive participle: just give the participle -in masculine singular form as second argument. - -\begin{verbatim} - special_ppV : V -> Str -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -You can reuse a \texttt{V2} verb in \texttt{V}. - -\begin{verbatim} - v2V : V2 -> V ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à , de - dirV3 : V -> Preposition -> V3 ; -- donner,_,à - dirdirV3 : V -> V3 ; -- donner,_,_ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Preposition -> V2S ; - mkVV : V -> VV ; -- plain infinitive: "je veux parler" - deVV : V -> VV ; -- "j'essaie de parler" - aVV : V -> VV ; -- "j'arrive à parler" - mkV2V : V -> Preposition -> Preposition -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Preposition -> Preposition -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Preposition -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Preposition -> A2S ; - mkAV : A -> Preposition -> AV ; - mkA2V : A -> Preposition -> Preposition -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -\commOut{Produced by -gfdoc - a rudimentary GF document generator. -(c) Aarne Ranta (\htmladdnormallink{aarne@cs.chalmers.se}{mailto:aarne@cs.chalmers.se}) 2002 under GNU GPL.} - -== - -\# -path=.:../scandinavian:../common:../abstract:../../prelude - - -\subsubsection{Swedish Lexical Paradigms} -Aarne Ranta 2003 - -This is an API to 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, \texttt{Structural.gf}. - -The main difference with \texttt{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 \texttt{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 \texttt{mkC}, which serves as an -escape to construct the most irregular words of type \texttt{C}. -However, this function should only seldom be needed: we have a -separate module \texttt{IrregularEng}, which covers all irregularly inflected -words. - -\begin{verbatim} - resource ParadigmsSwe = - open - (Predef=Predef), - Prelude, - CommonScand, - ResSwe, - MorphoSwe, - CatSwe in { -\end{verbatim} - -\subsubsubsection{Parameters} -To abstract over gender names, we define the following identifiers. - -\begin{verbatim} - oper - Gender : Type ; - - utrum : Gender ; - neutrum : Gender ; -\end{verbatim} - -To abstract over number names, we define the following. - -\begin{verbatim} - Number : Type ; - - singular : Number ; - plural : Number ; -\end{verbatim} - -To abstract over case names, we define the following. - -\begin{verbatim} - Case : Type ; - - nominative : Case ; - genitive : Case ; -\end{verbatim} - -Prepositions used in many-argument functions are just strings. - -\begin{verbatim} - Preposition : Type = Str ; -\end{verbatim} - -\subsubsubsection{Nouns} -Worst case: give all four forms. The gender is computed from the -last letter of the second form (if \textit{n}, then \texttt{utrum}, otherwise \texttt{neutrum}). - -\begin{verbatim} - mkN : (apa,apan,apor,aporna : Str) -> N ; -\end{verbatim} - -The regular function takes the singular indefinite form and computes the other -forms and the gender by a heuristic. The heuristic is currently -to treat all words ending with \textit{a} like \textit{flicka}, with \textit{e} like \textit{rike}, -and otherwise like \textit{bil}. -If in doubt, use the \texttt{cc} command to test! - -\begin{verbatim} - regN : Str -> N ; -\end{verbatim} - -Adding the gender manually greatly improves the correction of \texttt{regN}. - -\begin{verbatim} - regGenN : Str -> Gender -> N ; -\end{verbatim} - -In practice the worst case is often just: give singular and plural indefinite. - -\begin{verbatim} - mk2N : (nyckel,nycklar : Str) -> N ; -\end{verbatim} - -This heuristic takes just the plural definite form and infers the others. -It does not work if there are changes in the stem. - -\begin{verbatim} - mk1N : (bilarna : Str) -> N ; -\end{verbatim} - -\subsubsubsection{Compound nouns} -All the functions above work quite as well to form compound nouns, -such as \textit{fotboll}. - -\subsubsubsection{Relational nouns} -Relational nouns (\textit{daughter of x}) need a preposition. - -\begin{verbatim} - mkN2 : N -> Preposition -> N2 ; -\end{verbatim} - -The most common preposition is \textit{av}, and the following is a -shortcut for regular, \texttt{nonhuman} relational nouns with \textit{av}. - -\begin{verbatim} - regN2 : Str -> Gender -> N2 ; -\end{verbatim} - -Use the function \texttt{mkPreposition} or see the section on prepositions below to -form other prepositions. - -Three-place relational nouns (\textit{the connection from x to y}) need two prepositions. - -\begin{verbatim} - mkN3 : N -> Preposition -> Preposition -> N3 ; -\end{verbatim} - -\subsubsubsection{Relational common noun phrases} -In some cases, you may want to make a complex \texttt{CN} into a -relational noun (e.g. \textit{the old town hall of}). However, \texttt{N2} and -\texttt{N3} are purely lexical categories. But you can use the \texttt{AdvCN} -and \texttt{PrepNP} constructions to build phrases like this. - -\subsubsubsection{Proper names and noun phrases} -Proper names, with a regular genitive, are formed as follows - -\begin{verbatim} - regPN : Str -> Gender -> PN ; -- John, John's -\end{verbatim} - -Sometimes you can reuse a common noun as a proper name, e.g. \textit{Bank}. - -\begin{verbatim} - nounPN : N -> PN ; -\end{verbatim} - -To form a noun phrase that can also be plural and have an irregular -genitive, you can use the worst-case function. - -\begin{verbatim} - mkNP : Str -> Str -> Number -> Gender -> NP ; -\end{verbatim} - -\subsubsubsection{Adjectives} -Adjectives may need as many as seven forms. - -\begin{verbatim} - mkA : (liten, litet, lilla, sma, mindre, minst, minsta : Str) -> A ; -\end{verbatim} - -The regular pattern works for many adjectives, e.g. those ending -with \textit{ig}. - -\begin{verbatim} - regA : Str -> A ; -\end{verbatim} - -Just the comparison forms can be irregular. - -\begin{verbatim} - irregA : (tung,tyngre,tyngst : Str) -> A ; -\end{verbatim} - -Sometimes just the positive forms are irregular. - -\begin{verbatim} - mk3A : (galen,galet,galna : Str) -> A ; - mk2A : (bred,brett : Str) -> A ; -\end{verbatim} - -Comparison forms may be compound (\textit{mera svensk} - \textit{mest svensk}). - -\begin{verbatim} - compoundA : A -> A ; -\end{verbatim} - -\subsubsubsection{Two-place adjectives} -Two-place adjectives need a preposition for their second argument. - -\begin{verbatim} - mkA2 : A -> Preposition -> A2 ; -\end{verbatim} - -\subsubsubsection{Adverbs} -Adverbs are not inflected. Most lexical ones have position -after the verb. Some can be preverbal (e.g. \textit{always}). - -\begin{verbatim} - mkAdv : Str -> Adv ; - mkAdV : Str -> AdV ; -\end{verbatim} - -Adverbs modifying adjectives and sentences can also be formed. - -\begin{verbatim} - mkAdA : Str -> AdA ; -\end{verbatim} - -\subsubsubsection{Prepositions} -A preposition is just a string. - -\begin{verbatim} - mkPreposition : Str -> Preposition ; -\end{verbatim} - -\subsubsubsection{Verbs} -The worst case needs five forms. - -\begin{verbatim} - mkV : (supa,super,sup,söp,supit,supen : Str) -> V ; -\end{verbatim} - -The 'regular verb' function is inspired by Lexin. It uses the -present tense indicative form. The value is the first conjugation if the -argument ends with \textit{ar} (\textit{tala} - \textit{talar} - \textit{talade} - \textit{talat}), -the second with \textit{er} (\textit{leka} - \textit{leker} - \textit{lekte} - \textit{lekt}, with the -variations like \textit{gräva}, \textit{vända}, \textit{tyda}, \textit{hyra}), and -the third in other cases (\textit{bo} - \textit{bor} - \textit{bodde} - \textit{bott}). - -\begin{verbatim} - regV : (talar : Str) -> V ; -\end{verbatim} - -The almost regular verb function needs the infinitive and the preteritum. -It is not really more powerful than the new implementation of -\texttt{regV} based on the indicative form. - -\begin{verbatim} - mk2V : (leka,lekte : Str) -> V ; -\end{verbatim} - -There is an extensive list of irregular verbs in the module \texttt{IrregularSwe}. -In practice, it is enough to give three forms, as in school books. - -\begin{verbatim} - irregV : (dricka, drack, druckit : Str) -> V ; -\end{verbatim} - -\subsubsubsection{Verbs with a particle.} -The particle, such as in \textit{passa pÃ¥}, is given as a string. - -\begin{verbatim} - partV : V -> Str -> V ; -\end{verbatim} - -\subsubsubsection{Deponent verbs.} -Some words are used in passive forms only, e.g. \textit{hoppas}, some as -reflexive e.g. \textit{Ã¥ngra sig}. - -\begin{verbatim} - depV : V -> V ; - reflV : V -> V ; -\end{verbatim} - -\subsubsubsection{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 \texttt{V}. - -\begin{verbatim} - mkV2 : V -> Preposition -> V2 ; - - dirV2 : V -> V2 ; -\end{verbatim} - -\subsubsubsection{Three-place verbs} -Three-place (ditransitive) verbs need two prepositions, of which -the first one or both can be absent. - -\begin{verbatim} - mkV3 : V -> Preposition -> Preposition -> V3 ; -- tala med om - dirV3 : V -> Preposition -> V3 ; -- ge _ till - dirdirV3 : V -> V3 ; -- ge _ _ -\end{verbatim} - -\subsubsubsection{Other complement patterns} -Verbs and adjectives can take complements such as sentences, -questions, verb phrases, and adjectives. - -\begin{verbatim} - mkV0 : V -> V0 ; - mkVS : V -> VS ; - mkV2S : V -> Str -> V2S ; - mkVV : V -> VV ; - mkV2V : V -> Str -> Str -> V2V ; - mkVA : V -> VA ; - mkV2A : V -> Str -> V2A ; - mkVQ : V -> VQ ; - mkV2Q : V -> Str -> V2Q ; - - mkAS : A -> AS ; - mkA2S : A -> Str -> A2S ; - mkAV : A -> AV ; - mkA2V : A -> Str -> A2V ; -\end{verbatim} - -Notice: categories \texttt{V2S, V2V, V2A, V2Q} are in v 1.0 treated -just as synonyms of \texttt{V2}, and the second argument is given -as an adverb. Likewise \texttt{AS, A2S, AV, A2V} are just \texttt{A}. -\texttt{V0} is just \texttt{V}. - -\begin{verbatim} - V0, V2S, V2V, V2A, V2Q : Type ; - AS, A2S, AV, A2V : Type ; -\end{verbatim} - -\end{document} diff --git a/doc/resource.txt b/doc/resource.txt index b17afe651..ebc343c4a 100644 --- a/doc/resource.txt +++ b/doc/resource.txt @@ -1,11 +1,12 @@ The GF Resource Grammar Library -Author: Aarne Ranta +Author: Aarne Ranta, Ali El Dada, and Janna Khegai Last update: %%date(%c) % NOTE: this is a txt2tags file. % Create an latex file from this file using: % txt2tags -ttex --toc gf-formalism.txt - +%!style(tex) : isolatin1 +%!postproc: "section*{" "section{" %!target:tex @@ -16,10 +17,17 @@ tutorial. We start with an introduction to the library, and proceed to details with the aim of covering all that one needs to know in order to use the library. How to write one's own resource grammar (i.e. to implement the API for -a new language), is covered by a separate Resource-HOWTO document. +a new language), is covered by a separate Resource-HOWTO document (available in +the www address below). + +The main part of the document (the API documentation) is generated +from the actual GF code by using the ``gfdoc`` tool. This documentation +is also available on-line in HTML format in + +[``http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/`` http://www.cs.chalmers.se/~aarne/GF/lib/resource-1.0/doc/]. -==Motivation== +=Motivation= The GF Resource Grammar Library contains grammar rules for 10 languages (some more are under construction). Its purpose @@ -35,6 +43,7 @@ skills is typical of programmers who want to localize software to new languages. The current resource languages are +- ``Ara``bic - ``Dan``ish - ``Eng``lish - ``Fin``nish @@ -47,7 +56,8 @@ The current resource languages are - ``Swe``dish -The first three letters (``Dan`` etc) are used in grammar module names. +The first three letters (``Ara`` etc) are used in grammar module names. +The Arabic implementation is still incomplete. To give an example application, consider music playing devices. In the application, @@ -103,7 +113,7 @@ languages (e.g. a different word order in French), but the application programmer need not care about the difference. -===A complete example=== +==A complete example== To summarize the example, and also give a template for a programmer to work on, here is the complete implementation of a small system with songs and properties. @@ -145,13 +155,15 @@ the resource category system ``Cat``. Each language has its own concrete syntax, which opens the inflectional paradigms module for that language: ``` - concrete MusicLexGer of MusicLex = CatGer ** open ParadigmsGer in { + concrete MusicLexGer of MusicLex = + CatGer ** open ParadigmsGer in { lin song_N = reg2N "Lied" "Lieder" neuter ; american_A = regA "Amerikanisch" ; } - concrete MusicLexFre of MusicLex = CatFre ** open ParadigmsFre in { + concrete MusicLexFre of MusicLex = + CatFre ** open ParadigmsFre in { lin song_N = regGenN "chanson" feminine ; american_A = regA "américain" ; @@ -182,7 +194,8 @@ instantiating ``Music``. The latter is completely trivial, whereas the former one involves the choice of correct vocabulary and inflectional paradigms. For instance, Finnish is added as follows: ``` - concrete MusicLexFin of MusicLex = CatFin ** open ParadigmsFin in { + concrete MusicLexFin of MusicLex = + CatFin ** open ParadigmsFin in { lin song_N = regN "kappale" ; american_A = regA "amerikkalainen" ; @@ -200,7 +213,8 @@ for the sake of argument, that adjectival modification does not sound good in English, but that a relative clause would be preferrable. One can then start as before, ``` - concrete MusicLexEng of MusicLex = CatEng ** open ParadigmsEng in { + concrete MusicLexEng of MusicLex = + CatEng ** open ParadigmsEng in { lin song_N = regN "song" ; american_A = regA "American" ; @@ -216,15 +230,17 @@ another module would be built on top of it, with a restricted import from except ``PropKind``, and gives its own definition of this function: ``` - concrete MusicEng of Music = MusicEng0 - [PropKind] ** open GrammarEng in { + concrete MusicEng of Music = + MusicEng0 - [PropKind] ** open GrammarEng in { lin PropKind k p = - RelCN k (UseRCl TPres ASimul PPos (RelVP IdRP (UseComp (CompAP p)))) ; + RelCN k (UseRCl TPres ASimul PPos + (RelVP IdRP (UseComp (CompAP p)))) ; } ``` -===Parsing with resource grammars?=== +==Parsing with resource grammars?== The intended use of the resource grammar is as a library for writing application grammars. It is not designed for parsing e.g. newspaper text. There @@ -257,9 +273,9 @@ will often use only restricted inheritance of ``MusicI``. -==To find rules in the resource grammar library== +=To find rules in the resource grammar library= -===Inflection paradigms=== +==Inflection paradigms== Inflection paradigms are defined separately for each language //L// in the module ``Paradigms``//L//. To test them, the command @@ -287,13 +303,14 @@ can be used: g : Gender = Fem } ``` -For the sake of convenience, every language implements these four paradigms: +For the sake of convenience, every language implements these five paradigms: ``` oper - regN : Str -> N ; -- regular nouns - regA : Str -> A : -- regular adjectives - regV : Str -> V ; -- regular verbs - dirV : V -> V2 ; -- direct transitive verbs + regN : Str -> N ; -- regular nouns + regA : Str -> A : -- regular adjectives + regV : Str -> V ; -- regular verbs + regPN : Str -> PN ; -- regular proper names + dirV : V -> V2 ; -- direct transitive verbs ``` It is often possible to initialize a lexicon by just using these functions, and later revise it by using the more involved paradigms. For instance, in @@ -309,7 +326,7 @@ English - maybe not so strange in certain technical domains. -===Syntax rules=== +==Syntax rules== Syntax rules should be looked for in the abstract modules defining the API. There are around 10 such modules, each defining constructors for @@ -361,7 +378,7 @@ This can be built by parsing "I have beer" in LanEng and then writing which uses ParadigmsIta.regGenN. -===Example-based grammar writing=== +==Example-based grammar writing== The technique of parsing with the resource grammar can be used in GF source files, endowed with the suffix ``.gfe`` ("GF examples"). The suffix tells GF to preprocess @@ -407,7 +424,7 @@ and then use this lexicon instead of the standard one included in ``Lang``. -===Special-purpose APIs=== +==Special-purpose APIs== To give an analogy with the well-known type setting software, GF can be compared with TeX and the resource grammar library with LaTeX. @@ -458,9 +475,9 @@ with resource grammars becomes more practical. -==Overview of syntactic structures== +=Overview of syntactic structures= -===Texts. phrases, and utterances=== +==Texts. phrases, and utterances== The outermost linguistic structure is ``Text``. ``Text``s are composed from Phrases (``Phr``) followed by punctuation marks - either of ".", "?" or @@ -496,7 +513,7 @@ a Phrase is an Utterance with an optional leading conjunction ("but") and an optional tailing vocative ("John", "please"). -===Sentences and clauses=== +==Sentences and clauses== The richest of the categories below Utterance is ``S``, Sentence. A Sentence is formed from a Clause (``Cl``), by fixing its Tense, Anteriority, and Polarity. @@ -562,7 +579,7 @@ many constructors: ``` -===Parts of sentences=== +==Parts of sentences== The linguistic phenomena mostly discussed in both traditional grammars and modern syntax belong to the level of Clauses, that is, lines 9-13, and occasionally @@ -630,7 +647,7 @@ How to construct ``Adv``s. The main ways are - as prepositional phrases: "in the car" -===Modules and their names=== +==Modules and their names== The resource modules are named after the kind of phrases that are constructed in them, @@ -666,7 +683,7 @@ category-specific modules is as follows: ``` -===Top-level grammar and lexicon=== +==Top-level grammar and lexicon== The module ``Grammar`` collects all the category-specific modules into a complete grammar: @@ -694,7 +711,7 @@ a general-purpose multilingual lexicon, and this is the form that the module -===Language-specific syntactic structures=== +==Language-specific syntactic structures== The API collected in ``Grammar`` has been designed to be implementable for all languages in the resource package. It does contain some rules that @@ -734,46 +751,127 @@ inheritance is a recent addition to the resource grammar library, and has only been exploited in a very small scale so far. -==API Documentation== +=API Documentation= -===Top-level modules=== +==Top-level modules== + +===Grammar: the Main Module of the Resource Grammar=== %!include: ../lib/resource-1.0/abstract/Grammar.txt + +===Lang: a Test Module for the Resource Grammar=== + %!include: ../lib/resource-1.0/abstract/Lang.txt -===Type system=== +==Type system== +===Cat: the Category System=== + %!include: ../lib/resource-1.0/abstract/Cat.txt + +===Common: Structures with Common Implementations=== + %!include: ../lib/resource-1.0/abstract/Common.txt -===Phrase category modules=== +==Syntax rule modules== + +===Adjective: Adjectives and Adjectival Phrases=== %!include: ../lib/resource-1.0/abstract/Adjective.txt + +===Adverb: Adverbs and Adverbial Phrases=== + %!include: ../lib/resource-1.0/abstract/Adverb.txt + +===Conjunction: Coordination=== + %!include: ../lib/resource-1.0/abstract/Conjunction.txt + +===Idiom: Idiomatic Expressions=== + %!include: ../lib/resource-1.0/abstract/Idiom.txt + +===Noun: Nouns, Noun Phrases, and Determiners=== + %!include: ../lib/resource-1.0/abstract/Noun.txt + +===Numeral: Cardinal and Ordinal Numerals=== + %!include: ../lib/resource-1.0/abstract/Numeral.txt + +===Phrase: Phrases and Utterances=== + %!include: ../lib/resource-1.0/abstract/Phrase.txt + +===Question: Questions and Interrogative Pronouns=== + %!include: ../lib/resource-1.0/abstract/Question.txt + +===Relative: Relative Clauses and Relative Pronouns=== + %!include: ../lib/resource-1.0/abstract/Relative.txt + +===Sentence: Sentences, Clauses, and Imperatives=== + %!include: ../lib/resource-1.0/abstract/Sentence.txt + +===Structural: Structural Words=== + %!include: ../lib/resource-1.0/abstract/Structural.txt + +===Text: Texts=== + %!include: ../lib/resource-1.0/abstract/Text.txt + +===Verb: Verb Phrases=== + %!include: ../lib/resource-1.0/abstract/Verb.txt -===Inflectional paradigms=== +==Inflectional paradigms== + +===Arabic=== + +%!include: ../lib/resource-1.0/arabic/ParadigmsAra.txt + +===Danish=== %!include: ../lib/resource-1.0/danish/ParadigmsDan.txt + +===English=== + %!include: ../lib/resource-1.0/english/ParadigmsEng.txt + +===Finnish=== + %!include: ../lib/resource-1.0/finnish/ParadigmsFin.txt + +===French=== + %!include: ../lib/resource-1.0/french/ParadigmsFre.txt + +===German=== + %!include: ../lib/resource-1.0/german/ParadigmsGer.txt + +===Italian=== + %!include: ../lib/resource-1.0/italian/ParadigmsIta.txt + +===Norwegian=== + %!include: ../lib/resource-1.0/norwegian/ParadigmsNor.txt + +===Russian=== + %!include: ../lib/resource-1.0/russian/ParadigmsRus.txt + +===Spanish=== + %!include: ../lib/resource-1.0/spanish/ParadigmsSpa.txt + +===Swedish=== + %!include: ../lib/resource-1.0/swedish/ParadigmsSwe.txt diff --git a/examples/dialogue/AgendaEng.gf b/examples/dialogue/AgendaEng.gf index 519f90c8d..658853004 100644 --- a/examples/dialogue/AgendaEng.gf +++ b/examples/dialogue/AgendaEng.gf @@ -6,7 +6,7 @@ concrete AgendaEng of Agenda = lin Day = UseN (regN "day") ; Meeting = UseN (regN "meeting") ; - Add = dirV3 (regV "add") (mkPreposition "on") ; + Add = dirV3 (regV "add") (mkPrep "on") ; Remove = dirV2 (regV "remove") ; Interrupt = regV "interrupt" ; diff --git a/examples/dialogue/AgendaSwe.gf b/examples/dialogue/AgendaSwe.gf index 1e7bf93dc..a9331e9a0 100644 --- a/examples/dialogue/AgendaSwe.gf +++ b/examples/dialogue/AgendaSwe.gf @@ -6,7 +6,7 @@ concrete AgendaSwe of Agenda = lin Day = UseN (regN "dag") ; Meeting = UseN (regGenN "möte" neutrum) ; - Add = dirV3 (partV lägga_V "till") (mkPreposition "på") ; + Add = dirV3 (partV lägga_V "till") (mkPrep "på") ; Remove = dirV2 (partV taga_V "bort") ; Interrupt = avbryta_V ; diff --git a/examples/dialogue/LightsEng.gf b/examples/dialogue/LightsEng.gf index 77dcc0aed..dfed6de85 100644 --- a/examples/dialogue/LightsEng.gf +++ b/examples/dialogue/LightsEng.gf @@ -6,8 +6,8 @@ concrete LightsEng of Lights = lin Light = UseN (regN "light") ; Room = UseN (regN "room") ; - SwitchOnIn = dirV3 (partV (regV "switch") "on") (mkPreposition "in") ; - SwitchOffIn = dirV3 (partV (regV "switch") "off") (mkPreposition "in") ; + SwitchOnIn = dirV3 (partV (regV "switch") "on") (mkPrep "in") ; + SwitchOffIn = dirV3 (partV (regV "switch") "off") (mkPrep "in") ; SwitchOn = dirV2 (partV (regV "switch") "on") ; SwitchOff = dirV2 (partV (regV "switch") "off") ; diff --git a/examples/dialogue/LightsFre.gf b/examples/dialogue/LightsFre.gf index dc86cce2b..77316e5a1 100644 --- a/examples/dialogue/LightsFre.gf +++ b/examples/dialogue/LightsFre.gf @@ -6,8 +6,8 @@ concrete LightsFre of Lights = lin Light = UseN (regN "lampe") ; Room = UseN (regN "chambre") ; - SwitchOnIn = dirV3 (regV "allumer") (mkPreposition "dans") ; - SwitchOffIn = dirV3 éteindre_V2 (mkPreposition "dans") ; + SwitchOnIn = dirV3 (regV "allumer") (mkPrep "dans") ; + SwitchOffIn = dirV3 éteindre_V2 (mkPrep "dans") ; SwitchOn = dirV2 (regV "allumer") ; SwitchOff = dirV2 éteindre_V2 ; diff --git a/examples/dialogue/LightsSwe.gf b/examples/dialogue/LightsSwe.gf index e2daaa36b..19f0d8964 100644 --- a/examples/dialogue/LightsSwe.gf +++ b/examples/dialogue/LightsSwe.gf @@ -7,8 +7,8 @@ concrete LightsSwe of Lights = lin Light = UseN (regN "lampa") ; Room = UseN (mkN "rum" "rummet" "rum" "rummen") ; - SwitchOnIn = dirV3 (regV "tänder") (mkPreposition "i") ; - SwitchOffIn = dirV3 (regV "släcker") (mkPreposition "i") ; + SwitchOnIn = dirV3 (regV "tänder") (mkPrep "i") ; + SwitchOffIn = dirV3 (regV "släcker") (mkPrep "i") ; SwitchOn = dirV2 (regV "tänder") ; SwitchOff = dirV2 (regV "släcker") ; diff --git a/examples/dialogue/WeekdayEng.gf b/examples/dialogue/WeekdayEng.gf index 16c2e6125..7d296af9a 100644 --- a/examples/dialogue/WeekdayEng.gf +++ b/examples/dialogue/WeekdayEng.gf @@ -4,7 +4,7 @@ concrete WeekdayEng of Weekday = open LangEng, ParadigmsEng in { WDay = PN ; lin - Mon = regPN "Monday" nonhuman ; - Tue = regPN "Tuesday" nonhuman ; + Mon = regGenPN "Monday" nonhuman ; + Tue = regGenPN "Tuesday" nonhuman ; } diff --git a/examples/dialogue/WeekdaySwe.gf b/examples/dialogue/WeekdaySwe.gf index 9097f19d3..2cd55c522 100644 --- a/examples/dialogue/WeekdaySwe.gf +++ b/examples/dialogue/WeekdaySwe.gf @@ -4,7 +4,7 @@ concrete WeekdaySwe of Weekday = open LangSwe, ParadigmsSwe in { WDay = PN ; lin - Mon = regPN "mÃ¥ndag" utrum ; - Tue = regPN "tisdag" utrum ; + Mon = regGenPN "mÃ¥ndag" utrum ; + Tue = regGenPN "tisdag" utrum ; } diff --git a/lib/resource-1.0/Makefile b/lib/resource-1.0/Makefile index c00b6f792..1dc36527c 100644 --- a/lib/resource-1.0/Makefile +++ b/lib/resource-1.0/Makefile @@ -1,8 +1,13 @@ -GF=../../bin/gf +GF=gf +RTS=+RTS -M800M -K100M +GFCC=$(GF) -nocf -make +GFC=$(GFCC) -src +GFCP=$(GFC) -preproc=./mkPresent -.PHONY: show-path all test pretest langs present mathematical multimodal compiled treebank stat gfdoc clean -all: show-path langs multimodal present mathematical compiled +.PHONY: show-path all test alltenses pretest langs present mathematical multimodal compiled treebank stat gfdoc clean + +all: show-path present alltenses langs multimodal mathematical compiled show-path: @echo GF_LIB_PATH=$(GF_LIB_PATH) @@ -13,13 +18,36 @@ test: pretest: echo "gr -cat=Cl -number=11 -prob | tb" | $(GF) -probs=lang.gfprob -path=present:prelude -nocf ../present/Lang???.gfc -langs: - echo "s ;; pm | wf langs.gfcm" | $(GF) -nocf -src */Lang??*.gf english/LangEng.gf +RTS -M800M -K100M +alltenses: +# $(GFC) arabic/LangAra.gf + $(GFC) danish/Danish.gf + $(GFC) english/English.gf + $(GFC) finnish/Finnish.gf + $(GFC) french/French.gf + $(GFC) german/German.gf + $(GFC) italian/Italian.gf + $(GFC) norwegian/Norwegian.gf + $(GFC) russian/LangRus.gf + $(GFC) spanish/Spanish.gf + $(GFC) swedish/Swedish.gf cp -p */*.gfc */*.gfr ../alltenses +langs: + echo "s ;; pm | wf langs.gfcm" | $(GFCC) -path=alltenses:prelude ../alltenses/Lang???.gfc $(RTS) + + present: - chmod u+x mkPresent - $(GF) -make -src -preproc=./mkPresent */Lang??*.gf +RTS -M800M -K100M +# $(GFCP) arabic/LangAra.gf + $(GFCP) danish/Danish.gf + $(GFCP) english/English.gf + $(GFCP) finnish/Finnish.gf + $(GFCP) french/French.gf + $(GFCP) german/German.gf + $(GFCP) italian/Italian.gf + $(GFCP) norwegian/Norwegian.gf + $(GFCP) russian/LangRus.gf + $(GFCP) spanish/Spanish.gf + $(GFCP) swedish/Swedish.gf mv */*.gfc */*.gfr ../present mathematical: diff --git a/lib/resource-1.0/arabic/ParadigmsAra.gf b/lib/resource-1.0/arabic/ParadigmsAra.gf index 65d9d3454..cec7ffb78 100644 --- a/lib/resource-1.0/arabic/ParadigmsAra.gf +++ b/lib/resource-1.0/arabic/ParadigmsAra.gf @@ -2,7 +2,7 @@ --1 Arabic Lexical Paradigms -- --- Aarne Ranta 2003--2005 +-- Ali El Dada 2005--2006 -- -- This is an API to the user of the resource grammar -- for adding lexical items. It gives functions for forming diff --git a/lib/resource-1.0/danish/Danish.gf b/lib/resource-1.0/danish/Danish.gf new file mode 100644 index 000000000..6626048cf --- /dev/null +++ b/lib/resource-1.0/danish/Danish.gf @@ -0,0 +1,7 @@ +--# -path=.:../scandinavian:../abstract:../common:prelude + +concrete Danish of DanishAbs = + LangDan, + IrregDan - [fly_V], + ExtraDan + ** {} ; diff --git a/lib/resource-1.0/danish/DanishAbs.gf b/lib/resource-1.0/danish/DanishAbs.gf new file mode 100644 index 000000000..734717b6d --- /dev/null +++ b/lib/resource-1.0/danish/DanishAbs.gf @@ -0,0 +1,5 @@ +abstract DanishAbs = + Lang, + IrregDanAbs - [fly_V], + ExtraDanAbs + ** {} ; diff --git a/lib/resource-1.0/danish/ExtraDan.gf b/lib/resource-1.0/danish/ExtraDan.gf new file mode 100644 index 000000000..28083b20c --- /dev/null +++ b/lib/resource-1.0/danish/ExtraDan.gf @@ -0,0 +1,3 @@ +concrete ExtraDan of ExtraDanAbs = ExtraScandDan ** open CommonScand, ResDan in { + +} diff --git a/lib/resource-1.0/danish/ExtraDanAbs.gf b/lib/resource-1.0/danish/ExtraDanAbs.gf new file mode 100644 index 000000000..45ac75290 --- /dev/null +++ b/lib/resource-1.0/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/resource-1.0/danish/ExtraScandDan.gf b/lib/resource-1.0/danish/ExtraScandDan.gf new file mode 100644 index 000000000..26fa8f390 --- /dev/null +++ b/lib/resource-1.0/danish/ExtraScandDan.gf @@ -0,0 +1,2 @@ +concrete ExtraScandDan of ExtraScandAbs = CatDan ** ExtraScand with + (ResScand = ResDan) ; diff --git a/lib/resource-1.0/danish/LexiconDan.gf b/lib/resource-1.0/danish/LexiconDan.gf index 8c5b4da6c..a7ed48bd2 100644 --- a/lib/resource-1.0/danish/LexiconDan.gf +++ b/lib/resource-1.0/danish/LexiconDan.gf @@ -10,18 +10,18 @@ flags startcat=Phr ; lexer=textlit ; unlexer=text ; lin airplane_N = mk2N "fly" "flyet" ; - answer_V2S = mkV2S (regV "svare") "til" ; + 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 [] ; + 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 [] "at" ; + 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" ; @@ -35,7 +35,7 @@ lin 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") "til" ; ---- + 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") ; ---- @@ -62,17 +62,17 @@ lin cow_N = mk2N "ku" "kuen" ; ---- die_V = vaereV dø_V ; dirty_A = regADeg "smudsig" ; ---- - distance_N3 = mkN3 (regGenN "afstand" utrum) "fra" "til" ; + 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") "for" ; ---- + 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")) "til" ; ---- + 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" ; @@ -109,19 +109,19 @@ lin 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 "af" ; + 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 = mk3N "mand" "manden" "mænd" ; ---- - married_A2 = mkA2 (mk2A "gift" "gift") "med" ; + 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") "til" ; ---- + 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" ; @@ -130,9 +130,9 @@ lin oil_N = mk2N "olie" "olien" ; old_A = mkADeg "gammel" "gammelt" "gamle" "ældre" "ældst" ; ---- open_V2 = dirV2 (regV "åbne") ; - paint_V2A = mkV2A (regV "male") [] ; + paint_V2A = mkV2A (regV "male") noPrep ; paper_N = mk2N "papir" "papiret" ; - paris_PN = regPN "Paris" neutrum ; + paris_PN = mkPN "Paris" neutrum ; peace_N = mk2N "fred" "freden" ; pen_N = mk2N "pen" "penen" ; planet_N = mk2N "planet" "planeten" ; @@ -158,9 +158,9 @@ lin science_N = mk2N "videnskab" "videnskaben" ; sea_N = mk2N "hav" "havet" ; see_V2 = dirV2 se_V ; - seek_V2 = mkV2 (mk2V "søge" "søgte") "efter" ; - sell_V3 = dirV3 sælge_V "til" ; - send_V3 = dirV3 (mk2V "sende" "sendte") "til" ; + 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" ; @@ -184,7 +184,7 @@ lin switch8off_V2 = dirV2 (partV (regV "lukke") "for") ; switch8on_V2 = dirV2 (partV (regV "lukke") "op") ; table_N = mk2N "bord" "bordet" ; - talk_V3 = mkV3 (regV "tale") "til" "om" ; + 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" ; @@ -198,11 +198,11 @@ lin understand_V2 = dirV2 (irregV "forstå" "forstod" "forstått") ; university_N = mk2N "universitet" "universitetet" ; village_N = mk2N "landsby" "landsbyen" ; - wait_V2 = mkV2 (regV "vente") "på" ; + 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 "på" ; + watch_V2 = mkV2 se_V (mkPrep "på") ; water_N = mk2N "vand" "vandet" ; white_A = regADeg "hvid" ; window_N = mkN "vindue" "vinduet" "vinduer" "vinduene" ; ---- er? @@ -219,7 +219,7 @@ lin now_Adv = mkAdv "nu" ; already_Adv = mkAdv "allerede" ; song_N = mk2N "sang" "sangen" ; - add_V3 = mkV3 (regV "tilføje") [] "til" ; ---- + 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") ; diff --git a/lib/resource-1.0/danish/ParadigmsDan.gf b/lib/resource-1.0/danish/ParadigmsDan.gf index c38810bdf..bc571882f 100644 --- a/lib/resource-1.0/danish/ParadigmsDan.gf +++ b/lib/resource-1.0/danish/ParadigmsDan.gf @@ -59,7 +59,8 @@ oper -- Prepositions used in many-argument functions are just strings. - Preposition : Type = Str ; + mkPrep : Str -> Prep ; + noPrep : Prep ; -- empty string --2 Nouns @@ -100,19 +101,20 @@ oper -- -- Relational nouns ("daughter of x") need a preposition. - mkN2 : N -> Preposition -> N2 ; + 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 $mkPreposition$ or see the section on prepositions below to +-- Use the function $mkPrep$ or see the section on prepositions below to -- form other prepositions. -- --- Three-place relational nouns ("the connection from x to y") need two prepositions. +-- Three-place relational nouns ("the connection from x to y") +-- need two prepositions. - mkN3 : N -> Preposition -> Preposition -> N3 ; + mkN3 : N -> Prep -> Prep -> N3 ; --3 Relational common noun phrases @@ -127,7 +129,8 @@ oper -- -- Proper names, with a regular genitive, are formed as follows - regPN : Str -> Gender -> PN ; -- John, John's + mkPN : Str -> Gender -> PN ; -- Paris neutrum + regPN : Str -> PN ; -- utrum gender -- Sometimes you can reuse a common noun as a proper name, e.g. "Bank". @@ -156,7 +159,7 @@ oper -- -- Two-place adjectives need a preposition for their second argument. - mkA2 : A -> Preposition -> A2 ; + mkA2 : A -> Prep -> A2 ; -- Comparison adjectives may need as many as five forms. @@ -194,11 +197,6 @@ oper mkAdA : Str -> AdA ; ---2 Prepositions --- --- A preposition is just a string. - - mkPreposition : Str -> Preposition ; --2 Verbs -- @@ -249,7 +247,7 @@ oper -- Two-place verbs need a preposition, except the special case with direct object. -- (transitive verbs). Notice that a particle comes from the $V$. - mkV2 : V -> Preposition -> V2 ; + mkV2 : V -> Prep -> V2 ; dirV2 : V -> V2 ; @@ -258,8 +256,8 @@ oper -- Three-place (ditransitive) verbs need two prepositions, of which -- the first one or both can be absent. - mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about - dirV3 : V -> Str -> V3 ; -- give,_,to + mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about + dirV3 : V -> Prep -> V3 ; -- give,_,to dirdirV3 : V -> V3 ; -- give,_,_ --3 Other complement patterns @@ -269,18 +267,18 @@ oper mkV0 : V -> V0 ; mkVS : V -> VS ; - mkV2S : V -> Str -> V2S ; + mkV2S : V -> Prep -> V2S ; mkVV : V -> VV ; - mkV2V : V -> Str -> Str -> V2V ; + mkV2V : V -> Prep -> Prep -> V2V ; mkVA : V -> VA ; - mkV2A : V -> Str -> V2A ; + mkV2A : V -> Prep -> V2A ; mkVQ : V -> VQ ; - mkV2Q : V -> Str -> V2Q ; + mkV2Q : V -> Prep -> V2Q ; mkAS : A -> AS ; - mkA2S : A -> Str -> A2S ; + mkA2S : A -> Prep -> A2S ; mkAV : A -> AV ; - mkA2V : A -> Str -> A2V ; + mkA2V : A -> Prep -> A2V ; -- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated -- just as synonyms of $V2$, and the second argument is given @@ -290,12 +288,13 @@ oper V0, V2S, V2V, V2A, V2Q : 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 ; @@ -307,6 +306,14 @@ oper nominative = Nom ; genitive = Gen ; + Preposition : Type = Str ; -- obsolete + + mkPreposition : Str -> Prep ; -- obsolete + mkPreposition = mkPrep ; + + mkPrep p = {s = p ; lock_Prep = <>} ; + noPrep = mkPrep [] ; + mkN x y z u = mkSubstantive x y z u ** {g = extNGen y ; lock_N = <>} ; regN x = regGenN x Utr ; @@ -330,11 +337,12 @@ oper mk3N x y z = let u = ifTok Str x z "ene" "ne" in mkN x y z (z + u) ; - mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ; + mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ; regN2 n g = mkN2 (regGenN n g) (mkPreposition "av") ; - mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ; + mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ; - regPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ; + mkPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ; + regPN n = mkPN n utrum ; nounPN n = {s = n.s ! singular ! Indef ; g = n.g ; lock_PN = <>} ; mkNP x y n g = {s = table {NPPoss _ => x ; _ => y} ; a = agrP3 g n ; @@ -344,7 +352,7 @@ oper mk2A a b = mkA a b (a + "e") ; regA a = (regADeg a) ** {lock_A = <>} ; - mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ; + mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ; mkADeg a b c d e = mkAdject a b c d e ** {isComp = False ; lock_A = <>} ; @@ -368,8 +376,6 @@ oper mkAdV x = ss x ** {lock_AdV = <>} ; mkAdA x = ss x ** {lock_AdA = <>} ; - mkPreposition p = p ; - mkV a b c d e f = mkVerb6 a b c d e f ** {part = [] ; vtype = VAct ; lock_V = <> ; isVaere = False} ; @@ -418,12 +424,12 @@ oper s = v.s ; part = v.part ; vtype = VRefl ; isVaere = False ; lock_V = <> } ; - mkV2 v p = v ** {c2 = p ; lock_V2 = <>} ; - dirV2 v = mkV2 v [] ; + mkV2 v p = v ** {c2 = p.s ; lock_V2 = <>} ; + dirV2 v = mkV2 v (mkPrep []) ; - mkV3 v p q = v ** {c2 = p ; c3 = q ; lock_V3 = <>} ; - dirV3 v p = mkV3 v [] p ; - dirdirV3 v = dirV3 v [] ; + mkV3 v p q = v ** {c2 = p.s ; c3 = q.s ; lock_V3 = <>} ; + dirV3 v p = mkV3 v noPrep p ; + dirdirV3 v = dirV3 v noPrep ; mkV0 v = v ** {lock_V0 = <>} ; mkVS v = v ** {lock_VS = <>} ; diff --git a/lib/resource-1.0/doc/gfdoc/Adjective.html b/lib/resource-1.0/doc/gfdoc/Adjective.html index fb54a7e14..b164fc120 100644 --- a/lib/resource-1.0/doc/gfdoc/Adjective.html +++ b/lib/resource-1.0/doc/gfdoc/Adjective.html @@ -2,21 +2,16 @@
-
abstract Adjective = Cat ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Adverb.html b/lib/resource-1.0/doc/gfdoc/Adverb.html
index 2dd71c976..2f707f31b 100644
--- a/lib/resource-1.0/doc/gfdoc/Adverb.html
+++ b/lib/resource-1.0/doc/gfdoc/Adverb.html
@@ -2,21 +2,16 @@
- Adverbs and adverbial phrases
+ Adverb: Adverbs and Adverbial Phrases
- Adverbs and adverbial phrases
+ Adverb: Adverbs and Adverbial Phrases
-Author:
-Last update: Tue Jun 13 11:42:38 2006
+Last update: 2006-06-15 09:19:39 CEST
-
-
@@ -25,8 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Adverbs and adverbial phrases
abstract Adverb = Cat ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Cat.html b/lib/resource-1.0/doc/gfdoc/Cat.html
index f047efd47..25ac55973 100644
--- a/lib/resource-1.0/doc/gfdoc/Cat.html
+++ b/lib/resource-1.0/doc/gfdoc/Cat.html
@@ -2,31 +2,27 @@
- The category system
+ Cat: the Category System
- The category system
+ Cat: the Category System
-Author:
-Last update: Tue Jun 13 11:42:38 2006
+Last update: 2006-06-15 09:19:39 CEST
-
- - The category system
- - Sentences and clauses
-
- Questions and interrogatives
-
- Relative clauses and pronouns
-
- Verb phrases
-
- Adjectival phrases
-
- Nouns and noun phrases
-
- Numerals
-
- Structural words
-
- Words of open classes
+
- Sentences and clauses
+
- Questions and interrogatives
+
- Relative clauses and pronouns
+
- Verb phrases
+
- Adjectival phrases
+
- Nouns and noun phrases
+
- Numerals
+
- Structural words
+
- Words of open classes
-
@@ -36,8 +32,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-The category system
The category system is central to the library in the sense
that the other modules (Adjective, Adverb, Noun, Verb etc)
@@ -64,7 +58,7 @@ are defined on Conjunction and only used locally there.
cat
-
+
Sentences and clauses
Constructed in Sentence, and also in
@@ -79,7 +73,7 @@ Constructed in Sentence, and also in
Imp ; -- imperative e.g. "look at this"
-
+
Constructed in Question. @@ -91,7 +85,7 @@ Constructed in Question. IDet ; -- interrogative determiner e.g. "which"
- +Constructed in Relative. @@ -101,7 +95,7 @@ Constructed in Relative. RP ; -- relative pronoun e.g. "in which"
- +Constructed in Verb. @@ -111,7 +105,7 @@ Constructed in Verb. Comp ; -- complement of copula, such as AP e.g. "very warm"
- +Constructed in Adjective. @@ -120,7 +114,7 @@ Constructed in Adjective. AP ; -- adjectival phrase e.g. "very warm"
- +Constructed in Noun. @@ -147,7 +141,7 @@ as defined in Noun. Ord ; -- ordinal number (used in Det) e.g. "seventh"
- +Constructed in Numeral. @@ -156,7 +150,7 @@ Constructed in Numeral. Numeral;-- cardinal or ordinal, e.g. "five/fifth"
- +Constructed in Structural. @@ -168,7 +162,7 @@ Constructed in Structural. Prep ; -- preposition, or just case e.g. "in"
- +These are constructed in Lexicon and in diff --git a/lib/resource-1.0/doc/gfdoc/Common.html b/lib/resource-1.0/doc/gfdoc/Common.html index c6a9669a4..8fc32086b 100644 --- a/lib/resource-1.0/doc/gfdoc/Common.html +++ b/lib/resource-1.0/doc/gfdoc/Common.html @@ -2,25 +2,21 @@
-
This module defines the categories that uniformly have the linearization
{s : Str} in all languages.
@@ -48,7 +42,7 @@ Romance languages.
cat
Constructed in Text: Text.
@@ -74,7 +68,7 @@ Constructed in Sentence:
SC ; -- embedded sentence or question e.g. "that it rains"
Constructed in Adverb. @@ -89,7 +83,7 @@ Many adverbs are constructed in Structural. CAdv ; -- comparative adverb e.g. "more"
- +
Tense ; -- tense: present, past, future, conditional
diff --git a/lib/resource-1.0/doc/gfdoc/Conjunction.html b/lib/resource-1.0/doc/gfdoc/Conjunction.html
index 48f5b2b35..18246dd77 100644
--- a/lib/resource-1.0/doc/gfdoc/Conjunction.html
+++ b/lib/resource-1.0/doc/gfdoc/Conjunction.html
@@ -2,25 +2,21 @@
- Coordination
+ Conjunction: Coordination
- Coordination
+ Conjunction: Coordination
-Author:
-Last update: Tue Jun 13 11:42:39 2006
+Last update: 2006-06-15 09:19:39 CEST
-
- - Coordination
- - Rules
-
- Categories
-
- List constructors
+
- Rules
+
- Categories
+
- List constructors
-
@@ -30,8 +26,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Coordination
Coordination is defined for many different categories; here is
a sample. The rules apply to lists of two or more elements,
@@ -51,7 +45,7 @@ compatibility with API 0.9 is needed, use
abstract Conjunction = Cat ** {
-
+
fun
@@ -66,7 +60,7 @@ compatibility with API 0.9 is needed, use
DConjAdv : DConj -> [Adv] -> Adv; -- "both badly and slowly"
-
+
These categories are only used in this module. @@ -79,7 +73,7 @@ These categories are only used in this module. [AP]{2} ;
- +The list constructors are derived from the list notation and therefore diff --git a/lib/resource-1.0/doc/gfdoc/Grammar.html b/lib/resource-1.0/doc/gfdoc/Grammar.html index f68e408bd..b4c131f87 100644 --- a/lib/resource-1.0/doc/gfdoc/Grammar.html +++ b/lib/resource-1.0/doc/gfdoc/Grammar.html @@ -2,21 +2,16 @@
-This grammar a collection of the different grammar modules, To test the resource, import Lang, which also contains diff --git a/lib/resource-1.0/doc/gfdoc/Idiom.html b/lib/resource-1.0/doc/gfdoc/Idiom.html index 665fb7645..e808d2c24 100644 --- a/lib/resource-1.0/doc/gfdoc/Idiom.html +++ b/lib/resource-1.0/doc/gfdoc/Idiom.html @@ -2,21 +2,16 @@
-
abstract Idiom = Cat ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Lang.html b/lib/resource-1.0/doc/gfdoc/Lang.html
index 751aa89e8..fc9167189 100644
--- a/lib/resource-1.0/doc/gfdoc/Lang.html
+++ b/lib/resource-1.0/doc/gfdoc/Lang.html
@@ -2,21 +2,16 @@
--This grammar is just a collection of the different modules, -and the one that can be imported when one wants to test the -grammar. A module without a lexicon is 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, which may be more suitable to open in applications.
diff --git a/lib/resource-1.0/doc/gfdoc/Mathematical.html b/lib/resource-1.0/doc/gfdoc/Mathematical.html index 83e6bf82f..70ef813ac 100644 --- a/lib/resource-1.0/doc/gfdoc/Mathematical.html +++ b/lib/resource-1.0/doc/gfdoc/Mathematical.html @@ -6,17 +6,12 @@-The Mathematics API to the Resource Grammar
-Author:
-Last update: Tue Jun 13 11:42:44 2006 +Last update: 2006-02-28 09:26:58 CET
-
This grammar is a collection of the different modules.
It differs from Lang in two main ways:
diff --git a/lib/resource-1.0/doc/gfdoc/Multi.html b/lib/resource-1.0/doc/gfdoc/Multi.html
index 4b1e2b9a4..e94882d8b 100644
--- a/lib/resource-1.0/doc/gfdoc/Multi.html
+++ b/lib/resource-1.0/doc/gfdoc/Multi.html
@@ -6,17 +6,12 @@
abstract Multi = Lang ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Noun.html b/lib/resource-1.0/doc/gfdoc/Noun.html
index 87c0d9e89..90b866dd7 100644
--- a/lib/resource-1.0/doc/gfdoc/Noun.html
+++ b/lib/resource-1.0/doc/gfdoc/Noun.html
@@ -2,26 +2,22 @@
- The construction of nouns, noun phrases, and determiners
+ Noun: Nouns, noun phrases, and determiners
- The construction of nouns, noun phrases, and determiners
+ Noun: Nouns, noun phrases, and determiners
-Author:
-Last update: Tue Jun 13 11:42:40 2006
+Last update: 2006-06-15 09:19:39 CEST
-
- - The construction of nouns, noun phrases, and determiners
- - Noun phrases
-
- Determiners
-
- Common nouns
-
- Apposition
+
- Noun phrases
+
- Determiners
+
- Common nouns
+
- Apposition
-
@@ -31,13 +27,11 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-The construction of nouns, noun phrases, and determiners
abstract Noun = Cat ** {
-
+
Noun phrases
The three main types of noun phrases are
@@ -72,7 +66,7 @@ verb or by an adverb.
AdvNP : NP -> Adv -> NP ; -- Paris at midnight
-
+
The determiner has a fine-grained structure, in which a 'nucleus' @@ -166,7 +160,7 @@ in semantically odd expressions.
Other determiners are defined in Structural.
- +Simple nouns can be used as nouns outright. @@ -212,7 +206,7 @@ to decide. Sentential complements are defined in Verb. SentCN : CN -> SC -> CN ; -- fact that John smokes, question if he does
- +This is certainly overgenerating. diff --git a/lib/resource-1.0/doc/gfdoc/Numeral.html b/lib/resource-1.0/doc/gfdoc/Numeral.html index 2139cd31e..6406bf1a0 100644 --- a/lib/resource-1.0/doc/gfdoc/Numeral.html +++ b/lib/resource-1.0/doc/gfdoc/Numeral.html @@ -6,17 +6,12 @@
This grammar defines numerals from 1 to 999999. The implementations are adapted from the diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsDan.html b/lib/resource-1.0/doc/gfdoc/ParadigmsDan.html index 72b0a5bcd..812675114 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsDan.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsDan.html @@ -2,64 +2,50 @@
+-Author: -Last update: Tue Jun 13 11:42:42 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../scandinavian:../common:../abstract:../../prelude -
- -Aarne Ranta 2003
@@ -97,7 +83,7 @@ words. CatDan in {
- +To abstract over gender names, we define the following identifiers. @@ -134,10 +120,11 @@ To abstract over case names, we define the following. Prepositions used in many-argument functions are just strings.
- Preposition : Type = Str ; + mkPrep : Str -> Prep ; + noPrep : Prep ; -- empty string- +
Worst case: give all four forms. The gender is computed from the @@ -180,19 +167,19 @@ indefinite mk3N : (bil,bilen,biler : Str) -> N ;
- +All the functions above work quite as well to form compound nouns, such as fotboll.
- +Relational nouns (daughter of x) need a preposition.
- mkN2 : N -> Preposition -> N2 ; + mkN2 : N -> Prep -> N2 ;
@@ -204,17 +191,18 @@ shortcut for regular, nonhuman relational nouns with av.
-Use the function mkPreposition or see the section on prepositions below to
+Use the function mkPrep or see the section on prepositions below to
form other prepositions.
-Three-place relational nouns (the connection from x to y) need two prepositions. +Three-place relational nouns (the connection from x to y) +need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ; + mkN3 : N -> Prep -> Prep -> N3 ;- +
In some cases, you may want to make a complex CN into a
@@ -222,13 +210,14 @@ relational noun (e.g. the old town hall of). However, N2 and
N3 are purely lexical categories. But you can use the AdvCN
and PrepNP constructions to build phrases like this.
Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's + mkPN : Str -> Gender -> PN ; -- Paris neutrum + regPN : Str -> PN ; -- utrum gender
@@ -246,7 +235,7 @@ genitive, you can use the worst-case function. mkNP : Str -> Str -> Number -> Gender -> NP ;
- +Non-comparison one-place adjectives need three forms: @@ -269,13 +258,13 @@ In most cases, two forms are enough. mk2A : (stor,stort : Str) -> A ;
- +Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ; + mkA2 : A -> Prep -> A2 ;
@@ -316,7 +305,7 @@ long adjective, the following pattern is used: compoundA : A -> A ; -- -/mer/mest norsk
- +Adverbs are not inflected. Most lexical ones have position @@ -334,16 +323,7 @@ Adverbs modifying adjectives and sentences can also be formed. mkAdA : Str -> AdA ;
- --A preposition is just a string. -
-- mkPreposition : Str -> Preposition ; -- - +
The worst case needs six forms. @@ -374,7 +354,7 @@ In practice, it is enough to give three forms, as in school books. irregV : (drikke, drakk, drukket : Str) -> V ;
- +By default, the auxiliary is have. This function changes it to være. @@ -383,7 +363,7 @@ By default, the auxiliary is have. This function changes it to v vaereV : V -> V ;
- +The particle, such as in switch on, is given as a string. @@ -392,7 +372,7 @@ The particle, such as in switch on, is given as a string. partV : V -> Str -> V ;
- +Some words are used in passive forms only, e.g. hoppas, some as @@ -403,31 +383,31 @@ reflexive e.g. 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 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
-
+
Three-place (ditransitive) verbs need two prepositions, of which the first one or both can be absent.
- mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
- dirV3 : V -> Str -> V3 ; -- give,_,to
+ 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, @@ -436,18 +416,18 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
@@ -461,12 +441,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsEng.html b/lib/resource-1.0/doc/gfdoc/ParadigmsEng.html index 8d3ba8d24..884d264fa 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsEng.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsEng.html @@ -2,63 +2,50 @@ +-Author: -Last update: Tue Jun 13 11:42:42 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../abstract:../../prelude:../common -
- -Aarne Ranta 2003--2005
@@ -97,7 +84,7 @@ The following modules are presupposed: in {
- +To abstract over gender names, we define the following identifiers. @@ -133,12 +120,9 @@ To abstract over case names, we define the following.
Prepositions are used in many-argument functions for rection.
+The resource category Prep is used.
- Preposition : Type ; -- - +
Worst case: give all four forms and the semantic gender. @@ -172,7 +156,7 @@ function: genderN : Gender -> N -> N ;
- +A compound noun ia an uninflected string attached to an inflected noun, @@ -182,13 +166,13 @@ such as baby boom, chief executive officer. compoundN : Str -> N -> N ;
- +Relational nouns (daughter of x) need a preposition.
- mkN2 : N -> Preposition -> N2 ; + mkN2 : N -> Prep -> N2 ;
@@ -200,34 +184,35 @@ shortcut for regular relational nouns with of.
-Use the function mkPreposition or see the section on prepositions below to
+Use the function mkPrep or see the section on prepositions below to
form other prepositions.
Three-place relational nouns (the connection from x to y) need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ; + mkN3 : N -> Prep -> Prep -> N3 ;- +
In some cases, you may want to make a complex CN into a
relational noun (e.g. the old town hall of).
- cnN2 : CN -> Preposition -> N2 ; - cnN3 : CN -> Preposition -> Preposition -> N3 ; + cnN2 : CN -> Prep -> N2 ; + cnN3 : CN -> Prep -> Prep -> N3 ;- +
Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's + regPN : Str -> PN ; + regGenPN : Str -> Gender -> PN ; -- John, John's
@@ -245,7 +230,7 @@ genitive, you can use the worst-case function. mkNP : Str -> Str -> Number -> Gender -> NP ;
- +Non-comparison one-place adjectives need two forms: one for @@ -263,13 +248,13 @@ even for cases with the variation happy - happily. regA : Str -> A ;
- +Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ; + mkA2 : A -> Prep -> A2 ;
@@ -313,7 +298,7 @@ From a given ADeg, it is possible to get back to A.
adegA : ADeg -> A ;
Adverbs are not inflected. Most lexical ones have position @@ -331,21 +316,21 @@ 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 PPs in the resource API, just requires a string.
- mkPreposition : Str -> Preposition ; - mkPrep : Str -> Prep ; + mkPrep : Str -> Prep ; + noPrep : Prep ;
(These two functions are synonyms.)
- +Except for be, the worst case needs five forms: the infinitive and @@ -384,7 +369,7 @@ duplication in the present participle. irregDuplV : (get, got, gotten : Str) -> V ;
- +The particle, such as in switch on, is given as a string. @@ -393,7 +378,7 @@ The particle, such as in switch on, is given as a string. partV : V -> Str -> V ;
- +By default, verbs are not reflexive; this function makes them that. @@ -402,31 +387,31 @@ 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 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
-
+
Three-place (ditransitive) verbs need two prepositions, of which the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about - dirV3 : V -> Preposition -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- give,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about + dirV3 : V -> Prep -> V3 ; -- give,_,to + dirdirV3 : V -> V3 ; -- give,_,_- +
Verbs and adjectives can take complements such as sentences, @@ -435,18 +420,18 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
@@ -460,12 +445,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsFin.html b/lib/resource-1.0/doc/gfdoc/ParadigmsFin.html index f7922bc5a..dd81e3919 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsFin.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsFin.html @@ -2,48 +2,36 @@ +-Author: -Last update: Tue Jun 13 11:42:42 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../abstract:../common:../../prelude -
- -Aarne Ranta 2003--2005
@@ -89,7 +77,7 @@ flags optimize=all ; flags optimize=noexpand ;
- +To abstract over gender, number, and (some) case names, @@ -129,7 +117,7 @@ just a case, or a pre/postposition and a case. casePrep : Case -> Prep ; -- adessive
- +The worst case gives ten forms and the semantic gender. @@ -325,11 +313,12 @@ Proper names can be formed by using declensions for nouns. The plural forms are filtered away by the compiler.
+ regPN : Str -> PN ;
mkPN : N -> PN ;
mkNP : N -> Number -> NP ;
-
+
Non-comparison one-place adjectives are just like nouns.
@@ -361,7 +350,7 @@ The regular adjectives are based on regN in the positive.
regA : (punainen : Str) -> A ;
The grammar does not cover the potential mood and some nominal
@@ -467,7 +456,7 @@ But this is taken care of by ClauseFin.
dirV2 : V -> V2 ;
Three-place (ditransitive) verbs need two prepositions, of which @@ -479,7 +468,7 @@ the first one or both can be absent. dirdirV3 : V -> V3 ; -- acc, allat
- +
Verbs and adjectives can take complements such as sentences,
@@ -513,10 +502,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsFre.html b/lib/resource-1.0/doc/gfdoc/ParadigmsFre.html index 51c1b1fc6..58847f94f 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsFre.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsFre.html @@ -2,61 +2,48 @@ +-Author: -Last update: Tue Jun 13 11:42:43 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../romance:../common:../abstract:../../prelude -
- -Aarne Ranta 2003
@@ -96,7 +83,7 @@ words. flags optimize=all ;
- +To abstract over gender names, we define the following identifiers. @@ -126,16 +113,14 @@ amalgamate with the following word (the 'genitive' de and the 'dative' à).
- Preposition : Type ;
+ accusative : Prep ;
+ genitive : Prep ;
+ dative : Prep ;
- accusative : Preposition ;
- genitive : Preposition ;
- dative : Preposition ;
-
- mkPreposition : Str -> Preposition ;
+ mkPrep : Str -> Prep ;
-
+
Worst case: give both two forms and the gender. @@ -165,7 +150,7 @@ Adding gender information widens the scope of the foregoing function. regGenN : Str -> Gender -> N ;
- +Some nouns are ones where the first part is inflected as a noun but @@ -177,13 +162,13 @@ they are frequent in lexica. compN : N -> Str -> N ;
- +Relational nouns (fille de x) need a case and a preposition.
- mkN2 : N -> Preposition -> N2 ; + mkN2 : N -> Prep -> N2 ;
@@ -199,10 +184,10 @@ with the empty preposition. Three-place relational nouns (la connection de x à y) need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ; + mkN3 : N -> Prep -> Prep -> N3 ;- +
In some cases, you may want to make a complex CN into a
@@ -210,13 +195,15 @@ relational noun (e.g. the old town hall of). However, N2 and
N3 are purely lexical categories. But you can use the AdvCN
and PrepNP constructions to build phrases like this.
Proper names need a string and a gender.
- mkPN : Str -> Gender -> PN ; -- Jean + mkPN : Str -> Gender -> PN ; -- Jean + + regPN : Str -> PN ; -- masculine
@@ -227,7 +214,7 @@ you can use the worst-case function. mkNP : Str -> Gender -> Number -> NP ;
- +Non-comparison one-place adjectives need four forms in the worst @@ -258,16 +245,16 @@ provided. prefA : A -> A ;
- +Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ; + mkA2 : A -> Prep -> A2 ;- +
Comparison adjectives are in the worst case put up from two @@ -293,7 +280,7 @@ provided. prefA : A -> A ;
- +Adverbs are not inflected. Most lexical ones have position @@ -317,7 +304,7 @@ Adverbs modifying adjectives and sentences can also be formed. mkAdA : Str -> AdA ;
- +
Irregular verbs are given in the module VerbsFre.
@@ -354,14 +341,14 @@ To change it to
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 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -373,19 +360,19 @@ You can reuse a V2 verb in V.
v2V : V2 -> V ;
-
+
Three-place (ditransitive) verbs need two prepositions, of which the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à, de - dirV3 : V -> Preposition -> V3 ; -- donner,_,à - dirdirV3 : V -> V3 ; -- donner,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- parler, à, de + dirV3 : V -> Prep -> V3 ; -- donner,_,à + dirdirV3 : V -> V3 ; -- donner,_,_- +
Verbs and adjectives can take complements such as sentences, @@ -394,20 +381,20 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Preposition -> V2S ;
+ 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"
- mkV2V : V -> Preposition -> Preposition -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Preposition -> Preposition -> V2A ;
+ mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Preposition -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Preposition -> A2S ;
- mkAV : A -> Preposition -> AV ;
- mkA2V : A -> Preposition -> Preposition -> A2V ;
+ mkA2S : A -> Prep -> A2S ;
+ mkAV : A -> Prep -> AV ;
+ mkA2V : A -> Prep -> Prep -> A2V ;
@@ -421,12 +408,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsGer.html b/lib/resource-1.0/doc/gfdoc/ParadigmsGer.html index ef042f885..e10d4a88b 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsGer.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsGer.html @@ -2,55 +2,42 @@ +-Author: -Last update: Tue Jun 13 11:42:43 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../common:../abstract:../../prelude -
- -Aarne Ranta & Harald Hammarström 2003--2006
@@ -86,7 +73,7 @@ words. in {
- +To abstract over gender names, we define the following identifiers. @@ -122,7 +109,7 @@ To abstract over number names, we define the following. plural : Number ;
- +Worst case: give all four singular forms, two plural forms (others + dative), @@ -172,7 +159,7 @@ Three-place relational nouns (die Verbindung von x nach y) need two prepo mkN3 : N -> Prep -> Prep -> N3 ;
- +Proper names, with a regular genitive, are formed as follows @@ -183,7 +170,7 @@ The regular genitive is s, omitted after s. regPN : (Johann : Str) -> PN ; -- Johann, Johanns ; Johannes, Johannes
- +Adjectives need three forms, one for each degree. @@ -214,7 +201,7 @@ Two-place adjectives are formed by adding a preposition to an adjective. mkA2 : A -> Prep -> A2 ;
- +Adverbs are just strings. @@ -223,7 +210,7 @@ Adverbs are just strings. mkAdv : Str -> Adv ;
- +A preposition is formed from a string and a case. @@ -249,7 +236,7 @@ A couple of common prepositions (always with the dative). zu_Prep : Prep ;
- +The worst-case constructor needs six forms: @@ -312,7 +299,7 @@ Reflexive verbs can take reflexive pronouns of different cases. reflV : V -> Case -> V ;
- +Two-place verbs need a preposition, except the special case with direct object @@ -325,7 +312,7 @@ Two-place verbs need a preposition, except the special case with direct object datV2 : V -> V2 ;
- +Three-place (ditransitive) verbs need two prepositions, of which @@ -337,7 +324,7 @@ the first one or both can be absent. accdatV3 : V -> V3 ; -- give,_,_
- +
Verbs and adjectives can take complements such as sentences,
@@ -371,12 +358,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsIta.html b/lib/resource-1.0/doc/gfdoc/ParadigmsIta.html index a81f78bc2..1b9280609 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsIta.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsIta.html @@ -2,61 +2,48 @@ +-Author: -Last update: Tue Jun 13 11:42:43 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../romance:../common:../abstract:../../prelude -
- -Aarne Ranta 2003
@@ -97,7 +84,7 @@ words. flags optimize=all ;
- +To abstract over gender names, we define the following identifiers. @@ -127,16 +114,16 @@ amalgamate with the following word (the 'genitive' de and the 'dative' à).
- Preposition : Type ;
+ Prep : Type ;
- accusative : Preposition ;
- genitive : Preposition ;
- dative : Preposition ;
+ accusative : Prep ;
+ genitive : Prep ;
+ dative : Prep ;
- mkPreposition : Str -> Preposition ;
+ mkPrep : Str -> Prep ;
-
+
Worst case: give both two forms and the gender. @@ -163,7 +150,7 @@ To force a different gender, use one of the following functions. femN : N -> N ;
- +Some nouns are ones where the first part is inflected as a noun but @@ -175,13 +162,13 @@ they are frequent in lexica. compN : N -> Str -> N ;
- +Relational nouns (figlio di x) need a case and a preposition.
- mkN2 : N -> Preposition -> N2 ; + mkN2 : N -> Prep -> N2 ;
@@ -197,10 +184,10 @@ with the empty preposition. Three-place relational nouns (la connessione di x a y) need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ; + mkN3 : N -> Prep -> Prep -> N3 ;- +
In some cases, you may want to make a complex CN into a
@@ -208,13 +195,14 @@ relational noun (e.g. the old town hall of). However, N2 and
N3 are purely lexical categories. But you can use the AdvCN
and PrepNP constructions to build phrases like this.
Proper names need a string and a gender.
- mkPN : Str -> Gender -> PN ; -- Jean + mkPN : Str -> Gender -> PN ; + regPN : Str -> PN ; -- masculine
@@ -225,7 +213,7 @@ you can use the worst-case function. mkNP : Str -> Gender -> Number -> NP ;
- +Non-comparison one-place adjectives need five forms in the worst @@ -253,16 +241,16 @@ provided. prefA : A -> A ;
- +Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ; + mkA2 : A -> Prep -> A2 ;- +
Comparison adjectives are in the worst case put up from two @@ -288,7 +276,7 @@ with comparison by plus. regADeg : Str -> A ;
- +Adverbs are not inflected. Most lexical ones have position @@ -312,7 +300,7 @@ Adverbs modifying adjectives and sentences can also be formed. mkAdA : Str -> AdA ;
- +Regular verbs are ones with the infinitive er or ir, the @@ -343,14 +331,14 @@ Reflexive implies essere. 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 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -362,19 +350,19 @@ You can reuse a V2 verb in V.
v2V : V2 -> V ;
-
+
Three-place (ditransitive) verbs need two prepositions, of which the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à, de - dirV3 : V -> Preposition -> V3 ; -- donner,_,à - dirdirV3 : V -> V3 ; -- donner,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- parlare, a, di + dirV3 : V -> Prep -> V3 ; -- dare,_,a + dirdirV3 : V -> V3 ; -- dare,_,_- +
Verbs and adjectives can take complements such as sentences, @@ -383,20 +371,20 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Preposition -> V2S ;
- mkVV : V -> VV ; -- plain infinitive: "je veux parler"
- deVV : V -> VV ; -- "j'essaie de parler"
- aVV : V -> VV ; -- "j'arrive à parler"
- mkV2V : V -> Preposition -> Preposition -> V2V ;
+ mkV2S : V -> Prep -> V2S ;
+ mkVV : V -> VV ; -- plain infinitive: "voglio parlare"
+ deVV : V -> VV ; -- "cerco di parlare"
+ aVV : V -> VV ; -- "arrivo a parlare"
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Preposition -> Preposition -> V2A ;
+ mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Preposition -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Preposition -> A2S ;
- mkAV : A -> Preposition -> AV ;
- mkA2V : A -> Preposition -> Preposition -> A2V ;
+ mkA2S : A -> Prep -> A2S ;
+ mkAV : A -> Prep -> AV ;
+ mkA2V : A -> Prep -> Prep -> A2V ;
@@ -410,12 +398,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsNor.html b/lib/resource-1.0/doc/gfdoc/ParadigmsNor.html index 9608ffdb5..22f67f436 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsNor.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsNor.html @@ -2,64 +2,50 @@ +-Author: -Last update: Tue Jun 13 11:42:43 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../scandinavian:../common:../abstract:../../prelude -
- -Aarne Ranta 2003
@@ -97,7 +83,7 @@ words. CatNor in {
- +To abstract over gender names, we define the following identifiers. @@ -135,10 +121,11 @@ To abstract over case names, we define the following. Prepositions used in many-argument functions are just strings.
- Preposition : Type = Str ; + mkPrep : Str -> Prep ; + noPrep : Prep ; -- empty string- +
Worst case: give all four forms. The gender is computed from the @@ -174,19 +161,19 @@ gender is computed from the definite form. mk2N : (bil,bilen : Str) -> N ;
- +All the functions above work quite as well to form compound nouns, such as fotboll.
- +Relational nouns (daughter of x) need a preposition.
- mkN2 : N -> Preposition -> N2 ; + mkN2 : N -> Prep -> N2 ;
@@ -198,17 +185,17 @@ shortcut for regular, nonhuman relational nouns with av.
-Use the function mkPreposition or see the section on prepositions below to
+Use the function mkPrep or see the section on prepositions below to
form other prepositions.
Three-place relational nouns (the connection from x to y) need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ; + mkN3 : N -> Prep -> Prep -> N3 ;- +
In some cases, you may want to make a complex CN into a
@@ -216,13 +203,14 @@ relational noun (e.g. the old town hall of). However, N2 and
N3 are purely lexical categories. But you can use the AdvCN
and PrepNP constructions to build phrases like this.
Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's + regPN : Str -> PN ; -- utrum + regGenPN : Str -> Gender -> PN ;
@@ -240,7 +228,7 @@ genitive, you can use the worst-case function. mkNP : Str -> Str -> Number -> Gender -> NP ;
- +Non-comparison one-place adjectives need three forms: @@ -263,13 +251,13 @@ In most cases, two forms are enough. mk2A : (stor,stort : Str) -> A ;
- +Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ; + mkA2 : A -> Prep -> A2 ;
@@ -310,7 +298,7 @@ long adjective, the following pattern is used: compoundA : A -> A ; -- -/mer/mest norsk
- +Adverbs are not inflected. Most lexical ones have position @@ -328,16 +316,7 @@ Adverbs modifying adjectives and sentences can also be formed. mkAdA : Str -> AdA ;
- --A preposition is just a string. -
-- mkPreposition : Str -> Preposition ; -- - +
The worst case needs six forms. @@ -368,7 +347,7 @@ In practice, it is enough to give three forms, as in school books. irregV : (drikke, drakk, drukket : Str) -> V ;
- +By default, the auxiliary is have. This function changes it to være. @@ -377,7 +356,7 @@ By default, the auxiliary is have. This function changes it to v vaereV : V -> V ;
- +The particle, such as in switch on, is given as a string. @@ -386,7 +365,7 @@ The particle, such as in switch on, is given as a string. partV : V -> Str -> V ;
- +Some words are used in passive forms only, e.g. hoppas, some as @@ -397,31 +376,31 @@ reflexive e.g. 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 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
-
+
Three-place (ditransitive) verbs need two prepositions, of which the first one or both can be absent.
- mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about - dirV3 : V -> Str -> V3 ; -- give,_,to - dirdirV3 : V -> V3 ; -- give,_,_ + mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about + dirV3 : V -> Prep -> V3 ; -- give,_,to + dirdirV3 : V -> V3 ; -- give,_,_- +
Verbs and adjectives can take complements such as sentences, @@ -430,18 +409,18 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
@@ -455,12 +434,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-The definitions should not bother the user of the API. So they are -hidden from the document. -
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsRus.html b/lib/resource-1.0/doc/gfdoc/ParadigmsRus.html index 97d85fbfa..db97b8cd4 100644 --- a/lib/resource-1.0/doc/gfdoc/ParadigmsRus.html +++ b/lib/resource-1.0/doc/gfdoc/ParadigmsRus.html @@ -2,45 +2,33 @@ +-Author: -Last update: Tue Jun 13 11:42:43 2006 -
-Produced by gfdoc - a rudimentary GF document generator. (c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-== -
--# -path=.:../abstract:../../prelude:../common -
- -Janna Khegai 2003--2005
@@ -82,7 +70,7 @@ The following modules are presupposed: flags coding=utf8 ;
- +To abstract over gender names, we define the following identifiers. @@ -122,7 +110,7 @@ To abstract over number names, we define the following. plural : Number ;
- +Best case: indeclinabe nouns: кофе, пальто, ВУЗ. @@ -221,6 +209,7 @@ Proper names.
mkPN : Str -> Gender -> Animacy -> PN ; -- "Иван", "Маша"
+ regPN : Str -> PN ;
nounPN : N -> PN ;
@@ -233,7 +222,7 @@ On the top level, it is maybe CN that is used rather than N
mkNP : Str -> Gender -> Animacy -> NP ;
-
+
Adjectives
Non-comparison (only positive degree) one-place adjectives need 28 (4 by 7)
@@ -297,7 +286,7 @@ On top level, there are adjectival phrases. The most common case is
just to use a one-place adjective.
ap : A -> IsPostfixAdj -> AP ;
-
+
Adverbs
Adverbs are not inflected. Most lexical ones have position
@@ -307,7 +296,7 @@ after the verb. Some can be preverbal (e.g. always).
mkAdv : Str -> Adv ;
-
+
Verbs
In our lexicon description (Verbum) there are 62 forms:
@@ -395,10 +384,6 @@ a particle can be included in a V.
tvDirDir : V -> V3 ;
-
-The definitions should not bother the user of the API. So they are
-hidden from the document.
-
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsSpa.html b/lib/resource-1.0/doc/gfdoc/ParadigmsSpa.html
index f4ea81d39..7374df770 100644
--- a/lib/resource-1.0/doc/gfdoc/ParadigmsSpa.html
+++ b/lib/resource-1.0/doc/gfdoc/ParadigmsSpa.html
@@ -2,61 +2,48 @@
+ Spanish Lexical Paradigms
+ Spanish Lexical Paradigms
+Last update: 2006-06-15 16:29:51 CEST
-
- - Spanish Lexical Paradigms
- - Parameters
-
- Nouns
+
- Parameters
+
- Nouns
-
- Adjectives
+
- Adjectives
-
- Adverbs
-
- Verbs
+
- Adverbs
+
- Verbs
-
- The definitions of the paradigms
-
-Author:
-Last update: Tue Jun 13 11:42:43 2006
-
-
Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-==
-
-
-# -path=.:../romance:../common:../abstract:../../prelude
-
-
-Spanish Lexical Paradigms
-
Aarne Ranta 2003
@@ -94,7 +81,7 @@ escape to construct the most irregular words of type C.
flags optimize=all ;
-
+
Parameters
To abstract over gender names, we define the following identifiers.
@@ -124,16 +111,16 @@ amalgamate with the following word (the 'genitive' de and the
'dative' à).
- Preposition : Type ;
+ Prep : Type ;
- accusative : Preposition ;
- genitive : Preposition ;
- dative : Preposition ;
+ accusative : Prep ;
+ genitive : Prep ;
+ dative : Prep ;
- mkPreposition : Str -> Preposition ;
+ mkPrep : Str -> Prep ;
-
+
Nouns
Worst case: two forms (singular + plural),
@@ -164,7 +151,7 @@ To force a different gender, use one of the following functions.
femN : N -> N ;
-
+
Compound nouns
Some nouns are ones where the first part is inflected as a noun but
@@ -176,13 +163,13 @@ they are frequent in lexica.
compN : N -> Str -> N ;
-
+
Relational nouns
Relational nouns (fille de x) need a case and a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
@@ -198,10 +185,10 @@ with the empty preposition.
Three-place relational nouns (la connessione di x a y) need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
-
+
Relational common noun phrases
In some cases, you may want to make a complex CN into a
@@ -209,13 +196,14 @@ relational noun (e.g. the old town hall of). However, N2 and
N3 are purely lexical categories. But you can use the AdvCN
and PrepNP constructions to build phrases like this.
-
+
Proper names and noun phrases
Proper names need a string and a gender.
- mkPN : Str -> Gender -> PN ; -- Jean
+ mkPN : Str -> Gender -> PN ; -- Jean
+ regPN : Str -> PN ; -- masculine
@@ -226,7 +214,7 @@ you can use the worst-case function.
mkNP : Str -> Gender -> Number -> NP ;
-
+
Adjectives
Non-comparison one-place adjectives need five forms in the worst
@@ -255,16 +243,16 @@ provided.
prefA : A -> A ;
-
+
Two-place adjectives
Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
-
+
Comparison adjectives
Comparison adjectives are in the worst case put up from two
@@ -290,7 +278,7 @@ with comparison by mas.
regADeg : Str -> A ;
-
+
Adverbs
Adverbs are not inflected. Most lexical ones have position
@@ -314,7 +302,7 @@ Adverbs modifying adjectives and sentences can also be formed.
mkAdA : Str -> AdA ;
-
+
Verbs
Regular verbs are ones inflected like cortar, deber, or vivir.
@@ -350,14 +338,14 @@ in masculine singular form as second argument.
special_ppV : V -> Str -> V ;
-
+
Two-place verbs
Two-place verbs need a preposition, except the special case with direct object.
(transitive verbs). Notice that a particle comes from the V.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -369,19 +357,19 @@ You can reuse a V2 verb in V.
v2V : V2 -> V ;
-
+
Three-place verbs
Three-place (ditransitive) verbs need two prepositions, of which
the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à, de
- dirV3 : V -> Preposition -> V3 ; -- donner,_,à
- dirdirV3 : V -> V3 ; -- donner,_,_
+ mkV3 : V -> Prep -> Prep -> V3 ; -- parler, à, de
+ dirV3 : V -> Prep -> V3 ; -- donner,_,à
+ dirdirV3 : V -> V3 ; -- donner,_,_
-
+
Other complement patterns
Verbs and adjectives can take complements such as sentences,
@@ -390,20 +378,20 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Preposition -> V2S ;
+ 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"
- mkV2V : V -> Preposition -> Preposition -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Preposition -> Preposition -> V2A ;
+ mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Preposition -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Preposition -> A2S ;
- mkAV : A -> Preposition -> AV ;
- mkA2V : A -> Preposition -> Preposition -> A2V ;
+ mkA2S : A -> Prep -> A2S ;
+ mkAV : A -> Prep -> AV ;
+ mkA2V : A -> Prep -> Prep -> A2V ;
@@ -417,12 +405,6 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-
-The definitions of the paradigms
-
-The definitions should not bother the user of the API. So they are
-hidden from the document.
-
diff --git a/lib/resource-1.0/doc/gfdoc/ParadigmsSwe.html b/lib/resource-1.0/doc/gfdoc/ParadigmsSwe.html
index 662e80424..8e2cf1565 100644
--- a/lib/resource-1.0/doc/gfdoc/ParadigmsSwe.html
+++ b/lib/resource-1.0/doc/gfdoc/ParadigmsSwe.html
@@ -2,63 +2,50 @@
+ Swedish Lexical Paradigms
+ Swedish Lexical Paradigms
+Last update: 2006-06-15 16:03:55 CEST
-
- - Swedish Lexical Paradigms
- - Parameters
-
- Nouns
+
- Parameters
+
- Nouns
-
- Adjectives
+
- Adjectives
-
- Adverbs
-
- Prepositions
-
- Verbs
+
- Adverbs
+
- Verbs
-
- Definitions of the paradigms
+
- Definitions of the paradigms
-
-Author:
-Last update: Tue Jun 13 11:42:44 2006
-
-
Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-==
-
-
-# -path=.:../scandinavian:../common:../abstract:../../prelude
-
-
-Swedish Lexical Paradigms
-
Aarne Ranta 2003
@@ -96,7 +83,7 @@ words.
CatSwe in {
-
+
Parameters
To abstract over gender names, we define the following identifiers.
@@ -133,10 +120,11 @@ To abstract over case names, we define the following.
Prepositions used in many-argument functions are just strings.
- Preposition : Type = Str ;
+ mkPrep : Str -> Prep ;
+ noPrep : Prep ; -- empty string
-
+
Nouns
Worst case: give all four forms. The gender is computed from the
@@ -179,19 +167,19 @@ It does not work if there are changes in the stem.
mk1N : (bilarna : Str) -> N ;
-
+
Compound nouns
All the functions above work quite as well to form compound nouns,
such as fotboll.
-
+
Relational nouns
Relational nouns (daughter of x) need a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
@@ -210,10 +198,10 @@ form other prepositions.
Three-place relational nouns (the connection from x to y) need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
-
+
Relational common noun phrases
In some cases, you may want to make a complex CN into a
@@ -221,13 +209,14 @@ relational noun (e.g. the old town hall of). However, N2 and
N3 are purely lexical categories. But you can use the AdvCN
and PrepNP constructions to build phrases like this.
-
+
Proper names and noun phrases
Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's
+ regGenPN : Str -> Gender -> PN ;
+ regPN : Str -> PN ; -- utrum
@@ -245,7 +234,7 @@ genitive, you can use the worst-case function.
mkNP : Str -> Str -> Number -> Gender -> NP ;
-
+
Adjectives
Adjectives may need as many as seven forms.
@@ -284,16 +273,16 @@ Comparison forms may be compound (mera svensk - mest svensk).
compoundA : A -> A ;
-
+
Two-place adjectives
Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
-
+
Adverbs
Adverbs are not inflected. Most lexical ones have position
@@ -311,16 +300,7 @@ Adverbs modifying adjectives and sentences can also be formed.
mkAdA : Str -> AdA ;
-
-Prepositions
-
-A preposition is just a string.
-
-
- mkPreposition : Str -> Preposition ;
-
-
-
+
Verbs
The worst case needs five forms.
@@ -358,7 +338,7 @@ In practice, it is enough to give three forms, as in school books.
irregV : (dricka, drack, druckit : Str) -> V ;
-
+
Verbs with a particle.
The particle, such as in passa på, is given as a string.
@@ -367,7 +347,7 @@ The particle, such as in passa p
partV : V -> Str -> V ;
-
+
Deponent verbs.
Some words are used in passive forms only, e.g. hoppas, some as
@@ -378,31 +358,31 @@ reflexive e.g.
reflV : V -> V ;
-
+
Two-place verbs
Two-place verbs need a preposition, except the special case with direct object.
(transitive verbs). Notice that a particle comes from the V.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
-
+
Three-place verbs
Three-place (ditransitive) verbs need two prepositions, of which
the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- tala med om
- dirV3 : V -> Preposition -> V3 ; -- ge _ till
+ mkV3 : V -> Prep -> Prep -> V3 ; -- tala med om
+ dirV3 : V -> Prep -> V3 ; -- ge _ till
dirdirV3 : V -> V3 ; -- ge _ _
-
+
Other complement patterns
Verbs and adjectives can take complements such as sentences,
@@ -411,18 +391,18 @@ questions, verb phrases, and adjectives.
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
@@ -436,7 +416,7 @@ as an adverb. Likewise AS, A2S, AV, A2V are just A.
AS, A2S, AV, A2V : Type ;
-
+
Definitions of the paradigms
The definitions should not bother the user of the API. So they are
diff --git a/lib/resource-1.0/doc/gfdoc/Phrase.html b/lib/resource-1.0/doc/gfdoc/Phrase.html
index 7102c652d..bc9bae55d 100644
--- a/lib/resource-1.0/doc/gfdoc/Phrase.html
+++ b/lib/resource-1.0/doc/gfdoc/Phrase.html
@@ -2,21 +2,16 @@
- Phrases and utterances
+ Phrase: Phrases and Utterances
- Phrases and utterances
+ Phrase: Phrases and Utterances
-Author:
-Last update: Tue Jun 13 11:42:40 2006
+Last update: 2006-06-15 09:19:39 CEST
-
-
@@ -25,8 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Phrases and utterances
abstract Phrase = Cat ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Precedence.html b/lib/resource-1.0/doc/gfdoc/Precedence.html
index 378255b77..63b421529 100644
--- a/lib/resource-1.0/doc/gfdoc/Precedence.html
+++ b/lib/resource-1.0/doc/gfdoc/Precedence.html
@@ -13,8 +13,7 @@
-Author:
-Last update: Tue Jun 13 11:42:45 2006
+Last update: 2005-11-23 09:16:18 CET
Produced by
@@ -22,9 +21,6 @@ gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-==
-
-
operations for precedence-dependent strings.
five levels:
p4 (constants), p3 (applications), p2 (products), p1 (sums), p0 (arrows)
diff --git a/lib/resource-1.0/doc/gfdoc/Predef.html b/lib/resource-1.0/doc/gfdoc/Predef.html
index 3256d722b..60a36d440 100644
--- a/lib/resource-1.0/doc/gfdoc/Predef.html
+++ b/lib/resource-1.0/doc/gfdoc/Predef.html
@@ -6,17 +6,12 @@
Predefined functions for concrete syntax
-Author:
-Last update: Tue Jun 13 11:42:45 2006
+Last update: 2006-02-27 09:41:31 CET
-
-
@@ -25,8 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Predefined functions for concrete syntax
The definitions of these constants are hard-coded in GF, and defined
in AppPredefined.hs. Applying
diff --git a/lib/resource-1.0/doc/gfdoc/PredefAbs.html b/lib/resource-1.0/doc/gfdoc/PredefAbs.html
index 393042e4c..8bd03dae2 100644
--- a/lib/resource-1.0/doc/gfdoc/PredefAbs.html
+++ b/lib/resource-1.0/doc/gfdoc/PredefAbs.html
@@ -13,17 +13,13 @@
-Author:
-Last update: Tue Jun 13 11:42:45 2006
+Last update: 2006-06-02 17:49:44 CEST
Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-==
-
abstract PredefAbs = {
cat Int ; String ; Float ;
diff --git a/lib/resource-1.0/doc/gfdoc/Predication.html b/lib/resource-1.0/doc/gfdoc/Predication.html
index a1c9022b7..3278694ac 100644
--- a/lib/resource-1.0/doc/gfdoc/Predication.html
+++ b/lib/resource-1.0/doc/gfdoc/Predication.html
@@ -6,24 +6,20 @@
A Small Predication Library
-Author:
-Last update: Tue Jun 13 11:42:44 2006
+Last update: 2006-02-28 09:26:58 CET
-
- - A Small Predication Library
- - The category of atomic sentences
-
- Predication patterns.
-
- Imperatives and infinitives.
-
- Individual-valued function applications
-
- Families of types
-
- Type constructor
+
- The category of atomic sentences
+
- Predication patterns.
+
- Imperatives and infinitives.
+
- Individual-valued function applications
+
- Families of types
+
- Type constructor
-
@@ -33,8 +29,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-A Small Predication Library
(c) Aarne Ranta 2003-2006 under Gnu GPL.
@@ -46,7 +40,7 @@ API of resource grammars.
abstract Predication = Cat ** {
-
+
The category of atomic sentences
We want to use sentences in positive and negative forms but do not care about
@@ -58,7 +52,7 @@ tenses.
NegCl : Cl -> S ; -- negative sentence: "x doesn't intersect y"
-
+
Predication patterns.
predV : V -> NP -> Cl ; -- one-place verb: "x converges"
@@ -76,14 +70,14 @@ tenses.
predPrep : Prep -> NP -> NP -> Cl ; -- preposition: "x is outside y"
-
+
Imperatives and infinitives.
impV2 : V2 -> NP -> Phr ; -- imperative: "solve the equation E"
infV2 : V2 -> NP -> Phr ; -- infinitive: "to solve the equation E"
-
+
Individual-valued function applications
appN2 : N2 -> NP -> NP ; -- one-place function: "the successor of x"
@@ -91,7 +85,7 @@ tenses.
appColl : N2 -> NP -> NP -> NP ; -- collective function: "the sum of x and y"
-
+
Families of types
These are expressed by relational nouns applied to arguments.
@@ -102,7 +96,7 @@ These are expressed by relational nouns applied to arguments.
famColl : N2 -> NP -> NP -> CN ; -- collective family: "path between x and y"
-
+
Type constructor
This is similar to a family except that the argument is a type.
diff --git a/lib/resource-1.0/doc/gfdoc/Prelude.html b/lib/resource-1.0/doc/gfdoc/Prelude.html
index f354cecbf..6f1bbde29 100644
--- a/lib/resource-1.0/doc/gfdoc/Prelude.html
+++ b/lib/resource-1.0/doc/gfdoc/Prelude.html
@@ -6,25 +6,21 @@
The GF Prelude
-Author:
-Last update: Tue Jun 13 11:42:46 2006
+Last update: 2006-02-27 09:41:31 CET
-
- - The GF Prelude
- - Strings, records, and tables
-
- Optional elements
-
- Infixes. prefixes, and postfixes
-
- Booleans
-
- High-level acces to Predef operations
-
- Lexer-related operations
-
- Miscellaneous
+
- Strings, records, and tables
+
- Optional elements
+
- Infixes. prefixes, and postfixes
+
- Booleans
+
- High-level acces to Predef operations
+
- Lexer-related operations
+
- Miscellaneous
-
@@ -34,8 +30,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-The GF Prelude
This file defines some prelude facilities usable in all grammars.
@@ -45,7 +39,7 @@ This file defines some prelude facilities usable in all grammars.
oper
-
+
Strings, records, and tables
SS : Type = {s : Str} ;
@@ -74,7 +68,7 @@ Discontinuous constituents.
sd2 : (_,_ : Str) -> SD2 = \x,y -> {s1 = x ; s2 = y} ;
-
+
Optional elements
Missing form.
@@ -106,7 +100,7 @@ Parametric order between two strings.
if_then_Str pr (x ++ y) (y ++ x) ;
-
+
Infixes. prefixes, and postfixes
Fixes with precedences are defined in Precedence.
@@ -118,7 +112,7 @@ Fixes with precedences are defined in Precedence.
embedSS : Str -> Str -> SS -> SS = \f,g,x -> ss (f ++ x.s ++ g) ;
-
+
Booleans
param Bool = True | False ;
@@ -154,7 +148,7 @@ Interface to internal booleans
last : Tok -> Tok = Predef.dp 1 ;
-
+
High-level acces to Predef operations
isNil : Tok -> Bool = \b -> pbool2bool (Predef.eqStr [] b) ;
@@ -163,7 +157,7 @@ Interface to internal booleans
case Predef.eqStr t u of {Predef.PTrue => a ; Predef.PFalse => b} ;
-
+
Lexer-related operations
Bind together two tokens in some lexers, either obligatorily or optionally
@@ -191,7 +185,7 @@ These should be hidden, and never changed since they are hardcoded in (un)lexers
CAPIT : Str = "&|" ;
-
+
Miscellaneous
Identity function
diff --git a/lib/resource-1.0/doc/gfdoc/Question.html b/lib/resource-1.0/doc/gfdoc/Question.html
index 2949564f7..5c0446cb2 100644
--- a/lib/resource-1.0/doc/gfdoc/Question.html
+++ b/lib/resource-1.0/doc/gfdoc/Question.html
@@ -2,21 +2,16 @@
- Questions and interrogative pronouns
+ Question: Questions and Interrogative Pronouns
- Questions and interrogative pronouns
+ Question: Questions and Interrogative Pronouns
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-06-15 09:19:39 CEST
-
-
@@ -25,8 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Questions and interrogative pronouns
abstract Question = Cat ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Relative.html b/lib/resource-1.0/doc/gfdoc/Relative.html
index 0b200ef37..1ea237386 100644
--- a/lib/resource-1.0/doc/gfdoc/Relative.html
+++ b/lib/resource-1.0/doc/gfdoc/Relative.html
@@ -6,17 +6,12 @@
Relative clauses and pronouns
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-01-25 12:10:58 CET
-
-
@@ -25,8 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Relative clauses and pronouns
abstract Relative = Cat ** {
diff --git a/lib/resource-1.0/doc/gfdoc/Sentence.html b/lib/resource-1.0/doc/gfdoc/Sentence.html
index 1faac79e3..2d2be7eed 100644
--- a/lib/resource-1.0/doc/gfdoc/Sentence.html
+++ b/lib/resource-1.0/doc/gfdoc/Sentence.html
@@ -2,27 +2,23 @@
- Sentences, clauses, imperatives, and sentential complements
+ Sentence: Sentences, Clauses, and Imperatives
- Sentences, clauses, imperatives, and sentential complements
+ Sentence: Sentences, Clauses, and Imperatives
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-06-15 09:19:39 CEST
-
@@ -32,13 +28,11 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Sentences, clauses, imperatives, and sentential complements
abstract Sentence = Cat ** {
-
+
Clauses
The NP VP predication rule form a clause whose linearization
@@ -59,7 +53,7 @@ is only meaningful for some verb phrases.
PredSCVP : SC -> VP -> Cl ; -- that you go makes me happy
-
+
Clauses missing object noun phrases
This category is a variant of the 'slash category' S/NP of
@@ -77,7 +71,7 @@ the style of CCG.
SlashPrep : Cl -> Prep -> Slash ; -- (with whom) he walks
-
+
Imperatives
An imperative is straightforwardly formed from a verb phrase.
@@ -88,7 +82,7 @@ To fix these parameters, see Phrase.
ImpVP : VP -> Imp ; -- go
-
+
Embedded sentences
Sentences, questions, and infinitival phrases can be used as
@@ -100,7 +94,7 @@ subjects and (adverbial) complements.
EmbedVP : VP -> SC ; -- to go
-
+
Sentences
These are the 2 x 4 x 4 = 16 forms generated by different
diff --git a/lib/resource-1.0/doc/gfdoc/Structural.html b/lib/resource-1.0/doc/gfdoc/Structural.html
index 32650aece..f7c9c8a96 100644
--- a/lib/resource-1.0/doc/gfdoc/Structural.html
+++ b/lib/resource-1.0/doc/gfdoc/Structural.html
@@ -2,21 +2,16 @@
- GF Resource Grammar API for Structural Words
+ Structural: Structural Words
- GF Resource Grammar API for Structural Words
+ Structural: Structural Words
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-06-15 09:19:39 CEST
-
-
@@ -25,11 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-GF Resource Grammar API for Structural Words
-
-AR 21/11/2003 -- 30/11/2005
-
Here we have some words belonging to closed classes and appearing
in all languages we have considered.
diff --git a/lib/resource-1.0/doc/gfdoc/Symbol.html b/lib/resource-1.0/doc/gfdoc/Symbol.html
index 7e071431c..5fef735c1 100644
--- a/lib/resource-1.0/doc/gfdoc/Symbol.html
+++ b/lib/resource-1.0/doc/gfdoc/Symbol.html
@@ -6,21 +6,17 @@
Symbolic expressions
-Author:
-Last update: Tue Jun 13 11:42:44 2006
+Last update: 2006-03-17 14:11:37 CET
-
@@ -30,8 +26,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Symbolic expressions
Note. This module is not automatically included in the main
grammar Lang.
@@ -40,7 +34,7 @@ grammar Lang.
abstract Symbol = Cat, PredefAbs ** {
-
+
Noun phrases with symbols and numbers
fun
@@ -52,13 +46,13 @@ grammar Lang.
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
-
+
Sentence consisting of a formula
SymbS : Symb -> S ; -- A
-
+
Symbol lists
A symbol list has at least two elements. The last two are separated
diff --git a/lib/resource-1.0/doc/gfdoc/Tense.html b/lib/resource-1.0/doc/gfdoc/Tense.html
index 511cb96e1..3ed4c71a7 100644
--- a/lib/resource-1.0/doc/gfdoc/Tense.html
+++ b/lib/resource-1.0/doc/gfdoc/Tense.html
@@ -6,17 +6,12 @@
Tense, Polarity, and Anteriority
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-02-27 09:41:31 CET
-
-
@@ -25,8 +20,6 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Tense, Polarity, and Anteriority
This module defines the abstract parameters of tense, polarity, and
anteriority, which are used in Tensed to generate different
diff --git a/lib/resource-1.0/doc/gfdoc/Text.html b/lib/resource-1.0/doc/gfdoc/Text.html
index 021306b6c..8ab03c9ec 100644
--- a/lib/resource-1.0/doc/gfdoc/Text.html
+++ b/lib/resource-1.0/doc/gfdoc/Text.html
@@ -2,21 +2,16 @@
- Texts
+ Text: Texts
- Texts
+ Text: Texts
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-06-15 09:19:39 CEST
-
- - Texts
-
-
@@ -25,16 +20,19 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-Texts
+
+Texts are built from an empty text by adding Phrases,
+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 ;
- TQuestMark : Phr -> Text -> Text ;
- TExclMark : Phr -> Text -> Text ;
+ TEmpty : Text ; --
+ TFullStop : Phr -> Text -> Text ; -- John walks. ...
+ TQuestMark : Phr -> Text -> Text ; -- Are you OK? ...
+ TExclMark : Phr -> Text -> Text ; -- John walks! ...
}
diff --git a/lib/resource-1.0/doc/gfdoc/Verb.html b/lib/resource-1.0/doc/gfdoc/Verb.html
index fcd773876..ce260bf76 100644
--- a/lib/resource-1.0/doc/gfdoc/Verb.html
+++ b/lib/resource-1.0/doc/gfdoc/Verb.html
@@ -6,22 +6,18 @@
The construction of verb phrases
-Author:
-Last update: Tue Jun 13 11:42:41 2006
+Last update: 2006-02-27 09:41:31 CET
-
@@ -31,13 +27,11 @@ Produced by
gfdoc - a rudimentary GF document generator.
(c) Aarne Ranta (aarne@cs.chalmers.se) 2002 under GNU GPL.
-
-The construction of verb phrases
abstract Verb = Cat ** {
-
+
Complementization rules
Verb phrases are constructed from verbs by providing their
@@ -57,7 +51,7 @@ complements. There is one rule for each verb category.
ComplV2A : V2A -> NP -> AP -> VP ; -- paint the house red
-
+
Other ways of forming verb phrases
Verb phrases can also be constructed reflexively and from
@@ -98,7 +92,7 @@ vs. next to (or before) the verb.
Agents of passives are constructed as adverbs with the
preposition Structural.8agent_Prep.
-
+
Complements to copula
Adjectival phrases, noun phrases, and adverbs can be used.
@@ -109,7 +103,7 @@ Adjectival phrases, noun phrases, and adverbs can be used.
CompAdv : Adv -> Comp ; -- (be) here
-
+
Coercions
Verbs can change subcategorization patterns in systematic ways,
diff --git a/lib/resource-1.0/english/LexiconEng.gf b/lib/resource-1.0/english/LexiconEng.gf
index b2d845ae5..7a85896cc 100644
--- a/lib/resource-1.0/english/LexiconEng.gf
+++ b/lib/resource-1.0/english/LexiconEng.gf
@@ -8,18 +8,18 @@ flags
lin
airplane_N = regN "airplane" ;
- answer_V2S = mkV2S (regV "answer") "to" ;
+ answer_V2S = mkV2S (regV "answer") toP ;
apartment_N = regN "apartment" ;
apple_N = regN "apple" ;
art_N = regN "art" ;
- ask_V2Q = mkV2Q (regV "ask") [] ;
+ ask_V2Q = mkV2Q (regV "ask") noPrep ;
baby_N = regN "baby" ;
bad_A = mkADeg "bad" "badly" "worse" "worst" ;
bank_N = regN "bank" ;
beautiful_A = regADeg "beautiful" ;
become_VA = mkVA (irregV "become" "became" "become") ;
beer_N = regN "beer" ;
- beg_V2V = mkV2V (regDuplV "beg") [] "to" ;
+ beg_V2V = mkV2V (regDuplV "beg") noPrep toP ;
big_A = duplADeg "big" ;
bike_N = regN "bike" ;
bird_N = regN "bird" ;
@@ -60,12 +60,12 @@ lin
cow_N = regN "cow" ;
die_V = (regV "die") ;
dirty_A = regADeg "dirty" ;
- distance_N3 = mkN3 (regN "distance") "from" "to" ;
+ distance_N3 = mkN3 (regN "distance") fromP toP ;
doctor_N = regN "doctor" ;
dog_N = regN "dog" ;
door_N = regN "door" ;
drink_V2 = dirV2 (irregV "drink" "drank" "drunk") ;
- easy_A2V = mkA2V (regA "easy") "for" ;
+ easy_A2V = mkA2V (regA "easy") forP ;
eat_V2 = dirV2 (irregV "eat" "ate" "eaten") ;
empty_A = regADeg "empty" ;
enemy_N = regN "enemy" ;
@@ -108,14 +108,14 @@ lin
leather_N = regN "leather" ;
leave_V2 = dirV2 (irregV "leave" "left" "left") ;
like_V2 = dirV2 (regV "like") ;
- listen_V2 = mkV2 (regV "listen") "to" ;
+ listen_V2 = mkV2 (regV "listen") toP ;
live_V = (regV "live") ;
long_A = regADeg "long" ;
lose_V2 = dirV2 (irregV "lose" "lost" "lost") ;
love_N = regN "love" ;
love_V2 = dirV2 (regV "love") ;
man_N = mk2N "man" "men" ;
- married_A2 = mkA2 (regA "married") "to" ;
+ married_A2 = mkA2 (regA "married") toP ;
meat_N = regN "meat" ;
milk_N = regN "milk" ;
moon_N = regN "moon" ;
@@ -128,9 +128,9 @@ lin
oil_N = regN "oil" ;
old_A = regADeg "old" ;
open_V2 = dirV2 (regV "open") ;
- paint_V2A = mkV2A (regV "paint") [] ;
+ paint_V2A = mkV2A (regV "paint") noPrep ;
paper_N = regN "paper" ;
- paris_PN = regPN "Paris" nonhuman ;
+ paris_PN = regPN "Paris" ;
peace_N = regN "peace" ;
pen_N = regN "pen" ;
planet_N = regN "planet" ;
@@ -157,8 +157,8 @@ lin
sea_N = regN "sea" ;
seek_V2 = dirV2 (irregV "seek" "sought" "sought") ;
see_V2 = dirV2 (irregV "see" "saw" "seen") ;
- sell_V3 = dirV3 (irregV "sell" "sold" "sold") "to" ;
- send_V3 = dirV3 (irregV "send" "sent" "sent") "to" ;
+ 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" ;
@@ -182,7 +182,7 @@ lin
switch8off_V2 = dirV2 (partV (regV "switch") "off") ;
switch8on_V2 = dirV2 (partV (regV "switch") "on") ;
table_N = regN "table" ;
- talk_V3 = mkV3 (regV "talk") "to" "about" ;
+ talk_V3 = mkV3 (regV "talk") toP aboutP ;
teacher_N = regN "teacher" ;
teach_V2 = dirV2 (irregV "teach" "taught" "taught") ;
television_N = regN "television" ;
@@ -196,7 +196,7 @@ lin
understand_V2 = dirV2 (irregV "understand" "understood" "understood") ;
university_N = regN "university" ;
village_N = regN "village" ;
- wait_V2 = mkV2 (regV "wait") "for" ;
+ wait_V2 = mkV2 (regV "wait") forP ;
walk_V = (regV "walk") ;
warm_A = regADeg "warm" ;
war_N = regN "war" ;
@@ -217,9 +217,9 @@ lin
now_Adv = mkAdv "now" ;
already_Adv = mkAdv "already" ;
song_N = regN "song" ;
- add_V3 = dirV3 (regV "add") "to" ;
+ add_V3 = dirV3 (regV "add") toP ;
number_N = regN "number" ;
- put_V2 = mkV2 (irregDuplV "put" "put" "put") [] ;
+ put_V2 = mkV2 (irregDuplV "put" "put" "put") noPrep ;
stop_V = regDuplV "stop" ;
jump_V = regV "jump" ;
@@ -311,7 +311,7 @@ lin
flow_V = regV "flow" ;
fly_V = fly_V ;
freeze_V = freeze_V ;
- give_V3 = dirV3 give_V "to" ;
+ give_V3 = dirV3 give_V toP ;
laugh_V = regV "laugh" ;
lie_V = lie_V ;
play_V = regV "play" ;
@@ -351,4 +351,13 @@ lin
-- other_A = regA "other" ;
+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/resource-1.0/english/ParadigmsEng.gf b/lib/resource-1.0/english/ParadigmsEng.gf
index 067b8bea8..226f6becb 100644
--- a/lib/resource-1.0/english/ParadigmsEng.gf
+++ b/lib/resource-1.0/english/ParadigmsEng.gf
@@ -58,8 +58,8 @@ oper
genitive : Case ;
-- Prepositions are used in many-argument functions for rection.
+-- The resource category $Prep$ is used.
- Preposition : Type ;
--2 Nouns
@@ -96,19 +96,19 @@ oper
--
-- Relational nouns ("daughter of x") need a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
-- The most common preposition is "of", and the following is a
-- shortcut for regular relational nouns with "of".
regN2 : Str -> N2 ;
--- Use the function $mkPreposition$ or see the section on prepositions below to
+-- Use the function $mkPrep$ or see the section on prepositions below to
-- form other prepositions.
--
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
--3 Relational common noun phrases
@@ -116,15 +116,16 @@ oper
-- In some cases, you may want to make a complex $CN$ into a
-- relational noun (e.g. "the old town hall of").
- cnN2 : CN -> Preposition -> N2 ;
- cnN3 : CN -> Preposition -> Preposition -> N3 ;
+ cnN2 : CN -> Prep -> N2 ;
+ cnN3 : CN -> Prep -> Prep -> N3 ;
--
--3 Proper names and noun phrases
--
-- Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's
+ regPN : Str -> PN ;
+ regGenPN : Str -> Gender -> PN ; -- John, John's
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
@@ -151,7 +152,7 @@ oper
--
-- Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
-- Comparison adjectives may two more forms.
@@ -197,8 +198,8 @@ oper
-- A preposition as used for rection in the lexicon, as well as to
-- build $PP$s in the resource API, just requires a string.
- mkPreposition : Str -> Preposition ;
- mkPrep : Str -> Prep ;
+ mkPrep : Str -> Prep ;
+ noPrep : Prep ;
-- (These two functions are synonyms.)
@@ -247,7 +248,7 @@ oper
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -256,9 +257,9 @@ oper
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- speak, with, about
- dirV3 : V -> Preposition -> V3 ; -- give,_,to
- dirdirV3 : V -> V3 ; -- give,_,_
+ mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
+ dirV3 : V -> Prep -> V3 ; -- give,_,to
+ dirdirV3 : V -> V3 ; -- give,_,_
--3 Other complement patterns
--
@@ -267,18 +268,18 @@ oper
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given
@@ -288,12 +289,11 @@ oper
V0, V2S, V2V, V2A, V2Q : Type ;
AS, A2S, AV, A2V : Type ;
-
+--.
--2 Definitions of paradigms
--
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
---.
Gender = MorphoEng.Gender ;
Number = MorphoEng.Number ;
@@ -307,7 +307,7 @@ oper
nominative = Nom ;
genitive = Gen ;
- Preposition = Str ;
+ Preposition : Type = Str ; -- obsolete
regN = \ray ->
let
@@ -345,13 +345,14 @@ oper
compoundN s n = {s = \\x,y => s ++ n.s ! x ! y ; g=n.g ; lock_N = <>} ;
- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
- regN2 n = mkN2 (regN n) (mkPreposition "of") ;
- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
- cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
- cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
+ mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
+ regN2 n = mkN2 (regN n) (mkPrep "of") ;
+ mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
+ cnN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
+ cnN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
- regPN n g = nameReg n g ** {lock_PN = <>} ;
+ regPN n = regGenPN n human ;
+ regGenPN n g = nameReg n g ** {lock_PN = <>} ;
nounPN n = {s = n.s ! singular ; g = n.g ; lock_PN = <>} ;
mkNP x y n g = {s = table {Gen => x ; _ => y} ; a = agrP3 n ;
lock_NP = <>} ;
@@ -359,7 +360,7 @@ oper
mkA a b = mkAdjective a a a b ** {lock_A = <>} ;
regA a = regAdjective a ** {lock_A = <>} ;
- mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
+ mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ;
ADeg = A ; ----
@@ -394,8 +395,8 @@ oper
mkAdV x = ss x ** {lock_AdV = <>} ;
mkAdA x = ss x ** {lock_AdA = <>} ;
- mkPreposition p = p ;
mkPrep p = ss p ** {lock_Prep = <>} ;
+ noPrep = mkPrep [] ;
mkV a b c d e = mkVerb a b c d e ** {s1 = [] ; lock_V = <>} ;
@@ -434,12 +435,12 @@ oper
partV v p = verbPart v p ** {lock_V = <>} ;
reflV v = {s = v.s ; part = v.part ; lock_V = v.lock_V ; isRefl = True} ;
- mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; lock_V2 = <>} ;
- dirV2 v = mkV2 v [] ;
+ mkV2 v p = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; lock_V2 = <>} ;
+ dirV2 v = mkV2 v noPrep ;
- mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p ; c3 = q ; lock_V3 = <>} ;
- dirV3 v p = mkV3 v [] p ;
- dirdirV3 v = dirV3 v [] ;
+ mkV3 v p q = v ** {s = v.s ; s1 = v.s1 ; c2 = p.s ; c3 = q.s ; lock_V3 = <>} ;
+ dirV3 v p = mkV3 v noPrep p ;
+ dirdirV3 v = dirV3 v noPrep ;
mkVS v = v ** {lock_VS = <>} ;
mkVV v = {
diff --git a/lib/resource-1.0/finnish/ParadigmsFin.gf b/lib/resource-1.0/finnish/ParadigmsFin.gf
index 0120d62e8..e297a6637 100644
--- a/lib/resource-1.0/finnish/ParadigmsFin.gf
+++ b/lib/resource-1.0/finnish/ParadigmsFin.gf
@@ -203,6 +203,7 @@ oper
-- Proper names can be formed by using declensions for nouns.
-- The plural forms are filtered away by the compiler.
+ regPN : Str -> PN ;
mkPN : N -> PN ;
mkNP : N -> Number -> NP ;
@@ -333,9 +334,9 @@ oper
V0, V2S, V2V, V2Q : Type ;
AS, A2S, AV, A2V : Type ;
+--.
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
---.
Case = MorphoFin.Case ;
Number = MorphoFin.Number ;
@@ -472,6 +473,7 @@ reg3N = \vesi,veden,vesi
mkN2 = \n,c -> n ** {c2 = c ; lock_N2 = <>} ;
mkN3 = \n,c,e -> n ** {c2 = c ; c3 = e ; lock_N3 = <>} ;
genN2 = \n -> mkN2 n (casePrep genitive) ;
+ regPN m = mkPN (regN m) ;
mkPN n = mkProperName n ** {lock_PN = <>} ;
mkNP noun num = {
s = \\c => noun.s ! NCase num (npform2case c) ;
diff --git a/lib/resource-1.0/french/ParadigmsFre.gf b/lib/resource-1.0/french/ParadigmsFre.gf
index 3375bbb1e..5d7ec0850 100644
--- a/lib/resource-1.0/french/ParadigmsFre.gf
+++ b/lib/resource-1.0/french/ParadigmsFre.gf
@@ -57,13 +57,11 @@ oper
-- amalgamate with the following word (the 'genitive' "de" and the
-- 'dative' "à").
- Preposition : Type ;
+ accusative : Prep ;
+ genitive : Prep ;
+ dative : Prep ;
- accusative : Preposition ;
- genitive : Preposition ;
- dative : Preposition ;
-
- mkPreposition : Str -> Preposition ;
+ mkPrep : Str -> Prep ;
--2 Nouns
@@ -102,7 +100,7 @@ oper
--
-- Relational nouns ("fille de x") need a case and a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
-- The most common cases are the genitive "de" and the dative "à",
-- with the empty preposition.
@@ -112,7 +110,7 @@ oper
-- Three-place relational nouns ("la connection de x à y") need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
--3 Relational common noun phrases
@@ -127,7 +125,10 @@ oper
--
-- Proper names need a string and a gender.
- mkPN : Str -> Gender -> PN ; -- Jean
+ mkPN : Str -> Gender -> PN ; -- Jean
+
+ regPN : Str -> PN ; -- masculine
+
-- To form a noun phrase that can also be plural,
-- you can use the worst-case function.
@@ -160,7 +161,7 @@ oper
--
-- Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
--3 Comparison adjectives
@@ -227,7 +228,7 @@ oper
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -240,9 +241,9 @@ oper
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à, de
- dirV3 : V -> Preposition -> V3 ; -- donner,_,à
- dirdirV3 : V -> V3 ; -- donner,_,_
+ mkV3 : V -> Prep -> Prep -> V3 ; -- parler, à, de
+ dirV3 : V -> Prep -> V3 ; -- donner,_,à
+ dirdirV3 : V -> V3 ; -- donner,_,_
--3 Other complement patterns
--
@@ -251,20 +252,20 @@ oper
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Preposition -> V2S ;
+ 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"
- mkV2V : V -> Preposition -> Preposition -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Preposition -> Preposition -> V2A ;
+ mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Preposition -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Preposition -> A2S ;
- mkAV : A -> Preposition -> AV ;
- mkA2V : A -> Preposition -> Preposition -> A2V ;
+ mkA2S : A -> Prep -> A2S ;
+ mkAV : A -> Prep -> AV ;
+ mkA2V : A -> Prep -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given
@@ -274,11 +275,12 @@ oper
V0, V2S, V2V, V2Q : 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 = MorphoFre.Gender ;
Number = MorphoFre.Number ;
@@ -291,7 +293,12 @@ oper
accusative = complAcc ;
genitive = complGen ;
dative = complDat ;
- mkPreposition p = {s = p ; c = Acc ; isDir = False} ;
+ mkPrep p = {s = p ; c = Acc ; isDir = False} ;
+
+ --- obsolete
+ Preposition : Type ;
+ mkPreposition : Str -> Preposition ;
+ mkPreposition = mkPrep ;
mkN x y g = mkCNomIrreg x y g ** {lock_N = <>} ;
regN x = regGenN x g where {
@@ -308,6 +315,7 @@ oper
aN2 n = mkN2 n dative ;
mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
+ regPN x = mkPN x 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 b1d891dd1..bb7f3d1df 100644
--- a/lib/resource-1.0/german/ParadigmsGer.gf
+++ b/lib/resource-1.0/german/ParadigmsGer.gf
@@ -1,5 +1,5 @@
--# -path=.:../common:../abstract:../../prelude
---
+
--1 German Lexical Paradigms
--
-- Aarne Ranta & Harald Hammarström 2003--2006
@@ -235,12 +235,13 @@ oper
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 = MorphoGer.Gender ;
Case = MorphoGer.Case ;
diff --git a/lib/resource-1.0/italian/ExtraIta.gf b/lib/resource-1.0/italian/ExtraIta.gf
new file mode 100644
index 000000000..59d1a8ef0
--- /dev/null
+++ b/lib/resource-1.0/italian/ExtraIta.gf
@@ -0,0 +1,5 @@
+concrete ExtraIta of ExtraItaAbs = ExtraRomanceIta **
+ open CommonRomance, PhonoIta, ParamX, ResIta in {
+
+
+}
diff --git a/lib/resource-1.0/italian/ExtraItaAbs.gf b/lib/resource-1.0/italian/ExtraItaAbs.gf
new file mode 100644
index 000000000..55eadddec
--- /dev/null
+++ b/lib/resource-1.0/italian/ExtraItaAbs.gf
@@ -0,0 +1,6 @@
+-- Structures special for Italian. These are not implemented in other
+-- Romance languages.
+
+abstract ExtraItaAbs = ExtraRomanceAbs ** {
+
+}
diff --git a/lib/resource-1.0/italian/ExtraRomanceIta.gf b/lib/resource-1.0/italian/ExtraRomanceIta.gf
new file mode 100644
index 000000000..af4bb5976
--- /dev/null
+++ b/lib/resource-1.0/italian/ExtraRomanceIta.gf
@@ -0,0 +1,2 @@
+concrete ExtraRomanceIta of ExtraRomanceAbs = CatIta ** ExtraRomance with
+ (ResRomance = ResIta) ;
diff --git a/lib/resource-1.0/italian/Italian.gf b/lib/resource-1.0/italian/Italian.gf
new file mode 100644
index 000000000..72a921aff
--- /dev/null
+++ b/lib/resource-1.0/italian/Italian.gf
@@ -0,0 +1,7 @@
+--# -path=.:../romance:../abstract:../common:prelude
+
+concrete Italian of ItalianAbs =
+ LangIta,
+-- IrregIta,
+ ExtraIta
+ ** {} ;
diff --git a/lib/resource-1.0/italian/ItalianAbs.gf b/lib/resource-1.0/italian/ItalianAbs.gf
new file mode 100644
index 000000000..23272368c
--- /dev/null
+++ b/lib/resource-1.0/italian/ItalianAbs.gf
@@ -0,0 +1,5 @@
+abstract ItalianAbs =
+ Lang,
+-- IrregItaAbs,
+ ExtraItaAbs
+ ** {} ;
diff --git a/lib/resource-1.0/italian/LexiconIta.gf b/lib/resource-1.0/italian/LexiconIta.gf
index 785771824..4652cdffa 100644
--- a/lib/resource-1.0/italian/LexiconIta.gf
+++ b/lib/resource-1.0/italian/LexiconIta.gf
@@ -130,7 +130,7 @@ lin
old_A = prefA (regADeg "vecchio") ;
open_V2 = dirV2 (verboV (aprire_102 "aprire")) ;
paint_V2A =
- mkV2A (verboV (cingere_31 "pingere")) accusative (mkPreposition "in") ;
+ mkV2A (verboV (cingere_31 "pingere")) accusative (mkPrep "in") ; ----
paper_N = regN "carta" ;
paris_PN = mkPN "Parigi" masculine ;
peace_N = femN (regN "pace") ;
diff --git a/lib/resource-1.0/italian/ParadigmsIta.gf b/lib/resource-1.0/italian/ParadigmsIta.gf
index 1742721c8..ae93829f3 100644
--- a/lib/resource-1.0/italian/ParadigmsIta.gf
+++ b/lib/resource-1.0/italian/ParadigmsIta.gf
@@ -58,13 +58,13 @@ oper
-- amalgamate with the following word (the 'genitive' "de" and the
-- 'dative' "à").
- Preposition : Type ;
+ Prep : Type ;
- accusative : Preposition ;
- genitive : Preposition ;
- dative : Preposition ;
+ accusative : Prep ;
+ genitive : Prep ;
+ dative : Prep ;
- mkPreposition : Str -> Preposition ;
+ mkPrep : Str -> Prep ;
--2 Nouns
@@ -98,7 +98,7 @@ oper
--
-- Relational nouns ("figlio di x") need a case and a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
-- The most common cases are the genitive "di" and the dative "a",
-- with the empty preposition.
@@ -108,7 +108,7 @@ oper
-- Three-place relational nouns ("la connessione di x a y") need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
--3 Relational common noun phrases
@@ -123,7 +123,8 @@ oper
--
-- Proper names need a string and a gender.
- mkPN : Str -> Gender -> PN ; -- Jean
+ mkPN : Str -> Gender -> PN ;
+ regPN : Str -> PN ; -- masculine
-- To form a noun phrase that can also be plural,
-- you can use the worst-case function.
@@ -153,7 +154,7 @@ oper
--
-- Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
--3 Comparison adjectives
@@ -217,7 +218,7 @@ oper
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -230,9 +231,9 @@ oper
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à, de
- dirV3 : V -> Preposition -> V3 ; -- donner,_,à
- dirdirV3 : V -> V3 ; -- donner,_,_
+ mkV3 : V -> Prep -> Prep -> V3 ; -- parlare, a, di
+ dirV3 : V -> Prep -> V3 ; -- dare,_,a
+ dirdirV3 : V -> V3 ; -- dare,_,_
--3 Other complement patterns
@@ -242,20 +243,20 @@ oper
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Preposition -> V2S ;
- mkVV : V -> VV ; -- plain infinitive: "je veux parler"
- deVV : V -> VV ; -- "j'essaie de parler"
- aVV : V -> VV ; -- "j'arrive à parler"
- mkV2V : V -> Preposition -> Preposition -> V2V ;
+ mkV2S : V -> Prep -> V2S ;
+ mkVV : V -> VV ; -- plain infinitive: "voglio parlare"
+ deVV : V -> VV ; -- "cerco di parlare"
+ aVV : V -> VV ; -- "arrivo a parlare"
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Preposition -> Preposition -> V2A ;
+ mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Preposition -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Preposition -> A2S ;
- mkAV : A -> Preposition -> AV ;
- mkA2V : A -> Preposition -> Preposition -> A2V ;
+ mkA2S : A -> Prep -> A2S ;
+ mkAV : A -> Prep -> AV ;
+ mkA2V : A -> Prep -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given
@@ -266,11 +267,12 @@ oper
AS, A2S, AV, A2V : Type ;
+--.
--2 The definitions of the paradigms
--
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
---.
+
Gender = MorphoIta.Gender ;
Number = MorphoIta.Number ;
@@ -279,11 +281,11 @@ oper
singular = Sg ;
plural = Pl ;
- Preposition = Compl ;
+ Prep = Compl ;
accusative = complAcc ;
genitive = complGen ;
dative = complDat ;
- mkPreposition p = {s = p ; c = Acc ; isDir = False} ;
+ mkPrep p = {s = p ; c = Acc ; isDir = False} ;
mkN x y g = mkNounIrreg x y g ** {lock_N = <>} ;
regN x = mkNomReg x ** {lock_N = <>} ;
@@ -298,6 +300,7 @@ 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 ;
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/italian/StructuralIta.gf b/lib/resource-1.0/italian/StructuralIta.gf
index b22a4117d..bc7e7cec1 100644
--- a/lib/resource-1.0/italian/StructuralIta.gf
+++ b/lib/resource-1.0/italian/StructuralIta.gf
@@ -6,7 +6,7 @@ concrete StructuralIta of Structural = CatIta **
lin
above_Prep = {s = ["sopra"] ; c = MorphoIta.genitive ; isDir = False} ;
- after_Prep = mkPreposition "dopo" ;
+ after_Prep = mkPrep "dopo" ;
all_Predet = {
s = \\a,c => prepCase c ++ aagrForms "tutto" "tutta" "tutti" "tutte" ! a ;
c = Nom
@@ -16,16 +16,16 @@ lin
although_Subj = ss "benché" ** {m = Conjunct} ;
and_Conj = ss "e" ** {n = Pl} ;
because_Subj = ss "perché" ** {m = Indic} ;
- before_Prep = mkPreposition "prima" ;
- behind_Prep = mkPreposition "dietro" ;
- between_Prep = mkPreposition "fra" ;
+ before_Prep = mkPrep "prima" ;
+ behind_Prep = mkPrep "dietro" ;
+ between_Prep = mkPrep "fra" ;
both7and_DConj = {s1,s2 = "e" ; n = Pl} ;
but_PConj = ss "ma" ;
- by8agent_Prep = {s = [] ; c = CPrep P_da} ;
- by8means_Prep = mkPreposition "per" ;
+ by8agent_Prep = {s = [] ; c = CPrep P_da ; isDir = False} ;
+ by8means_Prep = mkPrep "per" ;
can8know_VV = mkVV (verboV (sapere_78 "sapere")) ;
can_VV = mkVV (verboV (potere_69 "potere")) ;
- during_Prep = mkPreposition "durante" ;
+ during_Prep = mkPrep "durante" ;
either7or_DConj = {s1,s2 = "o" ; n = Sg} ;
everybody_NP = mkNP ["tutti"] Masc Pl ;
every_Det = {s = \\_,_ => "ogni" ; n = Sg} ;
@@ -44,12 +44,12 @@ lin
how_IAdv = ss "come" ;
how8many_IDet = {s = \\g,c => prepCase c ++ genForms "quanti" "quante" ! g ; n = Pl} ;
if_Subj = ss "se" ** {m = Indic} ;
- in8front_Prep = mkPreposition "davanti" ;
+ in8front_Prep = mkPrep "davanti" ;
i_Pron =
mkPronoun
"io" "mi" "mi" "me" "me" "mio" "mia" "miei" "mie"
Fem Sg P1 ;
- in_Prep = {s = [] ; c = CPrep P_in} ;
+ in_Prep = {s = [] ; c = CPrep P_in ; isDir = False} ;
it_Pron =
mkPronoun
"lui" "lo" "gli" "glie" "lui" "suo" "sua" "suoi" "sue"
@@ -61,7 +61,7 @@ lin
much_Det = {s = \\g,c => prepCase c ++ genForms "molto" "molta" ! g ; n = Sg} ;
must_VV = mkVV (verboV (dovere_47 "dovere")) ;
no_Phr = ss "no" ;
- on_Prep = {s = [] ; c = CPrep P_su} ;
+ on_Prep = {s = [] ; c = CPrep P_su ; isDir = False} ;
one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ;
only_Predet = {s = \\_,c => prepCase c ++ "soltanto" ; c = Nom} ; --- solo|a|i|e
or_Conj = {s = "o" ; n = Sg} ;
@@ -103,10 +103,10 @@ lin
} ;
this_NP = pn2np (mkPN ["questo"] Masc) ;
those_NP = mkNP ["quelle"] Fem Pl ;
- through_Prep = mkPreposition "per" ;
+ through_Prep = mkPrep "per" ;
too_AdA = ss "troppo" ;
to_Prep = complDat ;
- under_Prep = mkPreposition "sotto" ;
+ under_Prep = mkPrep "sotto" ;
very_AdA = ss "molto" ;
want_VV = mkVV (verboV (volere_96 "volere")) ;
we_Pron =
@@ -122,8 +122,8 @@ lin
whoPl_IP = {s = \\c => prepCase c ++ "chi" ; a = aagr Fem Pl} ;
whoSg_IP = {s = \\c => prepCase c ++ "chi" ; a = aagr Fem Sg} ;
why_IAdv = ss "perché" ;
- without_Prep = mkPreposition "senza" ;
- with_Prep = {s = [] ; c = CPrep P_con} ;
+ without_Prep = mkPrep "senza" ;
+ with_Prep = {s = [] ; c = CPrep P_con ; isDir = False} ;
yes_Phr = ss "sì" ;
youSg_Pron = mkPronoun
"tu" "ti" "ti" "te" "te" "tuo" "tua" "tuoi" "tue"
diff --git a/lib/resource-1.0/norwegian/LexiconNor.gf b/lib/resource-1.0/norwegian/LexiconNor.gf
index fce902feb..ebac3dfad 100644
--- a/lib/resource-1.0/norwegian/LexiconNor.gf
+++ b/lib/resource-1.0/norwegian/LexiconNor.gf
@@ -8,18 +8,18 @@ flags startcat=Phr ; lexer=textlit ; unlexer=text ;
lin
airplane_N = mk2N "fly" "flyet" ;
- answer_V2S = mkV2S (regV "svare") "til" ;
+ 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 [] ;
+ 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" "vakra" ;
become_VA = mkVA (vaereV bli_V) ;
beer_N = regGenN "øl" neutrum ;
- beg_V2V = mkV2V be_V [] "at" ;
+ 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" ;
@@ -33,7 +33,7 @@ lin
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")) "til" ;
+ 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") ;
@@ -60,17 +60,17 @@ lin
cow_N = mkN "ku" "kua" "kyr" "kyrne" ; ----
die_V = vaereV dø_V ;
dirty_A = mk3ADeg "skitten" "skittent" "skitne" ; ----
- distance_N3 = mkN3 (regGenN "avstand" masculine) "fra" "til" ;
+ 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 drikke_V ;
- easy_A2V = mkA2V (regA "grei") "for" ;
+ 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")) "til" ;
+ 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" ;
@@ -115,11 +115,11 @@ lin
love_N = regGenN "kjærlighet" masculine ;
love_V2 = dirV2 (regV "elske") ;
man_N = (mkN "mann" "mannen" "menn" "mennen") ;
- married_A2 = mkA2 (mk2A "gift" "gift") "med" ;
+ 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") "til" ; ---- fem
+ 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" ;
@@ -128,9 +128,9 @@ lin
oil_N = regGenN "olje" masculine ;
old_A = mkADeg "gammel" "gammelt" "gamle" "eldre" "eldst" ;
open_V2 = dirV2 (regV "åpne") ;
- paint_V2A = mkV2A (regV "male") [] ;
+ paint_V2A = mkV2A (regV "male") noPrep ;
paper_N = regGenN "papir" neutrum ; ----
- paris_PN = regPN "Paris" neutrum ;
+ paris_PN = regGenPN "Paris" neutrum ;
peace_N = regGenN "fred" masculine ;
pen_N = regGenN "penn" masculine ;
planet_N = mk2N "planet" "planeten" ;
@@ -155,10 +155,10 @@ lin
school_N = regGenN "skole" feminine;
science_N = mk2N "vitenskap" "vitenskapen" ;
sea_N = mk2N "sjø" "sjøen" ;
- seek_V2 = mkV2 (mk2V "lete" "lette") "etter" ;
+ seek_V2 = mkV2 (mk2V "lete" "lette") (mkPrep "etter") ;
see_V2 = dirV2 se_V ;
- sell_V3 = dirV3 selge_V "til" ;
- send_V3 = dirV3 (mk2V "sende" "sendte") "til" ;
+ 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 ;
@@ -182,7 +182,7 @@ lin
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") "til" "om" ;
+ 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" ;
@@ -196,11 +196,11 @@ lin
understand_V2 = dirV2 (irregV "forstå" "forstod" "forstått") ;
university_N = regGenN "universitet" neutrum ;
village_N = mk2N "grend" "grenda" ;
- wait_V2 = mkV2 (regV "vente") "på" ;
+ wait_V2 = mkV2 (regV "vente") (mkPrep "på") ;
walk_V = vaereV gå_V ;
warm_A = regADeg "varm" ;
war_N = regGenN "krig" masculine ;
- watch_V2 = mkV2 se_V "på" ;
+ watch_V2 = mkV2 se_V (mkPrep "på") ;
water_N = mk2N "vatn" "vatnet" ;
white_A = regADeg "hvit" ;
window_N = mkN "vindu" "vinduet" "vinduer" "vinduene" ; ---- er?
@@ -217,9 +217,9 @@ lin
now_Adv = mkAdv "nå" ;
already_Adv = mkAdv "allerede" ;
song_N = mk2N "sang" "sangen" ;
- add_V3 = mkV3 (partV (irregV "legge" "la" "lagt") "til") [] "til" ;
+ add_V3 = mkV3 (partV (irregV "legge" "la" "lagt") "til") noPrep (mkPrep "til") ;
number_N = mk2N "nummer" "nummeret" ;
- put_V2 = mkV2 (irregV "sette" "satte" "satt") [] ;
+ put_V2 = mkV2 (irregV "sette" "satte" "satt") noPrep ;
stop_V = vaereV (regV "stanse") ;
jump_V = regV "hoppe" ;
diff --git a/lib/resource-1.0/norwegian/ParadigmsNor.gf b/lib/resource-1.0/norwegian/ParadigmsNor.gf
index 2d8a7c3e3..8cc30c9cb 100644
--- a/lib/resource-1.0/norwegian/ParadigmsNor.gf
+++ b/lib/resource-1.0/norwegian/ParadigmsNor.gf
@@ -60,7 +60,8 @@ oper
-- Prepositions used in many-argument functions are just strings.
- Preposition : Type = Str ;
+ mkPrep : Str -> Prep ;
+ noPrep : Prep ; -- empty string
--2 Nouns
@@ -97,19 +98,19 @@ oper
--
-- Relational nouns ("daughter of x") need a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ 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 $mkPreposition$ or see the section on prepositions below to
+-- Use the function $mkPrep$ or see the section on prepositions below to
-- form other prepositions.
--
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
--3 Relational common noun phrases
@@ -124,7 +125,8 @@ oper
--
-- Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's
+ regPN : Str -> PN ; -- utrum
+ regGenPN : Str -> Gender -> PN ;
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
@@ -153,7 +155,7 @@ oper
--
-- Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
-- Comparison adjectives may need as many as five forms.
@@ -191,11 +193,6 @@ oper
mkAdA : Str -> AdA ;
---2 Prepositions
---
--- A preposition is just a string.
-
- mkPreposition : Str -> Preposition ;
--2 Verbs
--
@@ -243,7 +240,7 @@ oper
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -252,9 +249,9 @@ oper
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
- mkV3 : V -> Str -> Str -> V3 ; -- speak, with, about
- dirV3 : V -> Str -> V3 ; -- give,_,to
- dirdirV3 : V -> V3 ; -- give,_,_
+ mkV3 : V -> Prep -> Prep -> V3 ; -- speak, with, about
+ dirV3 : V -> Prep -> V3 ; -- give,_,to
+ dirdirV3 : V -> V3 ; -- give,_,_
--3 Other complement patterns
--
@@ -263,18 +260,18 @@ oper
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given
@@ -285,11 +282,11 @@ oper
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 ;
@@ -331,11 +328,12 @@ oper
} ;
- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
- regN2 n g = mkN2 (regGenN n g) (mkPreposition "av") ;
- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
+ mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
+ regN2 n g = mkN2 (regGenN n g) (mkPrep "av") ;
+ mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
- regPN n g = {s = \\c => mkCase c n ; g = g} ** {lock_PN = <>} ;
+ 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 = <>} ;
mkNP x y n g =
{s = table {NPPoss _ => x ; _ => y} ; a = agrP3 g n ;
@@ -345,7 +343,7 @@ oper
mk2A a b = mkA a b (a + "e") ;
regA a = (regADeg a) ** {isComp = False ; lock_A = <>} ;
- mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
+ mkA2 a p = a ** {c2 = 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 {
@@ -366,7 +364,8 @@ oper
mkAdV x = ss x ** {lock_AdV = <>} ;
mkAdA x = ss x ** {lock_AdA = <>} ;
- mkPreposition p = p ;
+ mkPrep p = {s = p ; lock_Prep = <>} ;
+ noPrep = mkPrep [] ;
mkV a b c d e f = mkVerb6 a b c d e f **
{part = [] ; vtype = VAct ; isVaere = False ; lock_V = <>} ;
@@ -404,12 +403,12 @@ oper
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 = <>} ;
- mkV2 v p = v ** {c2 = p ; lock_V2 = <>} ;
- dirV2 v = mkV2 v [] ;
+ mkV2 v p = v ** {c2 = p.s ; lock_V2 = <>} ;
+ dirV2 v = mkV2 v noPrep ;
- mkV3 v p q = v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
- dirV3 v p = mkV3 v [] p ;
- dirdirV3 v = dirV3 v [] ;
+ mkV3 v p q = v ** {c2 = p.s ; c3 = q.s ; lock_V3 = <>} ;
+ dirV3 v p = mkV3 v noPrep p ;
+ dirdirV3 v = dirV3 v noPrep ;
mkV0 v = v ** {lock_V0 = <>} ;
mkVS v = v ** {lock_VS = <>} ;
diff --git a/lib/resource-1.0/romance/CatRomance.gf b/lib/resource-1.0/romance/CatRomance.gf
index a9904bd7f..1b03e6685 100644
--- a/lib/resource-1.0/romance/CatRomance.gf
+++ b/lib/resource-1.0/romance/CatRomance.gf
@@ -65,7 +65,7 @@ incomplete concrete CatRomance of Cat =
Conj = {s : Str ; n : Number} ;
DConj = {s1,s2 : Str ; n : Number} ;
Subj = {s : Str ; m : Mood} ;
- Prep = {s : Str ; c : Case} ;
+ Prep = {s : Str ; c : Case ; isDir : Bool} ;
-- Open lexical classes, e.g. Lexicon
diff --git a/lib/resource-1.0/russian/ParadigmsRus.gf b/lib/resource-1.0/russian/ParadigmsRus.gf
index e5e104126..a8e4c8266 100644
--- a/lib/resource-1.0/russian/ParadigmsRus.gf
+++ b/lib/resource-1.0/russian/ParadigmsRus.gf
@@ -143,6 +143,7 @@ nPepel : Str -> N ; -- masculine, inanimate, ending with "-ел"- "пеп-л
-- Proper names.
mkPN : Str -> Gender -> Animacy -> PN ; -- "Иван", "Маша"
+ regPN : Str -> PN ;
nounPN : N -> PN ;
-- On the top level, it is maybe $CN$ that is used rather than $N$, and
@@ -292,10 +293,11 @@ perfective: Aspect ;
mkV3 : V -> Str -> Str -> Case -> Case -> V3 ; -- "Ñложить пиÑьмо в конверт"
dirV2 : V -> V2 ; -- "видеть", "любить"
tvDirDir : V -> V3 ;
-
+
+--.
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
---.
+
Gender = MorphoRus.Gender ;
Case = MorphoRus.Case ;
Number = MorphoRus.Number ;
@@ -450,6 +452,8 @@ regN = \ray ->
Masc => mkProperNameMasc ivan anim ;
_ => mkProperNameFem ivan anim
} ** {lock_PN =<>};
+ regPN x = mkPN x masculine animate ;
+
nounPN n = {s=\\c => n.s! SF Sg c; anim=n.anim; g=n.g; lock_PN=<>};
mkCN = UseN;
diff --git a/lib/resource-1.0/spanish/ExtraRomanceSpa.gf b/lib/resource-1.0/spanish/ExtraRomanceSpa.gf
new file mode 100644
index 000000000..d143b9612
--- /dev/null
+++ b/lib/resource-1.0/spanish/ExtraRomanceSpa.gf
@@ -0,0 +1,2 @@
+concrete ExtraRomanceSpa of ExtraRomanceAbs = CatSpa ** ExtraRomance with
+ (ResRomance = ResSpa) ;
diff --git a/lib/resource-1.0/spanish/ExtraSpa.gf b/lib/resource-1.0/spanish/ExtraSpa.gf
new file mode 100644
index 000000000..736a95364
--- /dev/null
+++ b/lib/resource-1.0/spanish/ExtraSpa.gf
@@ -0,0 +1,5 @@
+concrete ExtraSpa of ExtraSpaAbs = ExtraRomanceSpa **
+ open CommonRomance, PhonoSpa, ParamX, ResSpa in {
+
+
+}
diff --git a/lib/resource-1.0/spanish/ExtraSpaAbs.gf b/lib/resource-1.0/spanish/ExtraSpaAbs.gf
new file mode 100644
index 000000000..be1a8ffac
--- /dev/null
+++ b/lib/resource-1.0/spanish/ExtraSpaAbs.gf
@@ -0,0 +1,6 @@
+-- Structures special for Spanish. These are not implemented in other
+-- Romance languages.
+
+abstract ExtraSpaAbs = ExtraRomanceAbs ** {
+
+}
diff --git a/lib/resource-1.0/spanish/LexiconSpa.gf b/lib/resource-1.0/spanish/LexiconSpa.gf
index 659fd8237..a6da3b488 100644
--- a/lib/resource-1.0/spanish/LexiconSpa.gf
+++ b/lib/resource-1.0/spanish/LexiconSpa.gf
@@ -128,7 +128,7 @@ lin
oil_N = regN "aceite" ;
old_A = prefA (regADeg "viejo") ;
open_V2 = dirV2 (special_ppV (regV "abrir") "abierto") ;
- paint_V2A = mkV2A (regV "pintar") accusative (mkPreposition "en") ;
+ paint_V2A = mkV2A (regV "pintar") accusative (mkPrep "en") ;
paper_N = regN "papel" ;
paris_PN = mkPN "Paris" masculine ;
peace_N = femN (regN "paz") ;
diff --git a/lib/resource-1.0/spanish/ParadigmsSpa.gf b/lib/resource-1.0/spanish/ParadigmsSpa.gf
index 61a2519af..f222a9036 100644
--- a/lib/resource-1.0/spanish/ParadigmsSpa.gf
+++ b/lib/resource-1.0/spanish/ParadigmsSpa.gf
@@ -55,13 +55,13 @@ oper
-- amalgamate with the following word (the 'genitive' "de" and the
-- 'dative' "à").
- Preposition : Type ;
+ Prep : Type ;
- accusative : Preposition ;
- genitive : Preposition ;
- dative : Preposition ;
+ accusative : Prep ;
+ genitive : Prep ;
+ dative : Prep ;
- mkPreposition : Str -> Preposition ;
+ mkPrep : Str -> Prep ;
--2 Nouns
@@ -100,7 +100,7 @@ oper
--
-- Relational nouns ("fille de x") need a case and a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
-- The most common cases are the genitive "de" and the dative "a",
-- with the empty preposition.
@@ -110,7 +110,7 @@ oper
-- Three-place relational nouns ("la connessione di x a y") need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
--3 Relational common noun phrases
@@ -125,7 +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
+
-- To form a noun phrase that can also be plural,
-- you can use the worst-case function.
@@ -156,7 +158,7 @@ oper
--
-- Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
--3 Comparison adjectives
@@ -221,7 +223,7 @@ oper
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -234,9 +236,9 @@ oper
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- parler, à, de
- dirV3 : V -> Preposition -> V3 ; -- donner,_,à
- dirdirV3 : V -> V3 ; -- donner,_,_
+ mkV3 : V -> Prep -> Prep -> V3 ; -- parler, à, de
+ dirV3 : V -> Prep -> V3 ; -- donner,_,à
+ dirdirV3 : V -> V3 ; -- donner,_,_
--3 Other complement patterns
--
@@ -245,20 +247,20 @@ oper
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Preposition -> V2S ;
+ 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"
- mkV2V : V -> Preposition -> Preposition -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Preposition -> Preposition -> V2A ;
+ mkV2A : V -> Prep -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Preposition -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Preposition -> A2S ;
- mkAV : A -> Preposition -> AV ;
- mkA2V : A -> Preposition -> Preposition -> A2V ;
+ mkA2S : A -> Prep -> A2S ;
+ mkAV : A -> Prep -> AV ;
+ mkA2V : A -> Prep -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given
@@ -269,11 +271,11 @@ oper
AS, A2S, AV, A2V : Type ;
+--.
--2 The definitions of the paradigms
--
-- The definitions should not bother the user of the API. So they are
-- hidden from the document.
---.
Gender = MorphoSpa.Gender ;
Number = MorphoSpa.Number ;
@@ -282,11 +284,11 @@ oper
singular = Sg ;
plural = Pl ;
- Preposition = Compl ;
+ Prep = Compl ;
accusative = complAcc ;
genitive = complGen ;
dative = complDat ;
- mkPreposition p = {s = p ; c = Acc ; isDir = False} ;
+ mkPrep p = {s = p ; c = Acc ; isDir = False} ;
mkN x y g = mkNounIrreg x y g ** {lock_N = <>} ;
@@ -301,6 +303,7 @@ 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 ;
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/spanish/Spanish.gf b/lib/resource-1.0/spanish/Spanish.gf
new file mode 100644
index 000000000..4d71f62ca
--- /dev/null
+++ b/lib/resource-1.0/spanish/Spanish.gf
@@ -0,0 +1,7 @@
+--# -path=.:../romance:../abstract:../common:prelude
+
+concrete Spanish of SpanishAbs =
+ LangSpa,
+-- IrregSpa,
+ ExtraSpa
+ ** {} ;
diff --git a/lib/resource-1.0/spanish/SpanishAbs.gf b/lib/resource-1.0/spanish/SpanishAbs.gf
new file mode 100644
index 000000000..031820a59
--- /dev/null
+++ b/lib/resource-1.0/spanish/SpanishAbs.gf
@@ -0,0 +1,5 @@
+abstract SpanishAbs =
+ Lang,
+-- IrregSpaAbs,
+ ExtraSpaAbs
+ ** {} ;
diff --git a/lib/resource-1.0/spanish/StructuralSpa.gf b/lib/resource-1.0/spanish/StructuralSpa.gf
index bb62aaf9c..24d680803 100644
--- a/lib/resource-1.0/spanish/StructuralSpa.gf
+++ b/lib/resource-1.0/spanish/StructuralSpa.gf
@@ -5,7 +5,7 @@ concrete StructuralSpa of Structural = CatSpa **
lin
- above_Prep = mkPreposition "sobre" ;
+ above_Prep = mkPrep "sobre" ;
after_Prep = {s = ["despues"] ; c = MorphoSpa.genitive ; isDir = False} ;
all_Predet = {
s = \\a,c => prepCase c ++ aagrForms "todo" "toda" "todos" "todas" ! a ;
@@ -18,14 +18,14 @@ lin
because_Subj = ss "porque" ** {m = Indic} ;
before_Prep = {s = "antes" ; c = MorphoSpa.genitive ; isDir = False} ;
behind_Prep = {s = "detrás" ; c = MorphoSpa.genitive ; isDir = False} ;
- between_Prep = mkPreposition "entre" ;
+ between_Prep = mkPrep "entre" ;
both7and_DConj = {s1,s2 = etConj.s ; n = Pl} ;
but_PConj = ss "pero" ;
- by8agent_Prep = mkPreposition "por" ;
- by8means_Prep = mkPreposition "por" ;
+ by8agent_Prep = mkPrep "por" ;
+ by8means_Prep = mkPrep "por" ;
can8know_VV = mkVV (verboV (saber_71 "saber")) ;
can_VV = mkVV (verboV (poder_58 "poder")) ;
- during_Prep = mkPreposition "durante" ; ----
+ during_Prep = mkPrep "durante" ; ----
either7or_DConj = {s1,s2 = "o" ; n = Sg} ;
everybody_NP = mkNP ["todos"] Masc Pl ;
every_Det = {s = \\_,_ => "cada" ; n = Sg} ;
@@ -52,7 +52,7 @@ lin
"yo" "me" "me" "mí"
"mi" "mi" "mis" "mis"
Fem Sg P1 ;
- in_Prep = mkPreposition "en" ;
+ in_Prep = mkPrep "en" ;
it_Pron =
mkPronoun
"el" "lo" "le" "él"
@@ -65,7 +65,7 @@ lin
much_Det = {s = \\g,c => prepCase c ++ genForms "mucho" "mucha" ! g ; n = Sg} ;
must_VV = mkVV (verboV (deber_6 "deber")) ;
no_Phr = ss "no" ;
- on_Prep = mkPreposition "sobre" ;
+ on_Prep = mkPrep "sobre" ;
one_Quant = {s = \\g,c => prepCase c ++ genForms "uno" "una" ! g} ;
only_Predet = {s = \\_,c => prepCase c ++ "solamente" ; c = Nom} ;
or_Conj = {s = "o" ; n = Sg} ;
@@ -109,10 +109,10 @@ lin
} ;
this_NP = pn2np (mkPN ["esto"] Masc) ;
those_NP = mkNP ["esas"] Fem Pl ;
- through_Prep = mkPreposition "por" ;
+ through_Prep = mkPrep "por" ;
too_AdA = ss "demasiado" ;
to_Prep = complDat ;
- under_Prep = mkPreposition "bajo" ;
+ under_Prep = mkPrep "bajo" ;
very_AdA = ss "muy" ;
want_VV = mkVV (verboV (querer_64 "querer")) ;
we_Pron =
@@ -130,8 +130,8 @@ lin
whoPl_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Fem Pl} ;
whoSg_IP = {s = \\c => prepCase c ++ "quién" ; a = aagr Fem Sg} ;
why_IAdv = ss "porqué" ;
- without_Prep = mkPreposition "sin" ;
- with_Prep = mkPreposition "con" ;
+ without_Prep = mkPrep "sin" ;
+ with_Prep = mkPrep "con" ;
yes_Phr = ss "sí" ;
youSg_Pron = mkPronoun
"tu" "te" "te" "tí"
diff --git a/lib/resource-1.0/swedish/ExtraSweAbs.gf b/lib/resource-1.0/swedish/ExtraSweAbs.gf
new file mode 100644
index 000000000..9371b3e11
--- /dev/null
+++ b/lib/resource-1.0/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/resource-1.0/swedish/LexiconSwe.gf b/lib/resource-1.0/swedish/LexiconSwe.gf
index 80e6db9a8..b8c7bc75c 100644
--- a/lib/resource-1.0/swedish/LexiconSwe.gf
+++ b/lib/resource-1.0/swedish/LexiconSwe.gf
@@ -8,18 +8,18 @@ flags
lin
airplane_N = regGenN "flygplan" neutrum ;
- answer_V2S = mkV2S (regV "svarar") "till" ;
+ 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") [] ;
+ 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" "blad" "bett" "bedd") [] "att" ;
+ beg_V2V = mkV2V (mkV "be" "ber""be" "blad" "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" ;
@@ -33,7 +33,7 @@ lin
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")) "till" ;
+ 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") ;
@@ -59,18 +59,18 @@ lin
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") "från" "till" ;
+ 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") "för" ;
+ 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")) "till" ;
+ 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" ;
@@ -108,19 +108,19 @@ lin
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") "om" ;
- listen_V2 = mkV2 (regV "lyssnar") "på" ;
+ 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") "med" ;
+ 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") "till" ;
+ 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" ;
@@ -129,9 +129,9 @@ lin
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") [] ;
+ paint_V2A = mkV2A (regV "måla") noPrep ;
paper_N = mkN "papper" "pappret" "papper" "pappren" ;
- paris_PN = regPN "Paris" neutrum ;
+ paris_PN = regGenPN "Paris" neutrum ;
peace_N = regGenN "fred" utrum ; ---- ar?
pen_N = regGenN "penna" utrum ;
planet_N = mk2N "planet" "planeter" ;
@@ -158,8 +158,8 @@ lin
sea_N = mkN "sjö" "sjön" "sjöar" "sjöarna" ;
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") "till" ;
- send_V3 = dirV3 (regV "skicka") "till" ;
+ 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 ;
@@ -183,7 +183,7 @@ lin
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") "till" "om" ;
+ 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" ;
@@ -197,11 +197,11 @@ lin
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") "på" ;
+ 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") "på" ;
+ 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" ;
@@ -218,9 +218,9 @@ lin
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") [] "till" ;
+ 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") [] ;
+ put_V2 = mkV2 (mkV "sätta" "sätter" "sätt" "satte" "satt" "satt") noPrep ;
stop_V = regV "stanna" ;
jump_V = regV "hoppa" ;
@@ -315,7 +315,7 @@ lin
flow_V = rinna_V ;
fly_V = flyga_V ;
freeze_V = frysa_V ;
- give_V3 = dirV3 giva_V "till";
+ give_V3 = dirV3 giva_V (mkPrep "till");
hit_V2 = dirV2 (slå_V) ;
hold_V2 = dirV2 (hålla_V) ;
hunt_V2 = dirV2 (regV "jaga") ;
@@ -348,6 +348,7 @@ lin
wipe_V2 = dirV2 (regV "torka") ;
breathe_V = depV (regV "anda") ;
- fight_V2 = mkV2 (mkV "slåss" "slåss" "slåss" "slogs" "slagits" "slagen") "med" ;
+ fight_V2 =
+ mkV2 (mkV "slåss" "slåss" "slåss" "slogs" "slagits" "slagen") (mkPrep "med") ;
} ;
diff --git a/lib/resource-1.0/swedish/ParadigmsSwe.gf b/lib/resource-1.0/swedish/ParadigmsSwe.gf
index 4c98e8b56..287a76e4b 100644
--- a/lib/resource-1.0/swedish/ParadigmsSwe.gf
+++ b/lib/resource-1.0/swedish/ParadigmsSwe.gf
@@ -59,7 +59,8 @@ oper
-- Prepositions used in many-argument functions are just strings.
- Preposition : Type = Str ;
+ mkPrep : Str -> Prep ;
+ noPrep : Prep ; -- empty string
--2 Nouns
@@ -100,7 +101,7 @@ oper
--
-- Relational nouns ("daughter of x") need a preposition.
- mkN2 : N -> Preposition -> N2 ;
+ mkN2 : N -> Prep -> N2 ;
-- The most common preposition is "av", and the following is a
-- shortcut for regular, $nonhuman$ relational nouns with "av".
@@ -112,7 +113,7 @@ oper
--
-- Three-place relational nouns ("the connection from x to y") need two prepositions.
- mkN3 : N -> Preposition -> Preposition -> N3 ;
+ mkN3 : N -> Prep -> Prep -> N3 ;
--3 Relational common noun phrases
@@ -127,7 +128,8 @@ oper
--
-- Proper names, with a regular genitive, are formed as follows
- regPN : Str -> Gender -> PN ; -- John, John's
+ regGenPN : Str -> Gender -> PN ;
+ regPN : Str -> PN ; -- utrum
-- Sometimes you can reuse a common noun as a proper name, e.g. "Bank".
@@ -167,7 +169,7 @@ oper
--
-- Two-place adjectives need a preposition for their second argument.
- mkA2 : A -> Preposition -> A2 ;
+ mkA2 : A -> Prep -> A2 ;
--2 Adverbs
@@ -182,12 +184,6 @@ oper
mkAdA : Str -> AdA ;
---2 Prepositions
---
--- A preposition is just a string.
-
- mkPreposition : Str -> Preposition ;
-
--2 Verbs
--
-- The worst case needs five forms.
@@ -234,7 +230,7 @@ oper
-- Two-place verbs need a preposition, except the special case with direct object.
-- (transitive verbs). Notice that a particle comes from the $V$.
- mkV2 : V -> Preposition -> V2 ;
+ mkV2 : V -> Prep -> V2 ;
dirV2 : V -> V2 ;
@@ -243,8 +239,8 @@ oper
-- Three-place (ditransitive) verbs need two prepositions, of which
-- the first one or both can be absent.
- mkV3 : V -> Preposition -> Preposition -> V3 ; -- tala med om
- dirV3 : V -> Preposition -> V3 ; -- ge _ till
+ mkV3 : V -> Prep -> Prep -> V3 ; -- tala med om
+ dirV3 : V -> Prep -> V3 ; -- ge _ till
dirdirV3 : V -> V3 ; -- ge _ _
--3 Other complement patterns
@@ -254,18 +250,18 @@ oper
mkV0 : V -> V0 ;
mkVS : V -> VS ;
- mkV2S : V -> Str -> V2S ;
+ mkV2S : V -> Prep -> V2S ;
mkVV : V -> VV ;
- mkV2V : V -> Str -> Str -> V2V ;
+ mkV2V : V -> Prep -> Prep -> V2V ;
mkVA : V -> VA ;
- mkV2A : V -> Str -> V2A ;
+ mkV2A : V -> Prep -> V2A ;
mkVQ : V -> VQ ;
- mkV2Q : V -> Str -> V2Q ;
+ mkV2Q : V -> Prep -> V2Q ;
mkAS : A -> AS ;
- mkA2S : A -> Str -> A2S ;
+ mkA2S : A -> Prep -> A2S ;
mkAV : A -> AV ;
- mkA2V : A -> Str -> A2V ;
+ mkA2V : A -> Prep -> A2V ;
-- Notice: categories $V2S, V2V, V2A, V2Q$ are in v 1.0 treated
-- just as synonyms of $V2$, and the second argument is given
@@ -292,6 +288,9 @@ oper
nominative = Nom ;
genitive = Gen ;
+ mkPrep p = {s = p ; lock_Prep = <>} ;
+ noPrep = mkPrep [] ;
+
mkN = \apa,apan,apor,aporna -> {
s = nounForms apa apan apor aporna ;
g = case last apan of {
@@ -381,11 +380,12 @@ oper
} ;
- mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p} ;
- regN2 n g = mkN2 (regGenN n g) (mkPreposition "av") ;
- mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p ; c3 = q} ;
+ mkN2 = \n,p -> n ** {lock_N2 = <> ; c2 = p.s} ;
+ regN2 n g = mkN2 (regGenN n g) (mkPrep "av") ;
+ mkN3 = \n,p,q -> n ** {lock_N3 = <> ; c2 = p.s ; c3 = q.s} ;
- regPN n g = {s = \\c => mkCase c n ; 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 = <>} ;
mkNP x y n g =
{s = table {NPPoss _ => y ; _ => x} ; a = agrP3 g n ; p = P3 ;
@@ -413,14 +413,12 @@ oper
compoundA adj = {s = adj.s ; isComp = True ; lock_A = <>} ;
- mkA2 a p = a ** {c2 = p ; lock_A2 = <>} ;
+ mkA2 a p = a ** {c2 = p.s ; lock_A2 = <>} ;
mkAdv x = ss x ** {lock_Adv = <>} ;
mkAdV x = ss x ** {lock_AdV = <>} ;
mkAdA x = ss x ** {lock_AdA = <>} ;
- mkPreposition p = p ;
-
mkV = \finna,finner,finn,fann,funnit,funnen ->
let
funn = ptPretForms funnen ;
@@ -489,12 +487,12 @@ oper
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 v p = v ** {c2 = p ; lock_V2 = <>} ;
- dirV2 v = mkV2 v [] ;
+ mkV2 v p = v ** {c2 = p.s ; lock_V2 = <>} ;
+ dirV2 v = mkV2 v noPrep ;
- mkV3 v p q = v ** {c2 = p ; c3 = q ; lock_V3 = <>} ;
- dirV3 v p = mkV3 v [] p ;
- dirdirV3 v = dirV3 v [] ;
+ mkV3 v p q = v ** {c2 = p.s ; c3 = q.s ; lock_V3 = <>} ;
+ dirV3 v p = mkV3 v noPrep p ;
+ dirdirV3 v = dirV3 v noPrep ;
mkV0 v = v ** {lock_V0 = <>} ;
mkVS v = v ** {lock_VS = <>} ;
diff --git a/src/tools/GFDoc.hs b/src/tools/GFDoc.hs
index dcbd34092..91410864a 100644
--- a/src/tools/GFDoc.hs
+++ b/src/tools/GFDoc.hs
@@ -34,6 +34,7 @@ main = do
"-latex" : xs -> (0,doc2latex,xs)
"-htmls" : xs -> (2,doc2html,xs)
"-txt" : xs -> (3,doc2txt,xs)
+ "-txt2" : xs -> (3,doc2txt2,xs)
"-txthtml": xs -> (4,doc2txt,xs)
xs -> (1,doc2html,xs)
if null xx
@@ -292,6 +293,8 @@ preludeLatex = unlines $ [
]
-- render in txt2tags
+-- as main document (welcome, top-level subtitles)
+-- as chapter (no welcome, subtitle level + i)
doc2txt :: Doc -> String
doc2txt (Doc title time paras) = unlines $
@@ -306,17 +309,28 @@ doc2txt (Doc title time paras) = unlines $
concat (["Produced by " ++ welcome]) :
"\n" :
empty :
- map para2txt paras
+ map (para2txt 0) paras
-para2txt :: Paragraph -> String
-para2txt p = case p of
+doc2txt2 :: Doc -> String
+doc2txt2 (Doc title time paras) = unlines $
+ let tit = concat (map item2txt title) in
+ tit:
+ "":
+ concat (tagTxt (replicate 2 '=') [tit]):
+ "\n":
+ empty :
+ map (para2txt 2) paras
+
+para2txt :: Int -> Paragraph -> String
+para2txt j p = case p of
Text its -> concat (map item2txt its)
Item its -> "- " ++ concat (map item2txt its)
Code s -> unlines $ tagTxt "```" $ map (indent 2) $
remEmptyLines $ lines s
New -> "\n"
NewPage -> "\n" ++ "!-- NEW --"
- Heading i its -> concat $ tagTxt (replicate i '=') [concat (map item2txt its)]
+ Heading i its ->
+ concat $ tagTxt (replicate (i + j) '=') [concat (map item2txt its)]
item2txt :: TextItem -> String
item2txt i = case i of