diff --git a/doc/Resource-HOWTO.html b/deprecated/Resource-HOWTO.html similarity index 100% rename from doc/Resource-HOWTO.html rename to deprecated/Resource-HOWTO.html diff --git a/doc/Resource-HOWTO.txt b/deprecated/Resource-HOWTO.txt similarity index 100% rename from doc/Resource-HOWTO.txt rename to deprecated/Resource-HOWTO.txt diff --git a/doc/Syntax.png b/deprecated/Syntax.png similarity index 100% rename from doc/Syntax.png rename to deprecated/Syntax.png diff --git a/doc/2341.html b/deprecated/doc/2341.html similarity index 100% rename from doc/2341.html rename to deprecated/doc/2341.html diff --git a/doc/DocGF.pdf b/deprecated/doc/DocGF.pdf similarity index 100% rename from doc/DocGF.pdf rename to deprecated/doc/DocGF.pdf diff --git a/doc/DocGF.tex b/deprecated/doc/DocGF.tex similarity index 100% rename from doc/DocGF.tex rename to deprecated/doc/DocGF.tex diff --git a/doc/German.png b/deprecated/doc/German.png similarity index 100% rename from doc/German.png rename to deprecated/doc/German.png diff --git a/doc/Grammar.dot b/deprecated/doc/Grammar.dot similarity index 100% rename from doc/Grammar.dot rename to deprecated/doc/Grammar.dot diff --git a/doc/Grammar.png b/deprecated/doc/Grammar.png similarity index 100% rename from doc/Grammar.png rename to deprecated/doc/Grammar.png diff --git a/doc/TODO b/deprecated/doc/TODO similarity index 100% rename from doc/TODO rename to deprecated/doc/TODO diff --git a/doc/compiling-gf.txt b/deprecated/doc/compiling-gf.txt similarity index 100% rename from doc/compiling-gf.txt rename to deprecated/doc/compiling-gf.txt diff --git a/doc/eu-langs.dot b/deprecated/doc/eu-langs.dot similarity index 100% rename from doc/eu-langs.dot rename to deprecated/doc/eu-langs.dot diff --git a/doc/eu-langs.png b/deprecated/doc/eu-langs.png similarity index 100% rename from doc/eu-langs.png rename to deprecated/doc/eu-langs.png diff --git a/doc/food-translet.png b/deprecated/doc/food-translet.png similarity index 100% rename from doc/food-translet.png rename to deprecated/doc/food-translet.png diff --git a/doc/food1.png b/deprecated/doc/food1.png similarity index 100% rename from doc/food1.png rename to deprecated/doc/food1.png diff --git a/doc/food2.png b/deprecated/doc/food2.png similarity index 100% rename from doc/food2.png rename to deprecated/doc/food2.png diff --git a/doc/gf-compiler.dot b/deprecated/doc/gf-compiler.dot similarity index 100% rename from doc/gf-compiler.dot rename to deprecated/doc/gf-compiler.dot diff --git a/doc/gf-compiler.png b/deprecated/doc/gf-compiler.png similarity index 100% rename from doc/gf-compiler.png rename to deprecated/doc/gf-compiler.png diff --git a/doc/gf-formalism.html b/deprecated/doc/gf-formalism.html similarity index 100% rename from doc/gf-formalism.html rename to deprecated/doc/gf-formalism.html diff --git a/doc/gf-formalism.txt b/deprecated/doc/gf-formalism.txt similarity index 100% rename from doc/gf-formalism.txt rename to deprecated/doc/gf-formalism.txt diff --git a/doc/gf-ideas.html b/deprecated/doc/gf-ideas.html similarity index 100% rename from doc/gf-ideas.html rename to deprecated/doc/gf-ideas.html diff --git a/doc/gf-ideas.txt b/deprecated/doc/gf-ideas.txt similarity index 100% rename from doc/gf-ideas.txt rename to deprecated/doc/gf-ideas.txt diff --git a/doc/gf-statistics.txt b/deprecated/doc/gf-statistics.txt similarity index 100% rename from doc/gf-statistics.txt rename to deprecated/doc/gf-statistics.txt diff --git a/doc/gf-summerschool.txt b/deprecated/doc/gf-summerschool.txt similarity index 100% rename from doc/gf-summerschool.txt rename to deprecated/doc/gf-summerschool.txt diff --git a/doc/gf3-release.html b/deprecated/doc/gf3-release.html similarity index 100% rename from doc/gf3-release.html rename to deprecated/doc/gf3-release.html diff --git a/doc/gf3-release.txt b/deprecated/doc/gf3-release.txt similarity index 100% rename from doc/gf3-release.txt rename to deprecated/doc/gf3-release.txt diff --git a/doc/school-langs.dot b/deprecated/doc/school-langs.dot similarity index 100% rename from doc/school-langs.dot rename to deprecated/doc/school-langs.dot diff --git a/doc/school-langs.png b/deprecated/doc/school-langs.png similarity index 100% rename from doc/school-langs.png rename to deprecated/doc/school-langs.png diff --git a/doc/summer-align.png b/deprecated/doc/summer-align.png similarity index 100% rename from doc/summer-align.png rename to deprecated/doc/summer-align.png diff --git a/doc/summer-langs.png b/deprecated/doc/summer-langs.png similarity index 100% rename from doc/summer-langs.png rename to deprecated/doc/summer-langs.png diff --git a/doc/vr.html b/deprecated/doc/vr.html similarity index 100% rename from doc/vr.html rename to deprecated/doc/vr.html diff --git a/doc/vr.txt b/deprecated/doc/vr.txt similarity index 100% rename from doc/vr.txt rename to deprecated/doc/vr.txt diff --git a/doc/gf-people.html b/doc/gf-people.html index 690084d3c..bc09412d0 100644 --- a/doc/gf-people.html +++ b/doc/gf-people.html @@ -13,12 +13,13 @@ -Most of the code is by -Krasimir Angelov, -Björn Bringert, +The current developers and maintainers are +Krasimir Angelov, +Thomas Hallgren, and -Aarne Ranta. Bug reports should be -posted via the GF bug tracker. +Aarne Ranta. Bug reports should be +posted via the +GF bug tracker.

@@ -27,19 +28,23 @@ Also the following people have contributed code to some of the versions:

-Håkan Burden (Chalmers) +Grégoire Détrez (University of Gothenburg) +
+Ramona Enache (University of Gothenburg) +
+Björn Bringert (University of Gothenburg) +
+Håkan Burden (University of Gothenburg)
Hans-Joachim Daniels (Karlsruhe)
Markus Forsberg (Chalmers)
-Thomas Hallgren (Chalmers) +Kristofer Johannisson (University of Gothenburg)
-Kristofer Johannisson (Chalmers) +Janna Khegai (Chalmers)
-Janna Khegai (Chalmers) -
-Peter Ljunglöf (Chalmers) +Peter Ljunglöf (University of Gothenburg)
Petri Mäenpää (Nokia) diff --git a/doc/gf-quickstart.html b/doc/gf-quickstart.html index 7a6971953..cd508d474 100644 --- a/doc/gf-quickstart.html +++ b/doc/gf-quickstart.html @@ -9,7 +9,7 @@

Aarne Ranta

-3 September, 2007 +22 December 2010 (3 September, 2007)

@@ -20,7 +20,7 @@ Aarne Ranta This Quick Start shows two examples of how GF can be used. We assume that you have downloaded and installed GF, so that the command gf works for you. See download and install -instructions here. +instructions here. @@ -61,39 +61,11 @@ and start GF again with the same command. Now you can even translate this bread is very Italian. To lear more on GF commands and -grammar development, go to the -New Grammarian's Tutorial. +grammar development, go to the one of the tutorials: +

- -

Multilingual authoring

- -This demo also requires the GUI package, which makes the command -jgf work for you. -
    -
  1. Download the file Letter.gfcm. -
  2. Start the GF editor by the command -
    -  gfeditor Letter.gfcm
    -
    -
  3. When the editor window is open, select "Letter" from the "New" menu. -
  4. Push the button "Random" in the lower end of the window. -
  5. Move the pointer to some place in the text, e.g. to the first word (in any - of the languages), and click. The first word should now be highlighted and - a number of alternatives appear in the lower window part (a similar situation - is shown in the picture below). -
  6. Double-click at some of the alternatives marked "ch ..." and observe how - the text changes in each of the languages. -
-See the Editor User Manual -for more information on how to use the -editor. To change the grammars, you should not edit Letter.gfcm, -which is low-level code generated by the GF grammar compiler. Instead, you -can edit the files in examples/letter in the GF grammar package, -and compile by using the script mkLetter.gfs in the same package. - -

- - - diff --git a/doc/gf-refman.html b/doc/gf-refman.html index 104f644c7..188a063a8 100644 --- a/doc/gf-refman.html +++ b/doc/gf-refman.html @@ -106,7 +106,7 @@ This document is not an introduction to GF; such introduction can be found in the GF tutorial available on line on the GF web page,

-digitalgrammars.com/gf +grammaticalframework.org

This manual covers only the language, not the GF compiler or diff --git a/doc/index.html b/doc/index.html index e4aa842ff..f6bbf7f1a 100644 --- a/doc/index.html +++ b/doc/index.html @@ -13,28 +13,20 @@

Grammatical Framework Documents

-Top-3 documents: -Tutorial - -| - -ReferenceManual - -| - -LibrarySynopsis - - - -

Tutorials

+Top-5 documents: Quick start instruction. -

-GF Tutorial, -Now up-to-date for GF version 2.9. Covers all of GF. +Old Tutorial, application-oriented. + +New Tutorial, linguistics-oriented. + +ReferenceManual. + +LibrarySynopsis. + @@ -49,144 +41,13 @@ in a summary format. GF Reference Manual. A full-scale reference manual of the GF language. -

- - -User Manual explaining the GF user interfaces and command language (slightly -outdated). - -

- -Editor User Manual -on editing in the Java interface. - -

- -Chart of GF grammar compiler phases. -

Grammar library documentation

- -Resource Grammar Tutorial Chapter. - -

- -Resource Grammar Synopsis -for library users. With APIs and use examples. - -

- - -Resource Grammar HOWTO -for library authors. - - - - -

Embedding GF grammars in computer programs

- -Embedded Grammar Tutorial Chapter. - -

- - -Embedded GF Interpreter manual for using GF grammars in Java programs. - -

- - -Embedded GF API for using GF grammars in Haskell programs. - -

- - -MCFG/GF library for Prolog, -for using GF grammars in Prolog programs. - - - -

Theoretical studies

- - -Grammatical Framework: A Type-Theoretical -Grammar Formalism (ps.gz). Theoretical paper on GF by A. Ranta. A later -version appeared -in The Journal of Functional Programming, vol. 14:2. 2004, pp. 145-189. -The standard reference on GF. - -

- - -Expressivity and Complexity of the Grammatical Framework, -PhD Thesis by -Peter Ljunglöf. - - - -

Introductory talks

- - -GF in 25 Minutes - overview for computer science audience. - -

- - - -Slides on GF theory and implementation given -at INRIA Rocquencourt in December 2003. - -

- - -Slides on example-based grammar writing and a short introduction -to GF grammars. - -

- - -Course notes on Natural Language Technology, includes -slides on using GF. - - - -

Examples and applications

- - -Formal and Informal Software Specifications, -PhD Thesis by -Kristofer Johannisson. - - -

- - -Embedded grammars, -Master's thesis by -Björn Bringert - -

- -Demo film -of a multimodal dialogue system built with embedded grammars. - - -

- - -GFCC (pdf): -report on a compiler from a fragment of C to JVM, written in GF. - - - -

More

+

Publications

-Bibliography: -more publications on GF, as well as background literature. +Bibliography: more publications on GF, as well as background literature. diff --git a/doc/10lang-small.png b/doc/tutorial/10lang-small.png similarity index 100% rename from doc/10lang-small.png rename to doc/tutorial/10lang-small.png diff --git a/doc/categories.png b/doc/tutorial/categories.png similarity index 100% rename from doc/categories.png rename to doc/tutorial/categories.png diff --git a/doc/food-js.png b/doc/tutorial/food-js.png similarity index 100% rename from doc/food-js.png rename to doc/tutorial/food-js.png diff --git a/doc/food-magnet.png b/doc/tutorial/food-magnet.png similarity index 100% rename from doc/food-magnet.png rename to doc/tutorial/food-magnet.png diff --git a/doc/foodmarket.png b/doc/tutorial/foodmarket.png similarity index 100% rename from doc/foodmarket.png rename to doc/tutorial/foodmarket.png diff --git a/doc/gf-tutorial.html b/doc/tutorial/gf-tutorial.html similarity index 89% rename from doc/gf-tutorial.html rename to doc/tutorial/gf-tutorial.html index 230152005..46b17b96b 100644 --- a/doc/gf-tutorial.html +++ b/doc/tutorial/gf-tutorial.html @@ -8,264 +8,12 @@

Grammatical Framework Tutorial

Aarne Ranta
-Version 3.1.2, November 2008 +December 2010 (November 2008)
-

-
-

- - -

-
-

-

Overview

This is a hands-on introduction to grammar writing in GF. @@ -292,7 +40,6 @@ Prerequisites:

-

Outline

Lesson 1: a multilingual "Hello World" grammar. English, Finnish, Italian. @@ -319,7 +66,6 @@ and semantic definitions.

-

Slides

You can chop this tutorial into a set of slides by the command @@ -331,7 +77,7 @@ You can chop this tutorial into a set of slides by the command where the program htmls is distributed with GF (see below), in

- GF/src/tools/Htmls.hs + GF/src/tools/Htmls.hs

The slides will appear as a set of files beginning with 01-gf-tutorial.htmls. @@ -343,7 +89,6 @@ upper left corner of each slide, and the links behind the "Contents" link.

-

Lesson 1: Getting Started with GF

@@ -360,7 +105,6 @@ Goals:

-

What GF is

We use the term GF for three different things: @@ -389,7 +133,6 @@ using the GF system.

-

GF grammars and language processing tasks

A GF program is called a grammar. @@ -417,13 +160,12 @@ In general, a GF grammar is multilingual:

-

Getting the GF system

Open-source free software, downloaded via the GF Homepage:

-digitalgrammars.com/gf +grammaticalframework.org

There you find @@ -436,17 +178,16 @@ There you find

Many examples in this tutorial are -online. +online.

Normally you don't have to compile GF yourself. But, if you do want to compile GF from source follow the -instructions in the Developers Guide. +instructions in the Developers Guide.

-

Running the GF system

Type gf in the Unix (or Cygwin) shell: @@ -479,7 +220,6 @@ follow them.

-

A "Hello World" grammar

Like most programming language tutorials, we start with a @@ -497,7 +237,6 @@ Extra features:

-

The program: abstract syntax and concrete syntaxes

A GF program, in general, is a multilingual grammar. Its main parts @@ -617,7 +356,6 @@ Finnish and an Italian concrete syntaxes:

-

Using grammars in the GF system

In order to compile the grammar in GF, @@ -724,7 +462,6 @@ Linearization is by default to all available languages.

-

Exercises on the Hello World grammar

  1. Test the parsing and translation examples shown above, as well as @@ -754,7 +491,6 @@ of a variable. Inspect the error messages generated by GF.

    -

    Using grammars from outside GF

    You can use the gf program in a Unix pipe. @@ -780,7 +516,6 @@ You can also write a script, a file containing the lines

    -

    GF scripts

    If we name this script hello.gfs, we can do @@ -806,7 +541,6 @@ translation to the output.

    -

    What else can be done with the grammar

    Some more functions that will be covered: @@ -825,7 +559,6 @@ Some more functions that will be covered:

    -

    Embedded grammar applications

    Application programs, using techniques from Lesson 7: @@ -847,7 +580,6 @@ Application programs, using techniques from Lesson 7:

    -

    Lesson 2: Designing a grammar for complex phrases

    @@ -864,7 +596,6 @@ Goals:

    -

    The abstract syntax Food

    Phrases usable for speaking about food: @@ -912,7 +643,6 @@ Example Phrase

    -

    The concrete syntax FoodEng

         concrete FoodEng of Food = {
    @@ -960,7 +690,6 @@ Parse in other categories setting the cat flag:
     

    -

    Exercises on the Food grammar

    1. Extend the Food grammar by ten new food kinds and @@ -977,9 +706,7 @@ the prefix can occur at most once.

      -

      Commands for testing grammars

      -

      Generating trees and strings

      Random generation (generate_random = gr): build @@ -1041,7 +768,6 @@ What options a command has can be seen by the help = h command:

      -

      Exercises on generation

      1. If the command gt generated all @@ -1055,7 +781,6 @@ use the Unix word count command wc to count lines.

        -

        More on pipes: tracing

        Put the tracing option -tr to each command whose output you @@ -1080,7 +805,6 @@ strings, and try out the ambiguity test.

        -

        Writing and reading files

        To save the outputs into a file, pipe it to the write_file = wf command, @@ -1105,7 +829,6 @@ of grammars - the most systematic way to do this is by

        -

        Visualizing trees

        Parentheses give a linear representation of trees, @@ -1148,7 +871,6 @@ program (from the Graphviz package).

        -

        System commands

        You can give a system command without leaving GF: @@ -1177,7 +899,6 @@ a system pipe from a GF command into a Unix command.

        -

        An Italian concrete syntax

        @@ -1232,7 +953,6 @@ which are introduced in Lesson 3.)

        -

        Exercises on multilinguality

        1. Write a concrete syntax of Food for some other language. @@ -1250,7 +970,6 @@ after having worked out Lesson 3.

          -

          Free variation

          Semantically indistinguishable ways of expressing a thing. @@ -1298,9 +1017,7 @@ a variant list must be of the same type.

          -

          More application of multilingual grammars

          -

          Multilingual treebanks

          @@ -1324,7 +1041,6 @@ linearizations in different languages:

          -

          Translation quiz

          translation_quiz = tq: @@ -1356,9 +1072,7 @@ answer given in another language.

          -

          Context-free grammars and GF

          -

          The "cf" grammar format

          The grammar FoodEng can be written in a BNF format as follows: @@ -1392,7 +1106,6 @@ The compiler creates separate abstract and concrete modules internally.

          -

          Restrictions of context-free grammars

          Separating concrete and abstract syntax allows @@ -1411,7 +1124,6 @@ copy language {x x | x <- (a|b)*} in GF.

          -

          Modules and files

          GF uses suffixes to recognize different file formats: @@ -1457,9 +1169,7 @@ a second time? Try this in different situations:

          -

          Using operations and resource modules

          -

          Operation definitions

          The golden rule of functional programmin: @@ -1521,7 +1231,6 @@ sugar for abstraction:

          -

          The ``resource`` module type

          The resource module type is used to package @@ -1540,7 +1249,6 @@ The resource module type is used to package

          -

          Opening a resource

          Any number of resource modules can be @@ -1573,7 +1281,6 @@ Any number of resource modules can be

          -

          Partial application

          @@ -1611,7 +1318,6 @@ such that it allows you to write

          -

          Testing resource modules

          Import with the flag -retain, @@ -1630,12 +1336,10 @@ Compute the value with compute_concrete = cc,

          -

          Grammar architecture

          -

          Extending a grammar

          A new module can extend an old one: @@ -1691,7 +1395,6 @@ possible to build resource hierarchies.

          -

          Multiple inheritance

          Extend several grammars at the same time: @@ -1725,7 +1428,6 @@ where

          -

          Lesson 3: Grammars with parameters

          @@ -1754,7 +1456,6 @@ could be left to library implementors.

          -

          The problem: words have to be inflected

          Plural forms are needed in things like @@ -1787,7 +1488,6 @@ adjectives, and verbs can have in some languages that you know.

          -

          Parameters and tables

          We define the parameter type of number in English by @@ -1898,7 +1598,6 @@ module, which you can test by using the command compute_concrete.

          -

          Inflection tables and paradigms

          A morphological paradigm is a formula telling how a class of @@ -1950,7 +1649,6 @@ uses a wild card pattern _.

          -

          Exercises on morphology

          1. Identify cases in which the regNoun paradigm does not @@ -1963,7 +1661,6 @@ considered in earlier exercises.

            -

            Using parameters in concrete syntax

            Purpose: a more radical @@ -1988,7 +1685,6 @@ This will force us to deal with gender-

            -

            Agreement

            In English, the phrase-forming rule @@ -2030,7 +1726,6 @@ Now we can write

            -

            Determiners

            How does an Item subject receive its number? The rules @@ -2100,7 +1795,6 @@ In a more lexicalized grammar, determiners would be a category:

            -

            Parametric vs. inherent features

            Kinds have number as a parametric feature: both singular and plural @@ -2168,7 +1862,6 @@ Notice

            -

            An English concrete syntax for Foods with parameters

            We use some string operations from the library Prelude are used. @@ -2233,7 +1926,6 @@ We use some string operations from the library Prelude are used.

            -

            More on inflection paradigms

            @@ -2247,7 +1939,6 @@ add words to a lexicon.

            -

            Worst-case functions

            We perform data abstraction from the type @@ -2337,7 +2028,6 @@ parameters.

            -

            Smart paradigms

            The regular dog-dogs paradigm has @@ -2404,7 +2094,6 @@ the suffix "oo" prevents bamboo from matching the suffix

            -

            Exercises on regular patterns

            1. The same rules that form plural nouns in English also @@ -2429,7 +2118,6 @@ operation to see whether it correctly changes Arzt to

              -

              Function types with variables

              In Lesson 5, dependent function types need a notation @@ -2485,7 +2173,6 @@ looking like the expected forms:

              -

              Separating operation types and definitions

              In librarues, it is useful to group type signatures separately from @@ -2505,7 +2192,6 @@ With the interface and instance module types

              -

              Overloading of operations

              Overloading: different functions can be given the same name, as e.g. in C++. @@ -2547,7 +2233,6 @@ an overload group.

              -

              Morphological analysis and morphology quiz

              The command morpho_analyse = ma @@ -2561,7 +2246,7 @@ can be used to read a text and return for each word its analyses The command morpho_quiz = mq generates inflection exercises.

              -    % gf -path=alltenses:prelude $GF_LIB_PATH/alltenses/IrregFre.gfc
              +    % gf -path=alltenses:prelude $GF_LIB_PATH/alltenses/IrregFre.gfo
                 
                   > morpho_quiz -cat=V
                 
              @@ -2584,7 +2269,6 @@ To create a list for later use, use the command morpho_list = ml
               

              -

              The Italian Foods grammar

              @@ -2722,7 +2406,6 @@ The complete set of linearization rules:

              -

              Exercises on using parameters

              1. Experiment with multilingual generation and translation in the @@ -2742,7 +2425,6 @@ now aiming for complete grammatical correctness by the use of parameters.

                -

                Discontinuous constituents

                A linearization record may contain more strings than one, and those @@ -2780,7 +2462,6 @@ but can be defined in GF by using discontinuous constituents.

                -

                Strings at compile time vs. run time

                Tokens are created in the following ways: @@ -2839,7 +2520,6 @@ This topic will be covered in here.

                -

                Supplementary constructs for concrete syntax

                Record extension and subtyping

                @@ -2901,7 +2581,6 @@ Thus

                -

                Lesson 4: Using the resource grammar library

                @@ -2918,7 +2597,6 @@ Goals:

                -

                The coverage of the library

                The current 12 resource languages are @@ -2945,7 +2623,6 @@ The first three letters (Eng etc) are used in grammar module names

                -

                The structure of the library

                @@ -2967,7 +2644,6 @@ wider coverage than with semantic grammars.

                -

                Lexical vs. phrasal rules

                A resource grammar has two kinds of categories and two kinds of rules: @@ -2995,7 +2671,6 @@ But it is a good discipline to follow.

                -

                Lexical categories

                Two kinds of lexical categories: @@ -3028,7 +2703,6 @@ Two kinds of lexical categories:

                -

                Lexical rules

                Closed classes: module Syntax. In the Foods grammar, we need @@ -3061,7 +2735,6 @@ where we use mkN from ParadigmsEng:

                -

                Resource lexicon

                Alternative concrete syntax for @@ -3092,7 +2765,6 @@ Advantages:

                -

                Phrasal categories

                In Foods, we need just four phrasal categories: @@ -3113,7 +2785,6 @@ Common nouns are made into noun phrases by adding determiners.

                -

                Syntactic combinations

                We need the following combinations: @@ -3142,7 +2813,6 @@ Heavy overloading: the current library

                -

                Example syntactic combination

                The sentence @@ -3168,7 +2838,6 @@ this syntactic tree gives the value of linearizing the semantic tree

                -

                The resource API

                Language-specific and language-independent parts - roughly, @@ -3185,12 +2854,11 @@ Language-specific and language-independent parts - roughly, Full API documentation on-line: the resource synopsis,

                -digitalgrammars.com/gf/lib/resource/doc/synopsis.html +grammaticalframework.org/lib/resource/doc/synopsis.html

                -

                A miniature resource API: categories

                @@ -3248,7 +2916,6 @@ Full API documentation on-line: the resource synopsis,

                -

                A miniature resource API: rules

                @@ -3296,7 +2963,6 @@ Full API documentation on-line: the resource synopsis,

                -

                A miniature resource API: structural words

                @@ -3334,7 +3000,6 @@ Full API documentation on-line: the resource synopsis,

                -

                A miniature resource API: paradigms

                From ParadigmsEng: @@ -3379,7 +3044,6 @@ From ParadigmsIta:

                -

                A miniature resource API: more paradigms

                From ParadigmsGer: @@ -3444,7 +3108,6 @@ From ParadigmsFin:

                -

                Exercises

                1. Try out the morphological paradigms in different languages. Do @@ -3459,7 +3122,6 @@ as follows:

                -

                Example: English

                @@ -3493,7 +3155,6 @@ Thus the beginning of the module is

                -

                English example: linearization types and combination rules

                As linearization types, we use clauses for Phrase, noun phrases @@ -3523,7 +3184,6 @@ Now the combination rules we need almost write themselves automatically:

                -

                English example: lexical rules

                We use resource paradigms and lexical insertion rules. @@ -3549,7 +3209,6 @@ The two-place noun paradigm is needed only once, for

                -

                English example: exercises

                1. Compile the grammar FoodsEng and generate @@ -3564,12 +3223,10 @@ grammars presented earlier in this tutorial.

                -

                Functor implementation of multilingual grammars

                -

                New language by copy and paste

                If you write a concrete syntax of Foods for some other @@ -3600,7 +3257,6 @@ Can we avoid this programming by copy-and-paste?

                -

                Functors: functions on the module level

                Functors familiar from the functional programming languages ML and OCaml, @@ -3645,7 +3301,6 @@ we can write a functor instantiation,

                -

                Code for the Foods functor

                     --# -path=.:../foods
                @@ -3681,7 +3336,6 @@ we can write a functor instantiation,
                 

                -

                Code for the LexFoods interface

                @@ -3705,7 +3359,6 @@ we can write a functor instantiation,

                -

                Code for a German instance of the lexicon

                     instance LexFoodsGer of LexFoods = open SyntaxGer, ParadigmsGer in {
                @@ -3726,7 +3379,6 @@ we can write a functor instantiation,
                 

                -

                Code for a German functor instantiation

                     --# -path=.:../foods:present
                @@ -3739,7 +3391,6 @@ we can write a functor instantiation,
                 

                -

                Adding languages to a functor implementation

                Just two modules are needed: @@ -3765,7 +3416,6 @@ language:

                -

                Example: adding Finnish

                Lexicon instance @@ -3799,7 +3449,6 @@ Functor instantiation

                -

                A design pattern

                This can be seen as a design pattern for multilingual grammars: @@ -3822,7 +3471,6 @@ Of the hand-written modules, only LexDomainL is language-dependent.

                -

                Functors: exercises

                1. Compile and test FoodsGer. @@ -3863,9 +3511,7 @@ The implementation goes in the following phases:

                -

                Restricted inheritance

                -

                A problem with functors

                Problem: a functor only works when all languages use the resource Syntax @@ -3895,7 +3541,6 @@ Problem with this solution:

                -

                Restricted inheritance: include or exclude

                A module may inherit just a selection of names. @@ -3916,7 +3561,6 @@ A concrete syntax of Foodmarket must make the analogous restriction

                -

                The functor problem solved

                The English instantiation inherits the functor @@ -3938,7 +3582,6 @@ is defined in the body instead:

                -

                Grammar reuse

                Abstract syntax modules can be used as interfaces, @@ -3960,7 +3603,6 @@ The following correspondencies are then applied:

                -

                Library exercises

                1. Find resource grammar terms for the following @@ -3985,7 +3627,6 @@ Then translate the phrases to other languages.

                -

                Tenses

                @@ -4077,7 +3718,6 @@ tenses and moods, e.g. the Romance languages.

                -

                Lesson 5: Refining semantics in abstract syntax

                @@ -4105,7 +3745,6 @@ GF = logical framework + concrete syntax.

                -

                Dependent types

                @@ -4133,7 +3772,6 @@ defines voice commands for household appliances.

                -

                A dependent type system

                Ontology: @@ -4162,7 +3800,6 @@ Abstract syntax formalizing this:

                -

                Examples of devices and actions

                Assume the kinds light and fan, @@ -4195,7 +3832,6 @@ but we cannot form the trees

                -

                Linearization and parsing with dependent types

                Concrete syntax does not know if a category is a dependent type. @@ -4238,7 +3874,6 @@ to mark incomplete parts of trees in the syntax editor.

                -

                Solving metavariables

                Use the command put_tree = pt with the option -typecheck: @@ -4261,7 +3896,6 @@ is shown and no tree is returned:

                -

                Polymorphism

                @@ -4294,7 +3928,6 @@ to express Haskell-type library functions:

                -

                Dependent types: exercises

                1. Write an abstract syntax module with above contents @@ -4311,7 +3944,6 @@ and an appropriate English concrete syntax. Try to parse the commands

                -

                Proof objects

                Curry-Howard isomorphism = propositions as types principle: @@ -4356,7 +3988,6 @@ Example: the fact that 2 is less that 4 has the proof object

                -

                Proof-carrying documents

                Idea: to be semantically well-formed, the abstract syntax of a document @@ -4400,7 +4031,6 @@ A legal connection is formed by the function

                -

                Restricted polymorphism

                Above, all Actions were either of @@ -4425,7 +4055,6 @@ The notion of class uses the Curry-Howard isomorphism as follows:

                -

                Example: classes for switching and dimming

                We modify the smart house grammar: @@ -4448,7 +4077,6 @@ Classes for new actions can be added incrementally.

                -

                Variable bindings

                @@ -4482,7 +4110,6 @@ Examples from informal mathematical language:

                -

                Higher-order abstract syntax

                Abstract syntax can use functions as arguments: @@ -4520,7 +4147,6 @@ expressed using higher-order syntactic constructors.

                -

                Higher-order abstract syntax: linearization

                HOAS has proved to be useful in the semantics and computer implementation of @@ -4554,7 +4180,6 @@ If there are more bindings, we add $1, $2, etc.

                -

                Eta expansion

                To make sense of linearization, syntax trees must be @@ -4603,7 +4228,6 @@ The linearization of the variable x is,

                -

                Parsing variable bindings

                GF can treat any one-word string as a variable symbol. @@ -4623,7 +4247,6 @@ Variables must be bound if they are used:

                -

                Exercises on variable bindings

                1. Write an abstract syntax of the whole @@ -4642,7 +4265,6 @@ guarantee non-ambiguity.

                -

                Semantic definitions

                @@ -4681,7 +4303,6 @@ The key word is def:

                -

                Computing a tree

                Computation: follow a chain of definition until no definition @@ -4707,7 +4328,6 @@ Computation in GF is performed with the put_term command and the

                -

                Definitional equality

                Two trees are definitionally equal if they compute into the same tree. @@ -4735,7 +4355,6 @@ so that an object of one also is an object of the other.

                -

                Judgement forms for constructors

                The judgement form data tells that a category has @@ -4765,7 +4384,6 @@ marked as data will be treated as variables.

                -

                Exercises on semantic definitions

                1. Implement an interpreter of a small functional programming @@ -4781,7 +4399,6 @@ Type checking can be invoked with put_term -transform=solve.

                -

                Lesson 6: Grammars of formal languages

                @@ -4798,7 +4415,6 @@ Goals:

                -

                Arithmetic expressions

                We construct a calculator with addition, subtraction, multiplication, and @@ -4829,7 +4445,6 @@ grammars are not allowed to declare functions with Int as value typ

                -

                Concrete syntax: a simple approach

                We begin with a @@ -4871,7 +4486,6 @@ First problems:

                -

                Lexing and unlexing

                @@ -4924,7 +4538,6 @@ In linearization, we use a corresponding unlexer:

                -

                Most common lexers and unlexers

                @@ -4962,7 +4575,6 @@ In linearization, we use a corresponding unlexer:

                -

                Precedence and fixity

                Arithmetic expressions should be unambiguous. If we write @@ -5001,7 +4613,6 @@ The usual precedence rules:

                -

                Precedence as a parameter

                Precedence can be made into an inherent feature of expressions: @@ -5046,7 +4657,6 @@ This idea is encoded in the operation

                -

                Fixities

                We can define left-associative infix expressions: @@ -5087,7 +4697,6 @@ Now we can write the whole concrete syntax of Calculator compactly:

                -

                Exercises on precedence

                1. Define non-associative and right-associative infix operations @@ -5101,7 +4710,6 @@ Test parsing with and without a pipe to pt -transform=compute.

                -

                Code generation as linearization

                Translate arithmetic (infix) to JVM (postfix): @@ -5131,7 +4739,6 @@ Just give linearization rules for JVM:

                -

                Programs with variables

                A straight code programming language, with @@ -5180,7 +4787,6 @@ of the extension is Prog.

                -

                Exercises on code generation

                1. Define a C-like concrete syntax of the straight-code language. @@ -5221,7 +4827,6 @@ point literals as arguments.

                -

                Lesson 7: Embedded grammars

                @@ -5239,7 +4844,6 @@ Goals:

                -

                Functionalities of an embedded grammar format

                GF grammars can be used as parts of programs written in other programming @@ -5256,17 +4860,16 @@ This facility is based on several components:

                -

                The portable grammar format

                The portable format is called PGF, "Portable Grammar Format".

                -This format is produced by the GF batch compiler gfc, +This format is produced by the GF batch compiler gf, executable from the operative system shell:

                -    % gfc --make SOURCE.gf
                +    % gf --make SOURCE.gf
                 

                PGF is the recommended format in @@ -5284,7 +4887,6 @@ general-purpose programming (or bytecode in Java).

                -

                Haskell: the EmbedAPI module

                The Haskell API contains (among other things) the following types and functions: @@ -5313,7 +4915,6 @@ It is available as a part of the GF distribution, in the file

                -

                First application: a translator

                Let us first build a stand-alone translator, which can translate @@ -5348,14 +4949,13 @@ For this, you need the Haskell compiler GHC

                - -

                Producing GFCC for the translator

                +

                Producing PGF for the translator

                -Then produce a GFCC file. For instance, the Food grammar set can be +Then produce a PGF file. For instance, the Food grammar set can be compiled as follows:

                -    % gfc --make FoodEng.gf FoodIta.gf
                +    % gf --make FoodEng.gf FoodIta.gf
                 

                This produces the file Food.pgf (its name comes from the abstract syntax). @@ -5376,7 +4976,6 @@ The result is given in all languages except the input language.

                -

                A translator loop

                To avoid starting the translator over and over again: @@ -5398,7 +4997,6 @@ is quit.

                -

                A question-answer system

                @@ -5443,7 +5041,6 @@ To reply in the same language as the question:

                -

                Abstract syntax of the query system

                Input: abstract syntax judgements @@ -5470,20 +5067,19 @@ Input: abstract syntax judgements

                -

                Exporting GF datatypes to Haskell

                To make it easy to define a transfer function, we export the abstract syntax to a system of Haskell datatypes:

                -    % gfc --output-format=haskell Query.pgf
                +    % gf --output-format=haskell Query.pgf
                 

                -It is also possible to produce the Haskell file together with GFCC, by +It is also possible to produce the Haskell file together with PGF, by

                -    % gfc --make --output-format=haskell QueryEng.gf
                +    % gf --make --output-format=haskell QueryEng.gf
                 

                The result is a file named Query.hs, containing a @@ -5521,7 +5117,6 @@ The Haskell module name is the same as the abstract syntax name.

                -

                The question-answer function

                Haskell's type checker guarantees that the functions are well-typed also with @@ -5545,7 +5140,6 @@ respect to GF.

                -

                Converting between Haskell and GF trees

                The generated Haskell module also contains @@ -5578,7 +5172,6 @@ For the programmer, it is enougo to know:

                -

                Putting it all together: the transfer definition

                   module TransferDef where
                @@ -5612,7 +5205,6 @@ For the programmer, it is enougo to know:
                 

                -

                Putting it all together: the Main module

                Here is the complete code in the Haskell file TransferLoop.hs. @@ -5644,14 +5236,13 @@ Here is the complete code in the Haskell file TransferLoop.hs.

                -

                Putting it all together: the Makefile

                To automate the production of the system, we write a Makefile as follows:

                   all:
                -          gfc --make --output-format=haskell QueryEng
                +          gf --make --output-format=haskell QueryEng
                           ghc --make -o ./math TransferLoop.hs
                           strip math
                 
                @@ -5682,7 +5273,6 @@ Just to summarize, the source of the application consists of the following files

                -

                Web server applications

                PGF files can be used in web servers, for which there is a Haskell library included @@ -5701,7 +5291,6 @@ is an example of its application to the Foods grammars.

                -

                JavaScript applications

                JavaScript is a programming language that has interpreters built in in most @@ -5715,14 +5304,13 @@ program compiled from GF grammars as run on an iPhone.

                -

                Compiling to JavaScript

                JavaScript is one of the output formats of the GF batch compiler. Thus the following command generates a JavaScript file from two Food grammars.

                -    % gfc --make --output-format=js FoodEng.gf FoodIta.gf
                +    % gf --make --output-format=js FoodEng.gf FoodIta.gf
                 

                The name of the generated file is Food.js, derived from the top-most abstract @@ -5731,7 +5319,6 @@ syntax name. This file contains the multilingual grammar as a JavaScript object.

                -

                Using the JavaScript grammar

                To perform parsing and linearization, the run-time library @@ -5741,7 +5328,7 @@ as templates for building applications.

                An example of usage is -translator.html, +translator.html, which is in fact initialized with a pointer to the Food grammar, so that it provides translation between the English and Italian grammars: @@ -5752,12 +5339,11 @@ and Italian grammars:

                The grammar must have the name grammar.js. The abstract syntax and start category names in translator.html must match the ones in the grammar. -With these changes, the translator works for any multilingual GF grammar. +With these changes, the translator works for any multilingual grammar.

                -

                Language models for speech recognition

                The standard way of using GF in speech recognition is by building @@ -5768,14 +5354,14 @@ GF supports several formats, including GSL, the formatused in the Nuance speech recognizer.

                -GSL is produced from GF by running gfc with the flag +GSL is produced from GF by running gf with the flag --output-format=gsl.

                Example: GSL generated from FoodsEng.gf.

                -    % gfc --make --output-format=gsl FoodsEng.gf
                +    % gf --make --output-format=gsl FoodsEng.gf
                     % more FoodsEng.gsl
                   
                     ;GSL2.0
                @@ -5804,7 +5390,6 @@ Example: GSL  generated from FoodsEng.gf.
                 

                -

                More speech recognition grammar formats

                Other formats available via the --output-format flag include: @@ -5849,9 +5434,9 @@ Other formats available via the --output-format flag include:

                -All currently available formats can be seen with gfc --help. +All currently available formats can be seen with gf --help.

                - + diff --git a/doc/gf-tutorial.txt b/doc/tutorial/gf-tutorial.txt similarity index 99% rename from doc/gf-tutorial.txt rename to doc/tutorial/gf-tutorial.txt index 8e8b8172a..8ae053a99 100644 --- a/doc/gf-tutorial.txt +++ b/doc/tutorial/gf-tutorial.txt @@ -1,6 +1,6 @@ Grammatical Framework Tutorial Aarne Ranta -Version 3.1.2, November 2008 +December 2010 (November 2008) % NOTE: this is a txt2tags file. @@ -626,7 +626,7 @@ You can chop this tutorial into a set of slides by the command ``` where the program ``htmls`` is distributed with GF (see below), in - [``GF/src/tools/Htmls.hs`` http://digitalgrammars.com/gf/src/tools/Htmls.hs] + [``GF/src/tools/Htmls.hs`` http://grammaticalframework.org/src/tools/Htmls.hs] The slides will appear as a set of files beginning with ``01-gf-tutorial.htmls``. @@ -700,7 +700,7 @@ In general, a GF grammar is **multilingual**: Open-source free software, downloaded via the GF Homepage: -[``digitalgrammars.com/gf`` http://digitalgrammars.com/gf/] +[``grammaticalframework.org`` http://grammaticalframework.org/] There you find - binaries for Linux, Mac OS X, and Windows @@ -709,11 +709,11 @@ There you find Many examples in this tutorial are -[online http://digitalgrammars.com/gf/examples/tutorial]. +[online http://grammaticalframework.org/examples/tutorial]. Normally you don't have to compile GF yourself. But, if you do want to compile GF from source follow the -instructions in the [Developers Guide gf-developers.html]. +instructions in the [Developers Guide ../gf-developers.html]. #NEW @@ -2453,7 +2453,7 @@ can be used to read a text and return for each word its analyses ``` The command ``morpho_quiz = mq`` generates inflection exercises. ``` - % gf -path=alltenses:prelude $GF_LIB_PATH/alltenses/IrregFre.gfc + % gf -path=alltenses:prelude $GF_LIB_PATH/alltenses/IrregFre.gfo > morpho_quiz -cat=V @@ -2970,7 +2970,7 @@ Language-specific and language-independent parts - roughly, Full API documentation on-line: the **resource synopsis**, -[``digitalgrammars.com/gf/lib/resource/doc/synopsis.html`` http://digitalgrammars.com/gf/lib/resource/doc/synopsis.html] +[``grammaticalframework.org/lib/resource/doc/synopsis.html`` http://grammaticalframework.org/lib/doc/synopsis.html] #NEW @@ -4530,10 +4530,10 @@ This facility is based on several components: The portable format is called PGF, "Portable Grammar Format". -This format is produced by the GF batch compiler ``gfc``, +This format is produced by the GF batch compiler ``gf``, executable from the operative system shell: ``` - % gfc --make SOURCE.gf + % gf --make SOURCE.gf ``` PGF is the recommended format in which final grammar products are distributed, because they @@ -4605,12 +4605,12 @@ For this, you need the Haskell compiler [GHC http://www.haskell.org/ghc]. #NEW -===Producing GFCC for the translator=== +===Producing PGF for the translator=== -Then produce a GFCC file. For instance, the ``Food`` grammar set can be +Then produce a PGF file. For instance, the ``Food`` grammar set can be compiled as follows: ``` - % gfc --make FoodEng.gf FoodIta.gf + % gf --make FoodEng.gf FoodIta.gf ``` This produces the file ``Food.pgf`` (its name comes from the abstract syntax). @@ -4714,11 +4714,11 @@ abstract Query = { To make it easy to define a transfer function, we export the abstract syntax to a system of Haskell datatypes: ``` - % gfc --output-format=haskell Query.pgf + % gf --output-format=haskell Query.pgf ``` -It is also possible to produce the Haskell file together with GFCC, by +It is also possible to produce the Haskell file together with PGF, by ``` - % gfc --make --output-format=haskell QueryEng.gf + % gf --make --output-format=haskell QueryEng.gf ``` The result is a file named ``Query.hs``, containing a module named ``Query``. @@ -4871,7 +4871,7 @@ translate tr gr s = case parseAllLang gr (startCat gr) s of To automate the production of the system, we write a ``Makefile`` as follows: ``` all: - gfc --make --output-format=haskell QueryEng + gf --make --output-format=haskell QueryEng ghc --make -o ./math TransferLoop.hs strip math ``` @@ -4928,7 +4928,7 @@ program compiled from GF grammars as run on an iPhone. JavaScript is one of the output formats of the GF batch compiler. Thus the following command generates a JavaScript file from two ``Food`` grammars. ``` - % gfc --make --output-format=js FoodEng.gf FoodIta.gf + % gf --make --output-format=js FoodEng.gf FoodIta.gf ``` The name of the generated file is ``Food.js``, derived from the top-most abstract syntax name. This file contains the multilingual grammar as a JavaScript object. @@ -4944,7 +4944,7 @@ some other JavaScript and HTML files; these files can be used as templates for building applications. An example of usage is -[``translator.html`` ../lib/javascript/translator.html], +[``translator.html`` http://grammaticalframework.org:41296], which is in fact initialized with a pointer to the Food grammar, so that it provides translation between the English and Italian grammars: @@ -4969,12 +4969,12 @@ The standard way of using GF in speech recognition is by building GF supports several formats, including GSL, the formatused in the [Nuance speech recognizer www.nuance.com]. -GSL is produced from GF by running ``gfc`` with the flag +GSL is produced from GF by running ``gf`` with the flag ``--output-format=gsl``. Example: GSL generated from ``FoodsEng.gf``. ``` - % gfc --make --output-format=gsl FoodsEng.gf + % gf --make --output-format=gsl FoodsEng.gf % more FoodsEng.gsl ;GSL2.0 @@ -5017,6 +5017,6 @@ Other formats available via the ``--output-format`` flag include: | ``slf`` | finite automaton in the HTK SLF format | ``slf_sub`` | finite automaton with sub-automata in HTK SLF -All currently available formats can be seen with ``gfc --help``. +All currently available formats can be seen with ``gf --help``. diff --git a/doc/iphone.jpg b/doc/tutorial/iphone.jpg similarity index 100% rename from doc/iphone.jpg rename to doc/tutorial/iphone.jpg diff --git a/doc/mytree.png b/doc/tutorial/mytree.png similarity index 100% rename from doc/mytree.png rename to doc/tutorial/mytree.png diff --git a/index.html b/index.html index 3a23a66a9..d88e3b6df 100644 --- a/index.html +++ b/index.html @@ -26,11 +26,13 @@ April 2010 | Download | Libraries | Reference -| Tutorial +| Tutorial +| QuickStart +| UserGroup ]

                -[ Developers +[ ForDevelopers | People | Publications | QuickRefCard @@ -139,7 +141,7 @@ fifty scientific publications (see GF publica

                Programming in GF

                -GF is easy to learn by following the tutorial. +GF is easy to learn by following the tutorial. You can write your first translator in 15 minutes.