GF online editor for simple multilingual grammars

[GF online editor screen shoot]

About

Traditionally, GF grammars are created in a text editor and tested in the GF shell. Text editors know very little (if anything) about the syntax of GF grammars, and thus provide little guidance for novice GF users. Also, the grammar author has to download and install the GF software on his/her own computer.

In contrast, the GF online editor for simple multilingual grammars is available online, making it easier to get started. All that is needed is a reasonably modern web browser. Even Android and iOS devices can be used.

The editor also guides the grammar author by showing a skeleton grammar file and hinting how the parts should be filled in. When a new part is added to the grammar, it is immediately checked for errors.

Editing operations are accessed by clicking on editing symbols embedded in the grammar display: +=Add an item, ×=Delete an item, %=Edit an item. These are revealed when hovering over items. On touch devices, hovering is in some cases simulated by tapping, but there is also a button at the bottom of the display to "Enabile editing on touch devices" that reveals all editing symbols.

In spite of its name, the editor runs entierly in the web browser, so once you have opened the web page, you can continue editing grammars even while you are offline.

Limitations

At the moment, the editor supports only a small subset of the GF grammar notation. Proper error checking is done for abstract syntax, but not (yet) for concrete syntax. The resource grammar library is not available.

The grammars created with this editor always consists of one file for the abstract syntax, and one file for each concrete syntax.

Abstract syntax

The supported abstract syntax corresponds to context-free grammars (no dependent types). The definition of an abstract syntax is limited to Available editing operations: Error checks:

Concrete syntax

At the moment, concrete syntax definitions are limited to Available editing operations: Error checks:

Testing grammars

By pressing the Upload button, a grammar can be uploaded to the GF server. It will then be compiled with GF, and any errors not checked by the editor will be detected and reported. If the grammar is free from errors, the user can test the grammar by clicking on links to the online GF shell, the Minibar or the Translation Quiz.

Future work

This prototype gives an idea of how a web based GF grammar editor could work. We do not expect to create a full implementation of GF that runs in the web browser, but let the editor communicate with a server running GF.

By developing a GF server with an appropriate API, it should be possible to extend the editor to support a larger fragment of GF, to do proper error checking, and to allow grammars to be tested in the GF shell or the minibar.

Grammars are currently stored locally in the browser, but a future version could allow grammars to be stored "in the cloud", allowing the same grammars to be accessed from multiple devices.


Last modified: Wed Feb 23 17:37:16 CET 2011
TH