diff --git a/resource/doc/Makefile b/resource/doc/Makefile index 8e3c79697..af91c3a1b 100644 --- a/resource/doc/Makefile +++ b/resource/doc/Makefile @@ -31,7 +31,7 @@ gfdoc: gfdoc ../italian/BeschIta.gf ; mv ../italian/BeschIta.html . gfdoc ../spanish/ParadigmsSpa.gf ; mv ../spanish/ParadigmsSpa.html . -# gfdoc ../spanish/BasicSpa.gf ; mv ../spanish/BasicSpa.html . + gfdoc ../spanish/BasicSpa.gf ; mv ../spanish/BasicSpa.html . gfdoc ../spanish/BeschSpa.gf ; mv ../spanish/BeschSpa.html . gifs: api lang scand low diff --git a/resource/doc/example/Animals.gf b/resource/doc/example/Animals.gf index e6d084243..17e64c7b1 100644 --- a/resource/doc/example/Animals.gf +++ b/resource/doc/example/Animals.gf @@ -5,6 +5,6 @@ abstract Animals = Questions ** { fun -- a lexicon of animals and actions among them Dog, Cat, Mouse, Lion, Zebra : Entity ; - Chase, Eat, Like : Action ; + Chase, Eat, See : Action ; } diff --git a/resource/doc/example/AnimalsEng.gf b/resource/doc/example/AnimalsEng.gf index a25a95ae2..e8a9c474a 100644 --- a/resource/doc/example/AnimalsEng.gf +++ b/resource/doc/example/AnimalsEng.gf @@ -11,5 +11,5 @@ concrete AnimalsEng of Animals = QuestionsEng ** Zebra = regN "zebra" ; Chase = dirV2 (regV "chase") ; Eat = dirV2 eat_V ; - Like = dirV2 (regV "like") ; + See = dirV2 see_V ; } diff --git a/resource/doc/example/AnimalsFre.gf b/resource/doc/example/AnimalsFre.gf index 635f47208..d35de8243 100644 --- a/resource/doc/example/AnimalsFre.gf +++ b/resource/doc/example/AnimalsFre.gf @@ -11,5 +11,5 @@ concrete AnimalsFre of Animals = QuestionsFre ** Zebra = regN "zèbre" masculine ; Chase = dirV2 (regV "chasser") ; Eat = dirV2 (regV "manger") ; - Like = dirV2 (regV "aimer") ; + See = voir_V2 ; } diff --git a/resource/doc/example/AnimalsSwe.gf b/resource/doc/example/AnimalsSwe.gf index f7aaa0cd6..acd839317 100644 --- a/resource/doc/example/AnimalsSwe.gf +++ b/resource/doc/example/AnimalsSwe.gf @@ -11,5 +11,5 @@ concrete AnimalsSwe of Animals = QuestionsSwe ** Zebra = regN "zebra" utrum ; Chase = dirV2 (regV "jaga") ; Eat = dirV2 äta_V ; - Like = mkV2 (mk2V "tycka" "tycker") "om" ; + See = dirV2 se_V ; } diff --git a/resource/doc/example/QuestionsI.gf b/resource/doc/example/QuestionsI.gf index 7dda8ca8c..9915cc8d5 100644 --- a/resource/doc/example/QuestionsI.gf +++ b/resource/doc/example/QuestionsI.gf @@ -1,6 +1,6 @@ --# -path=.:resource/abstract:resource/../prelude --- Language-independent question grammar parametwized on Resource. +-- Language-independent question grammar parametrized on Resource. incomplete concrete QuestionsI of Questions = open Resource in { lincat diff --git a/resource/doc/example/mkAnimals.gfcm b/resource/doc/example/mkAnimals.gfs similarity index 100% rename from resource/doc/example/mkAnimals.gfcm rename to resource/doc/example/mkAnimals.gfs diff --git a/resource/doc/gf-resource.html b/resource/doc/gf-resource.html index 902cc5432..795f333f6 100644 --- a/resource/doc/gf-resource.html +++ b/resource/doc/gf-resource.html @@ -9,9 +9,11 @@
-Second Version, Gothenburg, 1 March 2005
+Third Version, 22 May 2005
-First Draft, Gothenburg, 7 February 2005
+Second Version, 1 March 2005
+
+First Draft, 7 February 2005
@@ -31,7 +33,8 @@ A grammar formalism based on functional programming and type theory.
-Designed to be nice for ordinary programmers to use. +Designed to be nice for ordinary programmers to use: by this +we mean programmers without training in linguistics.
@@ -47,6 +50,7 @@ Thus not primarily another theoretical framework for linguists. +
-
-Extra constraint: we want open-source free software.
-
+
+Extra constraint: we want open-source free software and
+hence cannot use existing proprietary resources.
-
-Semantic correctness
+Semantic correctness: only to produce meaningful expressions.
+
+Example: the following sentences can be generated
colourless green ideas sleep furiously the time is seventy past forty-two+However, an applicatio grammar can use a domain-specific +semantics to guarantee semantic well-formedness.
(Warning for linguists:) theoretical innovation in -syntax (and it will all be hidden anyway!) +syntax is not among the goals +(and it would be hidden from users anyway!). @@ -334,6 +347,7 @@ The current GF Resource Project covers ten languages: The first three letters (Dan etc) are used in grammar module names +
@@ -491,7 +508,7 @@ Alternative views on sentence formation:
i english/LangEng.gf i swedish/LangSwe.gf @@ -532,11 +549,14 @@ Import directly by open:concrete AppNor of App = open LangNor, ParadigmsNor in {...}-No more dummy reuse modules and bulky .gfr files! +(Note for the users of GF 2.1 and older: +the dummy reuse modules and their bulky .gfr versions +are no longer needed!)-If you need to convert resource category records to/from strings, use +If you need to convert resource records to strings, and don't want to know +the concrete type (as you never should), you can use
Predef.toStr : (L : Type) -> L -> Str ;@@ -548,65 +568,99 @@ If you need to convert resource category records to/from strings, use +Use as library through parser
-Use the parser when developing a resource. +You can use the parser with a LangX grammar +when developing a resource. + ++ +Using the -v option shows if the parser fails because +of unknown words.
> p -cat=S -v "jag ska åka till Chalmers" unknown tokens [TS "åka",TS "Chalmers"] - ++Then try to select words that LangX recognizes: +> p -cat=S "jag ska gå till Danmark" UseCl (PosTP TFuture ASimul) (AdvCl (SPredV i_NP go_V) (AdvPP (PrepNP to_Prep (UsePN (PNCountry Denmark)))))-Extend vocabulary at need. +Use these API structures and extend vocabulary to match your need.åka_V = lexV "åker" ; Chalmers = regPN "Chalmers" neutrum ;+ +Syntax editor as library browser
+ +You can run the syntax editor on LangX to +find resource API functions through context-sensitive menus. +For instance, the shell command ++ jgf LangEng.gf LangFre.gf ++opens the editor with English and French views. The + +Editor User Manual gives more information on the use of the editor. + ++ +A restriction of the editor is that it does not give access to +ParadigmsX modules. An IDE environment extending the editor +to a grammar programming tool is work in progress. + + +
Example application: a small translation system
-You can say things like the following: +In this system, you can express questions and answers of +the following forms:- who chases mice ? - whom does the lion chase ? - the dog chases cats + Who chases mice ? + Whom does the lion chase ? + The dog chases cats.-Source modules: +We build the abstract syntax in two phases: +
-Abstract syntax: -Questions, -Animals +The concrete syntax of English is built in three phases: +
-Concrete syntax of questions parametrized on the resource API: -QuestionsI +The concrete syntax of Swedish is built upon QuestionsI +in a similar way, with the modules +QuestionsSwe and. +AnimalsSwe.
-English concrete syntax: -QuestionsEng, -AnimalsEng +The concrete syntax of French consists similarly of the modules +QuestionsFre and +AnimalsFre. -
- -French concrete syntax: -QuestionsFre, -AnimalsFre - -
- -Swedish concrete syntax: -QuestionsSwe, -AnimalsSwe @@ -635,27 +689,13 @@ and you get an end-user grammar animals.gfcm. You can also write the commands in a gfs (GF script) file, say -mkAnimals.gfs, +mkAnimals.gfs, and then call GF with
gf <mkAnimals.gfs- -
- -Step 2: factor out the categories and purely combinational -rules into an incomplete module (to be shown... but -this does not work for French, which uses different structures: -e.g. Qui aime les lions ? with a definite phrase -where English has Who loves lions? -