# Grammatical Framework

Version 3.3.3
March 2012

[ Demos | Download | Libraries | Reference | Tutorial | QuickStart | UserGroup | Book | GitHub | Interactive Map New! | ]

[ Issues | Wiki | People | Publications | QuickRefCard | GF Shell Reference | GF Editor Modes | GF Eclipse Plugin | LibTutorial | PGF library API | MOLTO | SummerSchool New! | Android ]

## News

2012-12-10: | Resource Grammar Library coverage map, created by Tommi Nieminen.
2012-11-18: | GF Summer School in Frauenchiemsee, 18-30 August 2013.
2012-11-18: | New resource grammar language: Chinese See library synopsis. Complete but not yet perfect.
2012-06-29: | GF sources now mirrored in GitHub, with change statistics and other browsing features. See `github.com/GrammaticalFramework/GF`
2012-05-07: | New resource grammar language: Japanese. See library synopsis.
2012-03-23: | There will be a GF tutorial at ICFP 2012 in Copenhagen.
2012-03-03: | GF 3.3.3 released! Release notes.
2012-02-24: | New resource grammar languages: Hindi, Sindhi. See library synopsis.
2011-12-29: | New resource grammar languages: Latvian, Thai. See library synopsis.
2011-10-27: | GF 3.3 released! Release notes.
2011-09-20: | There is now a page collecting editor modes for GF. Contributions are welcome!
2011-09-12: | GF 3.2.9 source snapshot with faster grammar compilation available. See Downloads.
2011-04-22: | JPGF Android Tutorial added.
2011-04-15: | The GF Book is available.
2011-01-13: | Phrasedroid available on the Android Market.
2011-01-04: | GF is part of the CLT Toolkit.
2010-12-23: | GF 3.2 released! Release notes.

## What is GF

GF, Grammatical Framework, is a programming language for multilingual grammar applications. It is

- a special-purpose language for grammars, like YACC, Bison, Happy, BNFC, but not restricted to programming languages
- a functional language, like Haskell, Lisp, OCaml, Scheme, SML, but specialized to grammar writing
- a natural language processing framework, like LKB, XLE, Regulus, but based on functional programming and type theory
- a categorial grammar formalism, like ACG, CCG, but different and equipped with different tools
- a logical framework, like Agda, Coq, Isabelle, but equipped with concrete syntax in addition to logic

Don't worry if you don't know most of the references above - but if you do know at least one, it may help you to get a first idea of what GF is.

## Applications

GF can be used for building

- translation systems
- multilingual web gadgets
- natural-language interfaces
- dialogue systems
- natural language resources

## Availability

GF is open-source, licensed under GPL (the program) and LGPL and BSD (the libraries). It is available for

- Linux
- Mac OS X
- Windows
- Android mobile platform (via Java; runtime)
- via compilation to JavaScript, almost any platform that has a web browser (runtime)

## Projects

GF was first created in 1998 at Xerox Research Centre Europe, Grenoble, in the project Multilingual Document Authoring. At Xerox, it was used for prototypes including a restaurant phrase book, a database query system, a formalization of an alarm system instructions with translations to 5 languages, and an authoring system for medical drug descriptions.

Later projects using GF and involving third parties include, in chronological order,

- GF-Alfa: natural language interface to formal proofs
- Efficient: authoring tool for business models.
- GF-KeY: authoring and translation of software specifications
- TALK: multilingual and multimodal spoken dialogue systems
- WebALT: multilingual generation of mathematical exercises (commercial project)
- SALDO: Swedish morphological dictionary based on rules developed for GF and Functional Morphology
- MOLTO: multilingual online translation.

Academically, GF has been used in four PhD theses and resulted in around fifty scientific publications (see GF publication list).

## Programming in GF

GF is easy to learn by following the tutorial. You can write your first translator in 15 minutes.

GF has an interactive command interpreter, as well as a batch compiler. Grammars can be compiled to parser and translator code in many different formats. These components can then be embedded in applications written in other programming languages. The formats currently supported are:

- Haskell
- Java, in particular the Android platform
- JavaScript
- Speech recognition: HTK/ATK, Nuance, JSGF

The GF programming language is high-level and advanced, featuring

- static type checking
- higher-order functions
- dependent types
- pattern matching with data constructors and regular expressions
- module system with multiple inheritance and parametrized modules

## Libraries

Libraries are at the heart of modern software engineering. In natural language applications, libraries are a way to cope with thousands of details involved in syntax, lexicon, and inflection. The GF resource grammar library has support for an increasing number of languages, currently including

1. Amharic (partial)
2. Arabic (partial)
3. Bulgarian
4. Catalan
5. Chinese
6. Danish
7. Dutch
8. English
9. Finnish
10. French
11. German
12. Hindi
13. Interlingua
14. Japanese
15. Italian
16. Latin (fragments)
17. Latvian
18. Nepali
19. Norwegian bokmål
20. Persian
21. Polish
22. Punjabi
23. Romanian
24. Russian
25. Sindhi
26. Spanish
27. Swedish
28. Thai
29. Turkish (fragments)
30. Urdu

Adding a language to the resource library takes 3 to 9 months - contributions are welcome! You can start with the resource grammarian's tutorial.