GF Resource Grammar Library

First Draft, Gothenburg, 7 February 2005

Aarne Ranta

aarne@cs.chalmers.se

The purpose of the resource grammar library

Basic syntactic structures

All morphological paradigms

Basic lexicon of structural, common, and irregular words

Success criteria

Grammatical correctness

Semantic coverage

Usability as library for non-linguists

These are not success criteria

Language coverage

Semantic correctness

  colourless green ideas sleep furiously

  the time is seventy past forty-two

Languages

  • Danish
  • English
  • Finnish
  • French
  • German
  • Italian
  • Norwegian
  • Russian
  • Spanish
  • Swedish

    Library structure: overview

    Language-independent API

    Language-dependent resources

    Library structure: language-independent API

    API documentation

    Categories

    Rules

    Clause

    Structural

    Time

    Basic

    Lang

    Paradigms documentation

    English

    English verbs

    Swedish

    example of Swedish

    Use as top-level grammar: testing

    Import a set of $LangX$ grammars:
      i english/LangEng.gf
      i swedish/LangSwe.gf
    
    Test with random generation, translation, morphological analysis...
    
    
    

    Use as top-level grammar: language learning quizzes

    Morpho quiz with words:
    
    
    
    Morpho quiz with phrases:
    
    
    
    Translation quiz with sentences:
    
    
    

    Use as library

    Import directly by open:
      concrete AppNor of App = open LangNor, ParadigmsNor in {...}
    
    No more dummy reuse modules and bulky .gfr files!

    If you need to convert resource category records to/from strings, use

      Predef.toStr : (L : Type) -> L -> Str ; 
    
    L must be a linearization type. For instance,
      toStr LangNor.CN (ModAP (PositADeg old_ADeg) (UseN car_N))
      ---> "gammel bil"
    

    Use as library through parser

    Use the parser when developing a resource.
      > p -cat=S -v "jag ska åka till Chalmers"
      unknown tokens [TS "åka",TS "Chalmers"]
    
      > p -cat=S "jag ska gå till Danmark"
      UseCl (PosTP TFuture ASimul)
        (AdvCl (SPredV i_NP go_V)
        (AdvPP (PrepNP to_Prep (UsePN (PNCountry Denmark)))))
    
    Extend vocabulary at need.
      åka_V = lexV "åker" ; 
      Chalmers = regPN "Chalmers" neutrum ;
    

    Example application: a small translation system

    Implementation details: the structure of low-level files

    The use of parametric modules

    In two language families:

    Current status

    Language v0.6 API Paradigms Basic lex Verbs
    Danish X
    English X X X X X
    Finnish X
    French X * * *
    German X *
    Italian X * * *
    Norwegian X
    Russian X * *
    Spanish * *
    Swedish X X X X *

    Obtaining it

    Now on CVS at Chalmers:
      cvs -d /users/cs/aarne/cvs checkout GF2.0/lib
    

    To appear later at GF Homepage:

    http://www.cs.chalmers.se/~aarne/GF