3. Files

The phrasebook is available as open-source software, licensed under GNU LGPL. The source code resides in http://code.haskell.org/gf/examples/phrasebook/. Below a short description of the source files.


  • Sentences: general syntactic structures implementable in a uniform way. Concrete syntax via the functor SencencesI.
  • Words: words and predicates, typically language-dependent. Separate concrete syntaxes.
  • Greetings: idiomatic phrases, string-based. Separate concrete syntaxes.
  • Phrasebook: the top module putting everything together. Separate concrete syntaxes.
  • DisambPhrasebook: disambiguation grammars generating feedback phrases if the input language is ambiguous.
  • Numeral: resource grammar module directly inherited from the library.

The module structure image is produced in GF by

    > i -retain DisambPhrasebookEng.gf
    > dg -only=Phrasebook*,Sentences*,Words*,Greetings*,Numeral,NumeralEng,DisambPhrasebookEng
    > ! dot -Tpng _gfdepgraph.dot > pgraph.png


The abstract syntax defines the ontology behind the phrasebook. Some explanations can be found in the ontology document, which is produced from the abstract syntax files Sentences.gf and Words.gf by make doc.

Run-time system and user interface

The phrasebook uses the PGF server written in Haskell and the minibar library written in JavaScript. Since the sources of these systems are available, anyone can build the phrasebook locally on her own computer.