GrammaticalFramework / gf-rgl

Grammatical Framework's Resource Grammar Library (RGL)
https://www.grammaticalframework.org/
Other
52 stars 51 forks source link

GF Logo

GF Resource Grammar Library (RGL)

The GF Resource Grammar Library is the standard library for Grammatical Framework. It covers the morphology and basic syntax of over 30 languages.

For more about the RGL, see the synopsis page.

Choose your build method

There are 3 ways to build and install the RGL:

Install locations

The install scripts will try to determine where to copy the compiled RGL modules. It will look for, in this order:

Language config

A list of all languages and their properties is maintained centrally in languages.csv. This file should be kept up-to-date and all build methods should read this config file. If you see something wrong, please report/fix it.

# Column Description Default
1 Code 3-letter language code, e.g. Eng -
2 Name language name in English, e.g. English -
3 Directory folder name under src, e.g. english -
4 Functor functor name (not used) -
5 Unlexer unlexer (not used) -
6 Present language is marked with --# notpresent n
7 All compile All module y
8 Try compile Try module y
9 Symbolic compile Symbolic module y
10 Compatibility complile Compatibility module n
11 Synopsis include language in the RGL synopsis n

If default is y then anything other than n, including the empty string, is treated as true (and vice versa when default is n).

Using Make

If you have Make installed and don't care about advanced settings, you can compile the RGL and install it to the default location with:

make install

This is the same as make build followed by make copy. There is also make clean available.

The Makefile will try to use the Haskell install script, falling back to the shell script if you do not have Haskell installed.

Haskell script: Setup.hs

This build method gives you most options. You will need Haskell installed on your system.

Run the build script with:

runghc Setup.hs ...

Where ... is one of:

build   [CMDS] [MODE] [--langs=[+|-]LANG,LANG,...] [--gf=...] [--verbose|-v]
copy    [MODE] [--dest=...]
install [CMDS] [MODE] [--langs=[+|-]LANG,LANG,...] [--gf=...] [--dest=...] [--verbose|-v]
clean

Shell script: Setup.sh

This method is provided as an alternative for those who don't have Haskell installed. Simply run the script to build the entire RGL and install in the default location.

You can pass the following flags:

Windows batch file: Setup.bat

This method is provided as an alternative for Windows users who don't have Haskell or Bash installed.

It is supposed to be a port of Setup.sh and works in largely the same way. In particular, it accepts the same flags (in the same format) as described above.

However it currently tries to build all modules for all languages and doesn't consider the details of which modules should be compiled for each language (specified in languages.csv)

About this repository

On 2018-07-25, the monolithic GF repository was split in two:

  1. gf-core — the GF compiler, shell and runtimes
  2. gf-rgl — the resource grammar library

The former repository is now archived and no longer updated. The split was performed using this script and the output of that script is here.