A natural language generator (specifically, an FB-LTAG surface realiser)

Latest on Hackage:

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow to host generated Haddocks.

GPL licensed by Carlos Areces and Eric Kow
Maintained by

Build Status


  1. homepage and wiki
  2. manual
  3. API

Installing GenI

Command line interface and server

(tested on Linux, Windows, and MacOS X)

  1. Install the Haskell Platform. GenI 0.24 is known to build with either haskell-platform-2013.2.0.0 and haskell-platform-2012.2.0.0. Other versions may work too.

    If you want the graphical interface, and you are on a 64-bit Mac,

    take the 64-bit version of the Haskell Platform.

  2. Install the basic version first. If you just want the last stable release of GenI,

        cabal install GenI geniserver geni-util
    However, if you want to install the unstable version

    from source, change to the directory this README is in and

        cabal install . ./geniserver ./geni-util

Graphical interface

  1. Install wxWidgets. If you have a 64-bit Mac, install the Cocoa interface. If you use HomeBrew on Mac, brew install wxmac should do the trick.

    GenI 0.24 has been known to work with wxWidgets 2.9.4 on MacOS X, and

    is expected to work on wxWidgets 2.8.x or wxWidgets 2.9.x on Linux.

  2. Install wxHaskell (potentially painful)

        cabal install wx
    If you run into trouble here, you may need to use a development

    version of [wxHaskell][wxHaskell].

  3. Install the graphical interface (should be easy if 2 went well)

        cabal install ./geni-gui
  4. Try GenI (needs GenI examples files from this repository)

        cd examples/ej
        geni-gui -t trees -l lexicon -s suite


I accept Darcs patches and GitHub pull requests. The Darcs repository might be a bit ahead of the Git one, but I'll try to keep the mirror up to date.


Please follow published style guide. There is quite a bit of old code that does not follow this. Sorry. I'm slowly working on transitioning it.


  • Stable version has even minor number (eg. 0.22.x)
  • Development version has odd minor number (eg 0.23.yyyymmdd) Sometimes with a datestamp for major API changes in between
  • NEWS file will probably mention the next release (eg. 0.24)

Contact us!

Please let us know if you are using GenI; we'd like to hear about your experiences, both positive and negative.


GenI 0.24.3 15 Nov 2013

* Lexical selection: trees that fail enrichment due to unification failure are
now discarded

Previously, there was some confusion over whether the expected behaviour was
for this to be an error or warning. The behaviour after this fix is that
missing nodes trigger a warning, an unification failures trigger an error
(discarded tree)

* Realisation: When anonymising singleton variables, GenI preserves their
constraints. This should fix some subtle overgeneration problems that may
arise in automatically generated grammars

GenI 0.24, 18 Sep 2013
Note that the changes between this release and 0.20 are considered to be under
the BSD3 license. GenI overall remains dual-licensed under the GPL and any
commercial-use terms you may wish to negotiate with INRIA. Having secured the
rights to use GenI 0.20, you may freely use GenI 0.24 in a similar fashion.


* Server/GUI changes: Semantic input must be full input.
- Before: `foo(x) bar(y z)`
- After: `semantics:[foo(x) bar(y z)]`
* Customisable semantics : now you can accept any arbitrary
input for which you can define a mapping to a GenI-style test case
* API change: the custom semantics argument is mandatory
* More extensive documentation


* Visual distinction between explicit null adjunction constraints
(marked NA) and constraints inserted by GenI (marked INA)
* Bugfixes (now retains show-feature state across debugger steps)
* More informative top/bot unification failure diagnostics in the


* New "guided realisation" optimisation (focus on one polarity
path at a time)
* Fixed errors where top/bottom unification wasn't being done
* Builds with haskell-platform 2013.2.0.0

GenI 0.22, 14 Apr 2012
Note that the changes between this release and 0.20 are considered to be under
the BSD3 license. GenI overall remains dual-licensed under the GPL and any
commercial-use terms you may wish to negotiate with INRIA. Having secured the
rights to use GenI 0.20, you may freely use GenI 0.22 in a similar fashion.


* Separation of geni and geni-gui into two packages;
simpler installation
* Now using the top feature for lemanchors instead of bot
* Empty disjunctions forbidden in unification variables
* JSON input/output to morph processors have changed
* Lexical selection unifies semantics of tree schema + lemma with
input semantics.


* New results tab with reminder of inputs
* Add gui element to display unanchored lexical selection.
* Jump to new tab in debugger panel when created.
* Update gui to use Pretty instead of Show
* Rename $algo-session tab to "tree assembly"
* Make warnings resizable.
* Fix display of path equations with 'interface' in them.
* Fix #50 - load button has no effect.
* Fix #49 - correct order that leaf nodes are returned.
* Show GenI version in About box.
* Add detect polarities and root feature editor to main gui.


* Literate GenI and genimanual replaced with


* Builds with GHC 7
* Core behaviour
* Early null-adjunction and semfilter obligatory
* Handling of zero-literal semantic items restored
* Unconstrained polarities in automaton construction.
This makes it possible to do polarity detection with only a
weakly specified root feature like [cat:_], and without needing
the relevant feature to be implemented everywhere.

* Flags:
* --trees (used to be --macros; latter is deprecated)
* --batchdir now optional (defaults to a new temp dir)
* --maxsteps (stop after N steps)
* --extrapol REMOVED (use root feature instead)
* Logging facility (not used much in GenI yet)
Can be configured in ~/.geni/config.yaml, for example
name : NLP.GenI.Console
level : WARN
format : simple "$msg"
name : NLP.Geni.LexicalSelection
level : DEBUG
format : simple "$utcTime $loggername $msg"
handler : stderr
* Less repetition in warnings (hopefully easier to read)
* More hiding of constructors for safety
* New enrichment option for setting co-anchors (foo.lex=hello)
* Lexical selection performance enhancements
* Variables that only occur once are converted to anonymous,
should make unification a bit more efficient
* Fix #39: reject malformed root feature input.
* New feature:
* Variables with constraints on their possible values (?X/foo|bar)
* Fancy disjunctions: tree schemata now allow disjunctions of
unification variables (but not recursive). These must flatten down
to plain old atomic disjunction once converted to elementary trees

* Time metric in statistics (Laura Perez)
* Do top/bottom unification on na-constrained nodes during initialisation.
* Polarity detection relaxed to work with constrained variables too.
(?X/foo|bar gives the result as foo|bar)
* Bugfix in interpretation of root feature (it should be sorted).
* Flags:
* --rootfeat always assumed, but defaults to '[cat:_]'
* '-r' a short command line option for '--rootfeat'.


* Somewhat safer and easier to understand API
(still no stability yet)
* Replace String with Text in GeniVal
* Replace Show abuse with custom Pretty class
* Slightly less stateful (no target semantics in state)
* Much rearranging and renaming (sorry!)
* New: ability to provide custom lexical selection action
* New: ability to provide custom morph postprocessing action
* de-haskell98 (Gwern Branwen)
* No more null builder.

TOOLS (darcs get --lazy

* new tool, genireport: summarise batch generation results
* geniserver now talks over HTTP using a JSON format
* Use Sylvain Salvati's xmg2geni.xsl instead of geniconvert.
* xmg2geni: fix treatment of missing lexemes.
* xmg2geni: treat type=coanchor as other nodes in GenI.
* geniwrapper: illustrates C wrapper of GenI API

GenI 0.20, 29 Sep 2009

* GHC 6.8 or higher now required (GHC 6.10 + Haskell Platform preferred)
* Input files now *assumed* to be UTF-8 encoded
(output still ISO8859-1; hopefully locale-based in GHC 6.12)
* Interface between GenI and morphological realiser now uses a JSON format.
* Rootfeat optimisation now mandatory (flag no longer recognised)


* new flag --version now works and reports version from Cabal file
* new flag --dump dumps derivation output to stdout in JSON format
* new flag --ranking foo ranks outputs according to OT-style constraints expressed in foo
* --batchdir now works with --testcase
* --batchdir now dumps derivations and statistics in JSON format
* --batchdir now works with instructions files
* --metrics always expands 'default' to the default metrics
(in addition to any other statistics you request)
* new optimisation: early null-adjunction detection


* Reference manual in docs/genimanual.pdf (make docs)
* cabal install -fgui and cabal install produce the same underlying library
only the executable is different
* Easier GUI installation for MacOS X (application bundles now built
automatically; no manual intervention required)
* Adopted odd/even convention to distinguish devel builds from stable ones
(eg. GenI 0.21.x is devel whereas GenI 0.20.x is stable)

GenI 0.17.4, 6 Apr 2009
* GHC 6.6 support

* GUI disabled by default

GenI 0.17.3, 3 Apr 2009
* Simplified build method
* one single cabal package instead of two
* cabal configure -f-gui to disable GUI
* makefile stripped out

* Lexical selection on empty semantics now allowed
* This is so that the zero-literal semantics mechanism can work again

* Better help text

* Baked-in unit testing (geni --unit-test)

GenI 0.10, 11 Dec 2006
* Performance much improved after Haskell profiling
* Pre-compiled grammars option, geniserver (buggy)

GenI 0.9, 8 Dec 2006
* Switched to new syntax: variables now must be prefixed with '?'
* Switched from Alex/Happy to Parsec
* Added API documentation via haddock

GenI 0.8, 16 Sep 2005
* Support for latin-1 characters using Unicode wxhaskell
* Added a configure script and an install target in Makefile
* Changed from use of configuration files to use of command line switches
* Full configuration GUI
* Implementation of atomic disjunction
* --ignore-semantics mode (Jackie Lai)

GenI 0.7, 8 June 2005
* Upgraded to ghc 6.4, wxwidgets 2.6, wxhaskell 0.9.4

GenI 0.6, 3 May 2005
* User interface fixes (Window size bugs)
* Interface with Yannick Parmientier's selection module
comments powered byDisqus