diff --git a/lib/resource-1.0/doc/German.png b/lib/resource-1.0/doc/German.png new file mode 100644 index 000000000..ab16ef27e Binary files /dev/null and b/lib/resource-1.0/doc/German.png differ diff --git a/lib/resource-1.0/doc/Resource-HOWTO.html b/lib/resource-1.0/doc/Resource-HOWTO.html index 9a68e4788..f515c5d41 100644 --- a/lib/resource-1.0/doc/Resource-HOWTO.html +++ b/lib/resource-1.0/doc/Resource-HOWTO.html @@ -2,66 +2,54 @@ +Resource grammar writing HOWTO +

Resource grammar writing HOWTO

+Author: Aarne Ranta <aarne (at) cs.chalmers.se>
+Last update: Thu Jan 5 23:19:40 2006


-


-Resource grammar HOWTO -Author: Aarne Ranta <aarne (at) cs.chalmers.se> -Last update: Wed Jan 4 11:29:41 2006 -

- -

HOW TO WRITE A RESOURCE GRAMMAR

-

- Aarne Ranta -

-

- 20060104 -

-

The purpose of this document is to tell how to implement the GF resource grammar API for a new language. We will not cover how to use the resource grammar, nor how to change the API. But we @@ -74,7 +62,7 @@ in GF/lib/resource-1.0/. See the resource-1.0/README for details on how this differs from previous versions.

- +

The resource grammar API

The API is divided into a bunch of abstract modules. @@ -97,7 +85,7 @@ parent of the top module (Lang or Test). The idea is that you can concentrate on one linguistic aspect at a time, or also distribute the work among several authors.

- +

Phrase category modules

The direct parents of the top could be called phrase category modules, @@ -120,7 +108,7 @@ one of a small number of different types). Thus we have

  • Phrase: construction of the major units of text and speech - +

    Infrastructure modules

    Expressions of each phrase category are constructed in the corresponding @@ -163,7 +151,7 @@ modules: The full resource API (Lang) uses Tensed, whereas the restricted Test API uses Untensed.

    - +

    Lexical modules

    What is lexical and what is syntactic is not as clearcut in GF as in @@ -205,9 +193,9 @@ different languages on the level of a resource grammar. In other words, application grammars are likely to use the resource in different ways for different languages.

    - +

    Phases of the work

    - +

    Putting up a directory

    Unless you are writing an instance of a parametrized implementation @@ -260,21 +248,33 @@ of resource v. 1.0. This will give you a set of templates out of which the grammar will grow as you uncomment and modify the files rule by rule.

    -
  • In the file TestGer.gf, uncomment all lines except the list - of inherited modules. Now you can open the grammar in GF: +
  • In all .gf files, uncomment the module headers and brackets, + leaving the module bodies commented. Unfortunately, there is no + simple way to do this automatically (or to avoid commenting these + lines in the previous step) - but you uncommenting the first + and the last lines will actually do the job for many of the files. +

    +
  • Now you can open the grammar TestGer in GF:
              gf TestGer.gf
     
    + You will get lots of warnings on missing rules, but the grammar will compile.

    -
  • Now you will at all following steps have a valid, but incomplete +
  • At all following steps you will now have a valid, but incomplete GF grammar. The GF command
              pg -printer=missing
     
    tells you what exactly is missing. +

    +Here is the module structure of TestGer. It has been simplified by leaving out +the majority of the phrase category modules. Each of them has the same dependencies +as e.g. VerbGer. +

    + - +

    The develop-test cycle

    The real work starts now. The order in which the Phrase modules @@ -330,7 +330,14 @@ with the next one. Actually, a suitable subset of Noun, Verb, and Adjective will lead to a reasonable coverage very soon, keep you motivated, and reveal errors.

    - +

    +Here is a live log of the actual process of +building the German implementation of resource API v. 1.0. +It is the basis of the more detailed explanations, which will +follow soon. (You will found out that these explanations involve +a rational reconstruction of the live process!) +

    +

    Resource modules used

    These modules will be written by you. @@ -354,7 +361,7 @@ package.

  • Predefined: general-purpose operations with hard-coded definitions - +

    Morphology and lexicon

    When the implementation of Test is complete, it is time to @@ -434,7 +441,7 @@ These constants are defined in terms of parameter types and constructors in ResGer and MorphoGer, which modules are are not accessible to the application grammarian.

    - +

    Lock fields

    An important difference between MorphoGer and @@ -481,7 +488,7 @@ in her hidden definitions of constants in Paradigms. For instance, -- mkAdv s = {s = s ; lock_Adv = <>} ;

    - +

    Lexicon construction

    The lexicon belonging to LangGer consists of two modules: @@ -501,17 +508,17 @@ the coverage of the paradigms gets thereby tested and that the use of the paradigms in BasicGer gives a good set of examples for those who want to build new lexica.

    - +

    Inside phrase category modules

    - +

    Noun

    - +

    Verb

    - +

    Adjective

    - +

    Lexicon extension

    - +

    The irregularity lexicon

    It may be handy to provide a separate module of irregular @@ -521,7 +528,7 @@ few hundred perhaps. Building such a lexicon separately also makes it less important to cover everything by the worst-case paradigms (mkV etc).

    - +

    Lexicon extraction from a word list

    You can often find resources such as lists of @@ -556,7 +563,7 @@ When using ready-made word lists, you should think about coyright issues. Ideally, all resource grammar material should be provided under GNU General Public License.

    - +

    Lexicon extraction from raw text data

    This is a cheap technique to build a lexicon of thousands @@ -564,7 +571,7 @@ of words, if text data is available in digital format. See the Functional Morphology homepage for details.

    - +

    Extending the resource grammar API

    Sooner or later it will happen that the resource grammar API @@ -573,7 +580,7 @@ that it does not include idiomatic expressions in a given language. The solution then is in the first place to build language-specific extension modules. This chapter will deal with this issue.

    - +

    Writing an instance of parametrized resource grammar implementation

    Above we have looked at how a resource implementation is built by @@ -591,7 +598,7 @@ use parametrized modules. The advantages are In this chapter, we will look at an example: adding Portuguese to the Romance family.

    - +

    Parametrizing a resource grammar implementation

    This is the most demanding form of resource grammar writing. @@ -607,6 +614,6 @@ This chapter will work out an example of how an Estonian grammar is constructed from the Finnish grammar through parametrization.

    - + diff --git a/lib/resource-1.0/doc/Resource-HOWTO.txt b/lib/resource-1.0/doc/Resource-HOWTO.txt index 93af780da..72d9acbb5 100644 --- a/lib/resource-1.0/doc/Resource-HOWTO.txt +++ b/lib/resource-1.0/doc/Resource-HOWTO.txt @@ -1,5 +1,4 @@ - -Resource grammar HOWTO +Resource grammar writing HOWTO Author: Aarne Ranta Last update: %%date(%c) @@ -10,23 +9,12 @@ Last update: %%date(%c) %!target:html - =HOW TO WRITE A RESOURCE GRAMMAR= - - - - [Aarne Ranta http://www.cs.chalmers.se/~aarne/] - - %%Date - - - The purpose of this document is to tell how to implement the GF resource grammar API for a new language. We will //not// cover how to use the resource grammar, nor how to change the API. But we will give some hints how to extend the API. - **Notice**. This document concerns the API v. 1.0 which has not yet been released. You can find the beginnings of it in [``GF/lib/resource-1.0/`` ..]. See the @@ -240,7 +228,11 @@ of resource v. 1.0. ``` tells you what exactly is missing. +Here is the module structure of ``TestGer``. It has been simplified by leaving out +the majority of the phrase category modules. Each of them has the same dependencies +as e.g. ``VerbGer``. +[German.png] ===The develop-test cycle=== @@ -298,6 +290,13 @@ with the next one. Actually, a suitable subset of ``Noun``, very soon, keep you motivated, and reveal errors. +Here is a [live log ../german/log.txt] of the actual process of +building the German implementation of resource API v. 1.0. +It is the basis of the more detailed explanations, which will +follow soon. (You will found out that these explanations involve +a rational reconstruction of the live process!) + + ===Resource modules used=== These modules will be written by you.