forked from GitHub/gf-core
CLT slides complete (but not finished...)
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<P ALIGN="center"><CENTER><H1>The GF Resource Grammar Library Version 1.0</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Author: Aarne Ranta <aarne (at) cs.chalmers.se></I><BR>
|
||||
Last update: Wed Mar 8 08:31:08 2006
|
||||
Last update: Wed Mar 8 09:34:17 2006
|
||||
</FONT></CENTER>
|
||||
|
||||
<P>
|
||||
@@ -770,27 +770,121 @@ Example: <A HREF="../../../examples/animal/QuestionsI.gfe">animal</A>
|
||||
<!-- NEW -->
|
||||
</P>
|
||||
<H2>How to implement a new language</H2>
|
||||
<H3>Ordinary modules</H3>
|
||||
<P>
|
||||
See <A HREF="Resource-HOWTO.html">Resource-HOWTO</A>
|
||||
</P>
|
||||
<H2>Ordinary modules</H2>
|
||||
<P>
|
||||
Write a concrete syntax module for each abstract module in the API
|
||||
</P>
|
||||
<P>
|
||||
Write a <CODE>Paradigms</CODE> module
|
||||
</P>
|
||||
<P>
|
||||
Examples: English, Finnish, German, Russian
|
||||
</P>
|
||||
<P>
|
||||
<!-- NEW -->
|
||||
</P>
|
||||
<H3>Parametrized modules</H3>
|
||||
<H2>Parametrized modules</H2>
|
||||
<P>
|
||||
Examples: Romance (French, Italian, Spanish), Scandinavian (Danish, Norwegian, Swedish)
|
||||
</P>
|
||||
<P>
|
||||
Write a <CODE>Diff</CODE> interface for a family of languages
|
||||
</P>
|
||||
<P>
|
||||
Write concrete syntaxes as functors opening the interface
|
||||
</P>
|
||||
<P>
|
||||
Write separate <CODE>Paradigms</CODE> modules for each language
|
||||
</P>
|
||||
<P>
|
||||
Advantages:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>easier maintenance of library
|
||||
<LI>insights into language families
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
Problems:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>more abstract thinking required
|
||||
<LI>individual grammars may not come out optimal in elegance and efficiency
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
<!-- NEW -->
|
||||
</P>
|
||||
<H3>The kernel of the API</H3>
|
||||
<H3>The core of the API</H3>
|
||||
<P>
|
||||
Everything else is variations of this
|
||||
</P>
|
||||
<PRE>
|
||||
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
|
||||
</PRE>
|
||||
<P></P>
|
||||
<P>
|
||||
<!-- NEW -->
|
||||
</P>
|
||||
<H3>The core of the API</H3>
|
||||
<P>
|
||||
This <A HREF="latin.gf">toy Latin grammar</A> shows in a nutshell how the core
|
||||
can be implemented.
|
||||
</P>
|
||||
<P>
|
||||
Use this API as a first approximation when designing the parameter system of a new
|
||||
language.
|
||||
</P>
|
||||
<P>
|
||||
<!-- NEW -->
|
||||
</P>
|
||||
<H3>How to proceed</H3>
|
||||
<OL>
|
||||
<LI>put up a directory with dummy modules by copying from e.g. English and
|
||||
commenting out the contents
|
||||
<P></P>
|
||||
<LI>so you will have a compilable <CODE>LangX</CODE> all the time
|
||||
<P></P>
|
||||
<LI>start with nouns and their inflection
|
||||
<P></P>
|
||||
<LI>proceed to verbs and their inflection
|
||||
<P></P>
|
||||
<LI>add some noun phrases
|
||||
<P></P>
|
||||
<LI>implement predication
|
||||
</OL>
|
||||
|
||||
<P>
|
||||
<!-- NEW -->
|
||||
</P>
|
||||
<H2>How to extend the API</H2>
|
||||
<P>
|
||||
<!-- NEW -->
|
||||
Extend old modules or add a new one?
|
||||
</P>
|
||||
<P>
|
||||
Usually better to start a new one: then you don't have to implement it
|
||||
for all languages at once.
|
||||
</P>
|
||||
<P>
|
||||
Exception: if you are working with a language-specific API extension,
|
||||
you can work directly in that module.
|
||||
</P>
|
||||
<H3>Extend old modules or add a new one?</H3>
|
||||
|
||||
<!-- html code generated by txt2tags 2.3 (http://txt2tags.sf.net) -->
|
||||
<!-- cmdline: txt2tags 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?===
|
||||
|
||||
|
||||
Reference in New Issue
Block a user