From 863454b94dcd86148543e6221126a463ca56b8cb Mon Sep 17 00:00:00 2001 From: aarne Date: Wed, 8 Mar 2006 08:38:22 +0000 Subject: [PATCH] CLT slides complete (but not finished...) --- lib/resource-1.0/doc/clt2006.html | 106 ++++++++++++++++++++++++++++-- lib/resource-1.0/doc/clt2006.txt | 83 +++++++++++++++++++++-- 2 files changed, 178 insertions(+), 11 deletions(-) diff --git a/lib/resource-1.0/doc/clt2006.html b/lib/resource-1.0/doc/clt2006.html index 37bae8b0e..91f0705f4 100644 --- a/lib/resource-1.0/doc/clt2006.html +++ b/lib/resource-1.0/doc/clt2006.html @@ -7,7 +7,7 @@

The GF Resource Grammar Library Version 1.0

Author: Aarne Ranta <aarne (at) cs.chalmers.se>
-Last update: Wed Mar 8 08:31:08 2006 +Last update: Wed Mar 8 09:34:17 2006

@@ -770,27 +770,121 @@ Example: animal

How to implement a new language

-

Ordinary modules

+

+See Resource-HOWTO +

+

Ordinary modules

+

+Write a concrete syntax module for each abstract module in the API +

+

+Write a Paradigms module +

+

+Examples: English, Finnish, German, Russian +

-

Parametrized modules

+

Parametrized modules

+

+Examples: Romance (French, Italian, Spanish), Scandinavian (Danish, Norwegian, Swedish) +

+

+Write a Diff interface for a family of languages +

+

+Write concrete syntaxes as functors opening the interface +

+

+Write separate Paradigms modules for each language +

+

+Advantages: +

+ + +

+Problems: +

+ +

-

The kernel of the API

+

The core of the API

+

+Everything else is variations of this +

+
+  cat
+    Cl ;   -- clause
+    VP ;   -- verb phrase
+    V2 ;   -- two-place verb
+    NP ;   -- noun phrase
+    CN ;   -- common noun
+    Det ;  -- determiner
+    AP ;   -- adjectival phrase
+  
+  fun
+    PredVP  : NP  -> VP -> Cl ;   -- predication
+    ComplV2 : V2  -> NP -> VP ;   -- complementization
+    DetCN   : Det -> CN -> NP ;   -- determination
+    ModCN   : AP  -> CN -> CN ;   -- modification
+
+

+

+ +

+

The core of the API

+

+This toy Latin grammar shows in a nutshell how the core +can be implemented. +

+

+Use this API as a first approximation when designing the parameter system of a new +language. +

How to proceed

+
    +
  1. put up a directory with dummy modules by copying from e.g. English and +commenting out the contents +

    +
  2. so you will have a compilable LangX all the time +

    +
  3. start with nouns and their inflection +

    +
  4. proceed to verbs and their inflection +

    +
  5. add some noun phrases +

    +
  6. implement predication +
+

How to extend the API

- +Extend old modules or add a new one? +

+

+Usually better to start a new one: then you don't have to implement it +for all languages at once. +

+

+Exception: if you are working with a language-specific API extension, +you can work directly in that module.

-

Extend old modules or add a new one?

diff --git a/lib/resource-1.0/doc/clt2006.txt b/lib/resource-1.0/doc/clt2006.txt index d6f8cc3de..a9a46cccb 100644 --- a/lib/resource-1.0/doc/clt2006.txt +++ b/lib/resource-1.0/doc/clt2006.txt @@ -645,27 +645,100 @@ Example: [animal ../../../examples/animal/QuestionsI.gfe] ==How to implement a new language== -===Ordinary modules=== +See [Resource-HOWTO Resource-HOWTO.html] + +==Ordinary modules== + +Write a concrete syntax module for each abstract module in the API + +Write a ``Paradigms`` module + +Examples: English, Finnish, German, Russian #NEW -===Parametrized modules=== +==Parametrized modules== + +Examples: Romance (French, Italian, Spanish), Scandinavian (Danish, Norwegian, Swedish) + +Write a ``Diff`` interface for a family of languages + +Write concrete syntaxes as functors opening the interface + +Write separate ``Paradigms`` modules for each language + +Advantages: +- easier maintenance of library +- insights into language families + + +Problems: +- more abstract thinking required +- individual grammars may not come out optimal in elegance and efficiency + #NEW -===The kernel of the API=== +===The core of the API=== + +Everything else is variations of this +``` +cat + Cl ; -- clause + VP ; -- verb phrase + V2 ; -- two-place verb + NP ; -- noun phrase + CN ; -- common noun + Det ; -- determiner + AP ; -- adjectival phrase + +fun + PredVP : NP -> VP -> Cl ; -- predication + ComplV2 : V2 -> NP -> VP ; -- complementization + DetCN : Det -> CN -> NP ; -- determination + ModCN : AP -> CN -> CN ; -- modification +``` + +#NEW + +===The core of the API=== + +This [toy Latin grammar latin.gf] shows in a nutshell how the core +can be implemented. + +Use this API as a first approximation when designing the parameter system of a new +language. + #NEW ===How to proceed=== ++ put up a directory with dummy modules by copying from e.g. English and +commenting out the contents + ++ so you will have a compilable ``LangX`` all the time + ++ start with nouns and their inflection + ++ proceed to verbs and their inflection + ++ add some noun phrases + ++ implement predication #NEW ==How to extend the API== -#NEW +Extend old modules or add a new one? + +Usually better to start a new one: then you don't have to implement it +for all languages at once. + +Exception: if you are working with a language-specific API extension, +you can work directly in that module. + -===Extend old modules or add a new one?===