Skip to content
This repository has been archived by the owner on Jul 26, 2018. It is now read-only.

Commit

Permalink
gf-web-api.t2t: document command=deptree (for word dependency diagrams)
Browse files Browse the repository at this point in the history
Also add a few paragraphs listing undocumented commands and
briefly describing the commands that use the C run-time system.
  • Loading branch information
Thomas-H committed Jun 16, 2016
1 parent 2a4f34e commit 2911022
Showing 1 changed file with 59 additions and 3 deletions.
62 changes: 59 additions & 3 deletions src/www/gf-web-api.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Document root = /usr/share/gf-3.8/www
Starting HTTP server, open http://localhost:41296/ in your web browser.
```

A compiled GF grammar (a ``.pgf`` file) could be used in web applications
A compiled GF grammar (a ``.pgf`` file) can be used in web applications
%in the same way as JSP, ASP or PHP pages are used.
by placing somewhere under the document root.
by placing it somewhere under the document root.
%, usually in the ``grammars/`` subdirectory.
When there is a request for access to a ``.pgf`` file, the GF web server
will load and cache the grammar and interpret any parameters included in the URL
Expand Down Expand Up @@ -274,7 +274,7 @@ or graphviz (``text/plain``) format, respectively.

--------------------------------------------------------------------------------

===Word Alignment Diagram===
===Word Alignment Diagrams===

This command renders the word alignment diagram for some sentence and all languages in the grammar. The sentence is generated from a given abstract syntax tree.

Expand All @@ -297,6 +297,62 @@ The ``format`` parameter can also be ``gif``, ``svg`` or ``gv``, for
GIF (``image/gif``), SVG (``image/svg+xml``)
or graphviz (``text/plain``) format, respectively.

--------------------------------------------------------------------------------
===Word Dependency Diagrams===

This command (available in GF>=3.8) outputs word dependency diagrams
in various format.

====Input====
|| Parameter | Description | Default |
| ``command`` | should be ``deptree`` | - |
| ``tree`` | the abstract syntax tree to render | - |
| ``format`` | output format, see below | ``dot`` |
| ``to`` | name of the concrete syntax to use in the diagram | - |

The ``format`` is one of the following:

- ``png``, ``gif``, ``gv``: rendered with graphviz,
- ``svg``, ``latex``: [universal dependency http://universaldependencies.org/]
diagrams, in SVG format for use in web pages or
as LaTeX Picture code for use in LaTeX documents,
- ``conll``, ``malt_tab`` and ``malt_input``: text formats

--------------------------------------------------------------------------------

===Undocumented commands===

There a few additional commands that lack proper documentation:

- ``abstrjson``, ``browse``, ``download``, ``generate``, ``linearizeAll``,
``linearizeTable``, ``lookupmorpho``, ``translategroup``.


See the source code for details.

--------------------------------------------------------------------------------

==Commands that use the C run-time system==

GF includes two implementations of the PGF API: the traditional
Haskell implementation and the newer C implementation. The commands documented
above all use the Haskell implementation.
The following command use the C implementation instead:

- ``c-parse``, ``c-linearize``, ``c-linearizeAll``, ``c-translate``,
``c-lookupmorpho``, ``c-flush``, ``c-grammar``, ``c-abstrtree``,
``c-parsetree``, ``c-wordforword``.


They implement the same functionality as the corresponding commands
without the ``c-`` prefix, although there are some restrictions in what
parameters they support, and some differences in the JSON
data structures they output.

When using these commands, the grammar will be loaded and cached
by the C run-time system. If you use commands from both the Haskell and C
implementations with the same grammar, the grammar will be loaded twice.

--------------------------------------------------------------------------------

[www.grammaticalframework.org http://www.grammaticalframework.org]

0 comments on commit 2911022

Please sign in to comment.