Adding Polish to informath (grammars/next) exposed a set of gaps. Unlike
Czech, StructuralPol was already complete; what was missing was a handful
of lins, a way to govern the nominative, and some outright mistakes.
Missing lins, all reached as qualified Grammar.X by the application's
functors and so not shimmable from the application side:
AdjectivePol AdvAP
SentencePol SSubjS
IdiomPol ImpP3
StructuralPol that_Subj
MarkupPol new module (Markup is not part of the RGL build script,
so it is compiled on demand, as MarkupCze is)
ParadigmsPol mkAdv (every other ParadigmsX has it; the application
interfaces reach it as Paradigms.mkAdv)
ImpP3 has no third-person imperative to use, so it takes the standard
"niech" periphrasis. The copula takes the future ("niech x będzie grupą")
and every other verb the present ("niech x należy do A"): być is the only
Polish verb with a synthetic future, and imienne marks exactly the copular
VPs.
NomPrep: ComplCase had no nominative at all, so "jako", "niż" and
"zdefiniowany jako" -- all of which govern the nominative -- came out
locative ("mniejszy niż liczbie"). mkCompl now maps Nom to a new NomPrep,
and the dep tables of the pronouns, nounPN, mkPN and the structural NPs
cover it. LexiconNounPol is marked DO NOT EDIT, but paris_PN and john_PN
inline their own dep tables and so had to be extended too.
Two corrections:
VerbPol.CompCN used the nominative for a predicative noun, giving
"x jest grupa"; Polish uses the instrumental, as CompNP right below it
already does.
ExtendPol.ExistsNP inherited ExistNP from ExtendFunctor, giving
"jest macierz". Polish distinguishes the two: "there exists" is istnieć,
which is what mathematical prose uses.
ParadigmsPol.guess_paradigm_basic never matched -ość, the productive
feminine abstract suffix, so sprzeczność took a masculine declension
(*sprzeczności/a, *sprzecznościowi) despite being tagged feminine. It now
routes to the kość paradigm.
Also documents, without changing, why the 2-string mkN throws its genitive
away: guess_paradigm's 2-string table is unsound (its first branch matches
every noun in -a, and its branches disagree about whether mkNTable* takes
the nominative or the bare stem), so passing sggen to it turns
"liczba"/"liczby" into *liczbaa. The 1-string guesser is the sound path
until that table is repaired.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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:
- Haskell script
Setup.hs - Shell script
Setup.sh(does not require Haskell) - Windows batch file
Setup.bat(does not require Haskell)
Install locations
The install scripts will try to determine where to copy the compiled RGL modules. It will look for, in this order:
- the
--dest=flag (see below) - the
GF_LIB_PATHenvironment variable - the file
../gf-core/DATA_DIR(relative to this directory). This only works if you have thegf-coreandgf-rglrepositories in the same top-level directory and you have already compiled GF from source. (This is considered a bit hacky and will probably disappear in the future).
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
CMDSis one or more of:prelude,all,lang,api,compat, or an explicit module name (e.g.ExtraEng.gf. You don't need to specify to language subdirectory, but there is a restriction that the module must exist in a direct subdirectory ofsrc). If ommitted, the default command isprelude all.MODEis one of:present,alltenses(default is both).LANGis a 3-letter language code, e.g.Eng,Sweetc.- You can override the default language list with
--langs=... You can add languages to the default list with--langs=+...- You can remove languages from the default list with
langs=-... - The path to GF installed on your system can be specified via the
--gfflag (default is that thegfexecutable is in the global system path). - The
--destflag can be used to manually specify where the compiled RGL modules should be copied/installed. This is the same place asGF_LIB_PATH.
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:
--dest=...to manually specify the install location--gf=...to specify the path to thegfexecutable, if not available on the system path--verboseor-vto show a list of files being built (errors will always be shown)
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:
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.