CSLI Publications logo
new books
catalog
series
knuth books
contact
for authors
order
search
CSLI Publications
Facebook
 
Grammatical Framework cover

Grammatical Framework

Programming with Multilingual Grammars

Aarne Ranta

Grammatical Framework is a programming language designed for writing grammars, which has the capability of addressing several languages in parallel. This thorough introduction demonstrates how to write grammars in Grammatical Framework and use them in applications such as tourist phrasebooks, spoken dialogue systems, and natural language interfaces. The examples and exercises presented here address several languages, and the readers are shown how to look at their own languages from the computational perspective.

Aarne Ranta is professor of computer science at the University of Gothenburg, Sweden. He is the acting coordinator of the European Union research project MOLTO (Multilingual On-Line Translation), which develops techniques for high-quality translation among fifteen languages.

Contents

  • Preface
  • Acknowledgements
  • Web Resources and the GF System
  • 1 Introduction
    • 1.1 What this book is about
    • 1.2 How to use this book
    • 1.3 The role of grammars in language processing
    • 1.4 The cost of grammars
    • 1.5 Multilinguality
    • 1.6 Semantic actions and interoperability
    • 1.7 Application grammars and resource grammars
    • 1.8 History of GF and its applications
    • 1.9 Related work

  • I A GF Tutorial
  • 2 Basic concepts of multilingual grammars
    • 2.1 The BNF grammar format
    • 2.2 Using the GF system
    • 2.3 Testing a grammar in the GF system
    • 2.4 A BNF grammar for Italian
    • 2.5 BNF grammars and translation
    • 2.6 Abstract and concrete syntax
    • 2.7 Translating in GF
    • 2.8 The structure of grammar modules
    • 2.9 On the limitations of BNF grammars
    • 2.10 Suppression and metavariables
    • 2.11 Free variation
    • 2.12 Ambiguity
    • 2.13 Remaining problems
    • 2.14 Graph-based visualization and shell escapes
    • 2.15 Lexing and unlexing
    • 2.16 Character encoding

  • 3 Parameters, tables, and records
    • 3.1 The problem of morphological variation
    • 3.2 Parameters and tables
    • 3.3 Variable vs. inherent features
    • 3.4 Records and record types
    • 3.5 Linearization types and agreement
    • 3.6 Funtional programming in GF: operation definitions
    • 3.7 The Food grammar revisited
    • 3.8 Testing inflection and operations in GF
    • 3.9 Partial application
    • 3.10 Discontinuous constiuents
    • 3.11 Non-concatentative morphology

  • 4 Modular and scalable grammar writing
    • 4.1 Reusable resource modules
    • 4.2 Data abstraction
    • 4.3 Case expressions and string matching
    • 4.4 Smart paradigms
    • 4.5 Arabic morphology revisited
    • 4.6 Seperating operation types and definitions
    • 4.7 Overloading of operations
    • 4.8 Module extension and inheritance
    • 4.9 Inheritance and opening
    • 4.10 Dependency graphs
    • 4.11 Algebraic datatypes for parameters
    • 4.12 Record extension and subtyping
    • 4.13 Tuples and product types
    • 4.14 Prefix-dependent choices and pattern macros
    • 4.15 Strings at compile time vs. run time

  • 5 Usining the Resource Grammar Library
    • 5.1 The purpose and coverage of the library
    • 5.2 Lexical vs. phrasal rules
    • 5.3 Lexical categories and rules
    • 5.4 Phrasal categories and rules
    • 5.5 The resource API
    • 5.6 The library path
    • 5.7 Example: English
    • 5.8 Functor implementation of multilingual grammars
    • 5.9 Interfaces and instances
    • 5.10 A design pattern for multilingual grammars
    • 5.11 Division of labour revisited
    • 5.12 Overriding a functor
    • 5.13 Compile-time transfer
    • 5.14 The resource grammar as a linguistic ontology
    • 5.15 A tour of the resource API
    • 5.16 Flattening of constructions
    • 5.17 Tense and polarity
    • 5.18 Browsing the library

  • 6 Semantic actions and conditions in abstract syntax
    • 6.1 GF as a logical framework
    • 6.2 Dependent types
    • 6.3 Selectional restrictions
    • 6.4 Polymorphism
    • 6.5 Dependent types in concrete syntax
    • 6.6 Proof objects
    • 6.7 Proof-carrying documents
    • 6.8 Restricted polymorphism
    • 6.9 Variable bindings and higher-order abstract syntax
    • 6.10 Anaphoric expressions
    • 6.11 Semantic definitions
    • 6.12 Intensional and extensional equality
    • 6.13 Semantic actions and run-time transfer
    • 6.14 Predfined categories
    • 6.15 Probabilistic GF grammars

  • II Larger Grammars and Applications
  • 7 Embedded grammars and code generation
    • 7.1 The portable grammar format
    • 7.2 The embedded interpreter and its API
    • 7.3 Embedded GF applications in Haskell
    • 7.4 The module PGF
    • 7.5 A stand-alone translator
    • 7.6 A translator loop
    • 7.7 A question-answer system
    • 7.8 Exporting GF datatypes
    • 7.9 Putting it all together
    • 7.10 Web server applications
    • 7.11 Embedded grammars in other host languages
    • 7.12 Multilingual syntax editing
    • 7.13 Language models for speech recognition
    • 7.14 Statistical language models
    • 7.15 Multimodal dialogue systems

  • 8 Interfacing formal and natural languages
    • 8.1 Arithmetic expressions
    • 8.2 Code generation as linearization
    • 8.3 Programs with variables
    • 8.4 The concrete syntax of assignments
    • 8.5 A liberal syntax of variables
    • 8.6 Is GF useful for defining gormal languages?
    • 8.7 Natural language generation from logic
    • 8.8 Logical semantics of natural language
    • 8.9 Grammars for fractals

  • 9 Getting started with resource grammar programming
    • 9.1 Overview
    • 9.2 The miniature resource grammar
    • 9.3 Feature design
    • 9.4 Predication
    • 9.5 Complementation
    • 9.6 Determination
    • 9.7 Modification
    • 9.8 Lexical insertion
    • 9.9 The miniature resource in Italian
    • 9.10 Implementating morphology
    • 9.11 Implementing modification and determination
    • 9.12 Implementing verb phrases and complementation
    • 9.13 Implementing predication
    • 9.14 Implementing the rest
    • 9.15 Coordination and extraction

  • 10 Extending the Resource Grammar Library
    • 10.1 The module structure of resource grammar
    • 10.2 Effort statistics
    • 10.3 Workflow for a new language
    • 10.4 Reusing code from the miniature resource
    • 10.5 The development-test cycle
    • 10.6 Non-ASCII alphabets and transliterations
    • 10.7 Coding discipline
    • 10.8 Functors in the resource grammar
    • 10.9 Widening the coverage for parsing text
    • 10.10 Bootstrapping a resource lexicon

  • Appendix A: A miniature resource grammar
    • A.1 Abstract syntax
    • A.2 Auxiliary resource module for Italian
    • A.3 Italian concrete syntax
    • A.4 Morphological paradigms API for Italian
    • A.5 Test lexicon
    • A.6 Syntax API

  • Appendix B: A glossary of linguistic terms
  • III GF Reference Manual
  • Appendix C: The GF Programming Language
    • C.1 Overview of GF
    • C.2 The module system
    • C.3 Judgements
    • C.4 Types and expressions
    • C.5 Flags and pragmas
    • C.6 The grammar of GF

  • Appendix D: The GF Resource Grammar Library
    • D.1 The category system
    • D.2 Syntax rules
    • D.3 Lexical Paradigms
    • D.4 Other library modules

  • Appendix E: The GF Software System
    • E.1 The GF shell
    • E.2 The GF batch compiler

  • Appendix F: Bibliography
    • F.1 Publications on GF
    • F.2 Background and related work

  • Index

April 2011

ISBN (Paperback): 9781575866260
ISBN (Cloth): 9781575866277
ISBN (Electronic): 9781575867311

Add to Cart
View Cart

Check Out

Distributed by the
University of
Chicago Press

pubs @ csli.stanford.edu