Compare commits
75 Commits
sense-disa
...
GF-3.10
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d06539c35c | ||
|
|
60738dda6d | ||
|
|
e628e3fe0f | ||
|
|
769743c5c0 | ||
|
|
1c75d417ee | ||
|
|
5c518de0f2 | ||
|
|
e6c2c844e9 | ||
|
|
883a7a95a1 | ||
|
|
831252eb81 | ||
|
|
fdc5659f80 | ||
|
|
4d34c7f66b | ||
|
|
f898c250ba | ||
|
|
5ef390f188 | ||
|
|
fa5c6a2949 | ||
|
|
d0bc368358 | ||
|
|
e0dca729d6 | ||
|
|
47c983c625 | ||
|
|
01f61c526f | ||
|
|
538fe5bddb | ||
|
|
f4052c8a5e | ||
|
|
e0a3b0030e | ||
|
|
b30456aa0c | ||
|
|
61c58316ea | ||
|
|
001d036a2c | ||
|
|
fe7d01f7e3 | ||
|
|
a7e43d872f | ||
|
|
d6fc50b40b | ||
|
|
9e02319b6d | ||
|
|
6278deb7a2 | ||
|
|
c6ec8cf302 | ||
|
|
07768ba4c4 | ||
|
|
e2401f32ca | ||
|
|
69cea20dac | ||
|
|
32ce03dc94 | ||
|
|
83abaa9b44 | ||
|
|
c7a14537c1 | ||
|
|
8560b4fb65 | ||
|
|
b0c3aef6ec | ||
|
|
6352799ccb | ||
|
|
a45c735545 | ||
|
|
05c2cfb628 | ||
|
|
69ad1e617e | ||
|
|
eb2774af2b | ||
|
|
9b28d21b0a | ||
|
|
507236fdcd | ||
|
|
397f18a298 | ||
|
|
b1611eccd8 | ||
|
|
c8eb1010c5 | ||
|
|
14d35c8a31 | ||
|
|
9bf5c98509 | ||
|
|
8821f8baa8 | ||
|
|
8a45d23d63 | ||
|
|
abf3911b70 | ||
|
|
735f5ff76f | ||
|
|
cb0e919bf5 | ||
|
|
d1a435ad9d | ||
|
|
69ba677136 | ||
|
|
406eec6690 | ||
|
|
2f1ee094d2 | ||
|
|
422248f11f | ||
|
|
d46682bc29 | ||
|
|
8596fc5d26 | ||
|
|
4958aab518 | ||
|
|
390a6a04a1 | ||
|
|
37e0754cf0 | ||
|
|
a7b2f77227 | ||
|
|
9a7862ea9e | ||
|
|
914d54255f | ||
|
|
aea8548930 | ||
|
|
99dad48961 | ||
|
|
0b4d9cbea1 | ||
|
|
1010b9e49a | ||
|
|
f7dc9a6eaf | ||
|
|
7867c8c828 | ||
|
|
632cd1e522 |
19
.gitignore
vendored
@@ -39,8 +39,23 @@ src/runtime/c/sg/.dirstamp
|
||||
src/runtime/c/stamp-h1
|
||||
src/runtime/java/.libs/
|
||||
src/runtime/python/build/
|
||||
src/ui/android/libs/
|
||||
src/ui/android/obj/
|
||||
.cabal-sandbox
|
||||
cabal.sandbox.config
|
||||
.stack-work
|
||||
DATA_DIR
|
||||
|
||||
# Generated documentation (not exhaustive)
|
||||
demos/index-numbers.html
|
||||
demos/resourcegrammars.html
|
||||
demos/translation.html
|
||||
doc/tutorial/gf-tutorial.html
|
||||
doc/gf-bibliography.html
|
||||
doc/gf-developers.html
|
||||
doc/gf-editor-modes.html
|
||||
doc/gf-people.html
|
||||
doc/gf-reference.html
|
||||
doc/gf-shell-reference.html
|
||||
doc/icfp-2012.html
|
||||
download/*.html
|
||||
gf-book/index.html
|
||||
src/www/gf-web-api.html
|
||||
|
||||
19
LICENSE
@@ -8,24 +8,9 @@ other. For this reason the different components have different licenses.
|
||||
In summary:
|
||||
|
||||
- the GF compiler in the folder src/compiler and the PGF Web service in src/server
|
||||
are under the GNU GENERAL PUBLIC LICENSE.
|
||||
are under the GNU GENERAL PUBLIC LICENSE.
|
||||
|
||||
- the GF runtime in src/runtime is under dual GNU LESSER GENERAL PUBLIC LICENSE
|
||||
and BSD LICENSE
|
||||
|
||||
- the resource grammar library in lib/src is under GNU LESSER GENERAL PUBLIC LICENSE.
|
||||
However the user have the right to choose any license for any application grammar
|
||||
derived from the resource grammar by using the grammar API.
|
||||
|
||||
- the resource grammar library also includes large coverage lexicons for some languages.
|
||||
Since these lexicons are derived from external sources they might be under different licenses.
|
||||
Look at the source file for every lexicon for details. The lexicons that we currently have
|
||||
are:
|
||||
|
||||
lib/src/bulgarian/ DictBul.gf DictBulAbs.gf for Bulgarian
|
||||
lib/src/english/ DictEng.gf DictEngAbs.gf for English
|
||||
lib/src/turkish/ DictTur.gf DictTurAbs.gf for Turkish
|
||||
lib/src/swedish/ DictSwe.gf DictSweAbs.gf for Swedish
|
||||
- the GF runtime in src/runtime is under dual GNU LESSER GENERAL PUBLIC LICENSE and BSD LICENSE
|
||||
|
||||
The rest of this document contains copies of the GPL, LGPL and BSD licenses
|
||||
which are applicable to the different components of Grammatical Framework
|
||||
|
||||
3
Makefile
@@ -20,6 +20,7 @@ doc:
|
||||
|
||||
clean:
|
||||
cabal clean
|
||||
bash bin/clean_html
|
||||
|
||||
gf:
|
||||
cabal build rgl-none
|
||||
@@ -32,7 +33,7 @@ html::
|
||||
# number to the top of debian/changelog.
|
||||
# (Tested on Ubuntu 15.04. You need to install dpkg-dev & debhelper.)
|
||||
deb:
|
||||
dpkg-buildpackage -b
|
||||
dpkg-buildpackage -b -uc
|
||||
|
||||
# Make an OS X Installer package
|
||||
pkg:
|
||||
|
||||
@@ -37,13 +37,6 @@ The simplest way of installing GF is with the command:
|
||||
cabal install
|
||||
```
|
||||
|
||||
This can be broken down into the usual sub-steps:
|
||||
```
|
||||
cabal configure
|
||||
cabal build
|
||||
cabal copy
|
||||
```
|
||||
|
||||
For more details, see the [download page](http://www.grammaticalframework.org/download/index.html)
|
||||
and [developers manual](http://www.grammaticalframework.org/doc/gf-developers.html).
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ buildWeb gf flags (pkg,lbi) = do
|
||||
gf_lib_path = datadir (absoluteInstallDirs pkg lbi dest) </> "lib"
|
||||
args = numJobs flags++["-make","-s"] -- ,"-optimize-pgf"
|
||||
++["--gfo-dir="++tmp_dir,
|
||||
"--gf-lib-path="++gf_lib_path,
|
||||
--"--gf-lib-path="++gf_lib_path,
|
||||
"--name="++dropExtension pgf,
|
||||
"--output-dir="++gfo_dir]
|
||||
++[dir</>file|file<-src]
|
||||
@@ -104,9 +104,10 @@ setupWeb dest (pkg,lbi) = do
|
||||
copy_pgf (pgf,subdir,_) =
|
||||
do let src = gfo_dir </> pgf
|
||||
let dst = grammars_dir </> pgf
|
||||
putStrLn $ "Installing "++dst
|
||||
ex <- doesFileExist src
|
||||
if ex then copyFile src dst else return ()
|
||||
if ex then do putStrLn $ "Installing "++dst
|
||||
copyFile src dst
|
||||
else putStrLn $ "Not installing "++dst
|
||||
|
||||
gf_logo = "gf0.png"
|
||||
|
||||
|
||||
@@ -16,13 +16,14 @@ name="gf-$ver"
|
||||
destdir="$PWD/dist/$name" # assemble binary dist here
|
||||
prefix=${PREFIX:-/usr/local} # where to install
|
||||
fmt=${FMT:-tar.gz} # binary package format (tar.gz or pkg)
|
||||
ghc=${GHC:-ghc} # which Haskell compiler to use
|
||||
|
||||
extralib="$destdir$prefix/lib"
|
||||
extrainclude="$destdir$prefix/include"
|
||||
extra="--extra-lib-dirs=$extralib --extra-include-dirs=$extrainclude"
|
||||
|
||||
set -e # Stop if an error occurs
|
||||
set -x # print commands before exuting them
|
||||
set -x # print commands before executing them
|
||||
|
||||
## First configure & build the C run-time system
|
||||
pushd src/runtime/c
|
||||
@@ -64,13 +65,30 @@ else
|
||||
fi
|
||||
|
||||
## Build GF, with C run-time support enabled
|
||||
cabal install --only-dependencies -fserver -fc-runtime $extra
|
||||
cabal configure --prefix="$prefix" -fserver -fc-runtime $extra
|
||||
cabal install -w "$ghc" --only-dependencies -fserver -fc-runtime $extra
|
||||
cabal configure -w "$ghc" --prefix="$prefix" -fserver -fc-runtime $extra
|
||||
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
|
||||
# Building the example grammars will fail, because the RGL is missing
|
||||
cabal copy --destdir="$destdir" # create www directory
|
||||
|
||||
## Build the RGL and copy it to $destdir
|
||||
PATH=$PWD/dist/build/gf:$PATH
|
||||
export GF_LIB_PATH="$(dirname $(find "$destdir" -name www))/lib" # hmm
|
||||
mkdir -p "$GF_LIB_PATH"
|
||||
pushd ../gf-rgl
|
||||
make build
|
||||
make copy
|
||||
popd
|
||||
|
||||
# Build GF again, including example grammars that need the RGL
|
||||
DYLD_LIBRARY_PATH="$extralib" LD_LIBRARY_PATH="$extralib" cabal build
|
||||
|
||||
## Copy GF to $destdir
|
||||
cabal copy --destdir="$destdir"
|
||||
libdir=$(dirname $(find "$destdir" -name PGF.hi))
|
||||
cabal register --gen-pkg-config=$libdir/gf-$ver.conf
|
||||
|
||||
## Create the binary distribution package
|
||||
case $fmt in
|
||||
tar.gz)
|
||||
targz="$name-bin-$hw-$os.tar.gz" # the final tar file
|
||||
|
||||
8
bin/clean_html
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script finds all .t2t (txt2tags) files and deletes the corresponding html file
|
||||
|
||||
find . -name '*.t2t' | while read t2t ; do
|
||||
html="${t2t%.t2t}.html"
|
||||
rm -f "$html"
|
||||
done
|
||||
135
bin/template.html
Normal file
@@ -0,0 +1,135 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="$lang$" xml:lang="$lang$"$if(dir)$ dir="$dir$"$endif$>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
$for(author-meta)$
|
||||
<meta name="author" content="$author-meta$" />
|
||||
$endfor$
|
||||
$if(date-meta)$
|
||||
<meta name="dcterms.date" content="$date-meta$" />
|
||||
$endif$
|
||||
$if(keywords)$
|
||||
<meta name="keywords" content="$for(keywords)$$keywords$$sep$, $endfor$" />
|
||||
$endif$
|
||||
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
|
||||
$for(css)$
|
||||
<link rel="stylesheet" href="$css$" />
|
||||
$endfor$
|
||||
$if(math)$
|
||||
$math$
|
||||
$endif$
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
$for(header-includes)$
|
||||
$header-includes$
|
||||
$endfor$
|
||||
</head>
|
||||
<body>
|
||||
$for(include-before)$
|
||||
$include-before$
|
||||
$endfor$
|
||||
<div class="container-fluid my-5" style="max-width:1200px">
|
||||
|
||||
$if(title)$
|
||||
<header id="title-block-header">
|
||||
<a href="$rel-root$" title="Home">
|
||||
<img src="$rel-root$/doc/Logos/gf1.svg" height="200px" class="float-md-right mb-3 bg-white" alt="GF Logo">
|
||||
</a>
|
||||
<h1 class="title">$title$</h1>
|
||||
$if(subtitle)$
|
||||
<p class="subtitle">$subtitle$</p>
|
||||
$endif$
|
||||
$for(author)$
|
||||
<p class="author">$author$</p>
|
||||
$endfor$
|
||||
$if(date)$
|
||||
<p class="date">$date$</p>
|
||||
$endif$
|
||||
</header>
|
||||
$endif$
|
||||
$if(toc)$
|
||||
<nav id="$idprefix$TOC">
|
||||
$table-of-contents$
|
||||
</nav>
|
||||
$endif$
|
||||
$body$
|
||||
</div><!-- .container -->
|
||||
|
||||
<footer class="bg-light mt-5 py-5">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-6 col-sm-3">
|
||||
<a href="$rel-root$">
|
||||
<i class="fas fa-home"></i>
|
||||
Home
|
||||
</a>
|
||||
<h6 class="text-muted mt-3">Get started</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li>
|
||||
<li><a href="http://cloud.grammaticalframework.org/">GF Cloud</a></li>
|
||||
<li><a href="$rel-root$/doc/tutorial/gf-tutorial.html">Tutorial</a></li>
|
||||
<li><a href="$rel-root$/download"><strong>Download GF</strong></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-sm-3">
|
||||
<h6 class="text-muted">Learn more</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="$rel-root$/gf-book">The GF Book</a></li>
|
||||
<li><a href="$rel-root$/doc/gf-refman.html">Reference Manual</a></li>
|
||||
<li><a href="$rel-root$/doc/gf-shell-reference.html">GF Shell Reference</a></li>
|
||||
<li><a href="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</a></li>
|
||||
<li><a href="$rel-root$/lib/doc/synopsis/index.html"><strong>RGL Synopsis</strong></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-sm-3">
|
||||
<h6 class="text-muted">Develop</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="$rel-root$/doc/gf-developers.html">Developers Guide</a></li>
|
||||
<li><a href="http://hackage.haskell.org/package/gf/docs/PGF.html">PGF library API (Haskell runtime)</a></li>
|
||||
<li><a href="$rel-root$/doc/runtime-api.html">PGF library API (C runtime)</a></li>
|
||||
<li><a href="http://hackage.haskell.org/package/gf/docs/GF.html">GF compiler API</a></li>
|
||||
<li><a href="$rel-root$/doc/gf-editor-modes.html">Text Editor Support</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-6 col-sm-3">
|
||||
<h6 class="text-muted">Contribute</i>
|
||||
</h6>
|
||||
<ul class="list-unstyled">
|
||||
<li><a href="http://groups.google.com/group/gf-dev">Mailing List</a></li>
|
||||
<li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Issue Tracker</a></li>
|
||||
<li><a href="$rel-root$/doc/gf-people.html">Authors</a></li>
|
||||
<li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li>
|
||||
</ul>
|
||||
<h6 class="text-muted">
|
||||
Repositories
|
||||
<i class="fab fa-github ml-1"></i>
|
||||
</h6>
|
||||
<a href="https://github.com/GrammaticalFramework/gf-core">GF</a> ·
|
||||
<a href="https://github.com/GrammaticalFramework/gf-rgl">RGL</a> ·
|
||||
<a href="https://github.com/GrammaticalFramework/gf-contrib">Contributions</a>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
</footer>
|
||||
$for(include-after)$
|
||||
$include-after$
|
||||
$endfor$
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
try {
|
||||
var pageTracker = _gat._getTracker("UA-7811807-3");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}</script>
|
||||
</body>
|
||||
</html>
|
||||
117
bin/update_html
@@ -1,11 +1,114 @@
|
||||
#!/bin/bash
|
||||
|
||||
### This script finds all .t2t (txt2tags) files and updates the corresponding
|
||||
### .html file, if it is out-of-date.
|
||||
# Path to directory where this script is
|
||||
# https://stackoverflow.com/a/246128/98600
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
|
||||
find . -name '*.t2t' | while read t2t ; do
|
||||
html="${t2t%.t2t}.html"
|
||||
if [ "$t2t" -nt "$html" ] ; then
|
||||
txt2tags -thtml "$t2t"
|
||||
# Render txt2tags into html file
|
||||
# Arguments:
|
||||
# 1. txt2tags source file, e.g. download/index.t2t
|
||||
# 2. html target file, e.g. download/index.html
|
||||
function render_t2t_html {
|
||||
t2t="$1"
|
||||
html="$2"
|
||||
tmp="$2.tmp"
|
||||
relroot="$( dirname $t2t | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )"
|
||||
|
||||
# First render with txt2tags to handle pre/post processing
|
||||
txt2tags \
|
||||
--target=html \
|
||||
--no-headers \
|
||||
--quiet \
|
||||
--outfile="$tmp" \
|
||||
--infile="$t2t"
|
||||
|
||||
# Capture first 3 lines of t2t file: title, author, date
|
||||
# Documentation here: https://txt2tags.org/userguide/headerarea
|
||||
l1=$(head -n 1 "$t2t")
|
||||
l2=$(tail -n+2 "$t2t" | head -n 1)
|
||||
l3=$(tail -n+3 "$t2t" | head -n 1)
|
||||
title=
|
||||
author=
|
||||
date=
|
||||
if [ -n "$l1" ] ; then
|
||||
title="$l1"
|
||||
if [ -n "$l2" ] ; then author="$l2" ; fi
|
||||
if [ -n "$l3" ] ; then date="$l3" ; fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Run txt2tag's HTML through Pandoc for cleanup
|
||||
pandoc \
|
||||
--from=html \
|
||||
--to=html5 \
|
||||
--standalone \
|
||||
--template="$DIR/template.html" \
|
||||
--variable="rel-root:$relroot" \
|
||||
--metadata="title:$title" \
|
||||
--metadata="author:$author" \
|
||||
--metadata="date:$date" \
|
||||
"$tmp" \
|
||||
--output="$html"
|
||||
rm -f "$tmp"
|
||||
|
||||
# Final post-processing
|
||||
if [ -f "$html" ] ; then
|
||||
sed -i.bak "s/<table/<table class=\"table\"/" "$html" && rm "$html.bak"
|
||||
echo "$html"
|
||||
fi
|
||||
}
|
||||
|
||||
# Render markdown into html file
|
||||
# Arguments:
|
||||
# 1. markdown source file, e.g. download/index.md
|
||||
# 2. html target filen, e.g. download/index.html
|
||||
function render_md_html {
|
||||
md="$1"
|
||||
html="$2"
|
||||
relroot="$( dirname $md | sed -E 's/^.\///' | sed -E 's/[^/]+/../g' )"
|
||||
|
||||
pandoc \
|
||||
--from=markdown \
|
||||
--to=html5 \
|
||||
--standalone \
|
||||
--template="$DIR/template.html" \
|
||||
--variable="rel-root:$relroot" \
|
||||
"$md" \
|
||||
--output="$html"
|
||||
|
||||
# Final post-processing
|
||||
if [ -f "$html" ] ; then
|
||||
sed -i.bak "s/<table/<table class=\"table\"/" "$html" && rm "$html.bak"
|
||||
echo "$html"
|
||||
fi
|
||||
}
|
||||
|
||||
if [ $# -gt 0 ] ; then
|
||||
# Render specific file(s) from args, ignoring dates
|
||||
for file in "$@" ; do
|
||||
ext="${file##*.}"
|
||||
html="${file%.$ext}.html"
|
||||
case $ext in
|
||||
"md")
|
||||
render_md_html "$file" "$html"
|
||||
;;
|
||||
"t2t")
|
||||
render_t2t_html "$file" "$html"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
else
|
||||
# Render all files found in cwd and deeper if source is newer
|
||||
find . -name '*.t2t' | while read file ; do
|
||||
html="${file%.t2t}.html"
|
||||
if [ "$file" -nt "$html" ] ; then
|
||||
render_t2t_html "$file" "$html"
|
||||
fi
|
||||
done
|
||||
find . -name '*.md' | while read file ; do
|
||||
if [[ "$file" == *"README.md" ]] ; then continue ; fi
|
||||
html="${file%.md}.html"
|
||||
if [ "$file" -nt "$html" ] ; then
|
||||
render_md_html "$file" "$html"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -17,10 +17,7 @@ h1 img.nofloat { float: none; }
|
||||
img.right { float: right; }
|
||||
|
||||
ol.languages {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: wrap;
|
||||
height: 12em;
|
||||
column-width: 12em;
|
||||
}
|
||||
|
||||
.grow {
|
||||
|
||||
6
debian/changelog
vendored
@@ -1,3 +1,9 @@
|
||||
gf (3.10-1) xenial bionic cosmic; urgency=low
|
||||
|
||||
* GF 3.10
|
||||
|
||||
-- Thomas Hallgren <hallgren@chalmers.se> Fri, 30 Nov 2018 20:00:00 +0100
|
||||
|
||||
gf (3.9-1) vivid xenial zesty; urgency=low
|
||||
|
||||
* GF 3.9
|
||||
|
||||
2
debian/rules
vendored
Normal file → Executable file
@@ -18,6 +18,8 @@ override_dh_auto_build:
|
||||
cd src/runtime/java && make CFLAGS="-I$(CURDIR)/src/runtime/c -L$(CURDIR)/src/runtime/c/.libs" INSTALL_PATH=/usr/lib
|
||||
echo LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs
|
||||
LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs cabal build
|
||||
LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs cabal copy --destdir=$(CURDIR)/debian/gf # create www directory
|
||||
PATH=$(CURDIR)/dist/build/gf:$$PATH && export GF_LIB_PATH="$$(dirname $$(find "$(CURDIR)/debian/gf" -name www))/lib" && echo "GF_LIB_PATH=$$GF_LIB_PATH" && mkdir -p "$$GF_LIB_PATH" && ( cd ../gf-rgl && make build && make copy ) && LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(CURDIR)/src/runtime/c/.libs cabal build
|
||||
make html
|
||||
|
||||
override_dh_auto_clean:
|
||||
|
||||
15
doc/Makefile
@@ -1,18 +1,3 @@
|
||||
resource:
|
||||
gfdoc -txt2 ../lib/resource-1.0/abstract/*.gf
|
||||
gfdoc -txt2 ../lib/resource-1.0/*/Paradigms*.gf
|
||||
txt2tags --toc resource.txt
|
||||
# cat resource-preamble resource.tex >final-resource.tex
|
||||
sed -i 's/\\docum/%\\docum/g' resource.tex
|
||||
sed -i 's/ion\*{/ion{/g' resource.tex
|
||||
sed -i 's/\\paragraph{}//g' resource.tex
|
||||
sed -i 's/}\\\\/}/g' resource.tex
|
||||
cat resource-preamble resource.tex >resource.tmp
|
||||
mv resource.tmp resource.tex
|
||||
latex resource.tex
|
||||
latex resource.tex
|
||||
dvipdf resource.dvi
|
||||
|
||||
gf-help-full.txt::
|
||||
{ echo ; echo ; echo ; } > $@
|
||||
echo help -full -t2t | gf -run >> $@
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
GF Developers Guide
|
||||
Authors: Björn Bringert, Krasimir Angelov and Thomas Hallgren
|
||||
Last update: %%mtime(%F, %H:%M)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags -t html gf-developers.t2t
|
||||
2018-07-26
|
||||
|
||||
%!style:../css/style.css
|
||||
%!target:html
|
||||
%!options(html): --toc
|
||||
%!encoding:utf-8
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
== Before you start ==
|
||||
|
||||
@@ -63,18 +55,6 @@ Other required tools included in the Haskell Platform are
|
||||
and
|
||||
[Happy http://www.haskell.org/happy/].
|
||||
|
||||
%=== Darcs ===
|
||||
%
|
||||
%To get the GF source code, you also need //Darcs//, version 2 or later.
|
||||
%Darcs 2.10 is recommended (July 2015).
|
||||
%
|
||||
%//Darcs//
|
||||
%is a distributed version control system, see http://darcs.net/ for
|
||||
%more information. There are precompiled packages for many platforms
|
||||
%available and source code if you want to compile it yourself. Darcs
|
||||
%is also written in Haskell and so you can use GHC to compile it.
|
||||
|
||||
|
||||
=== Git ===
|
||||
|
||||
To get the GF source code, you also need //Git//.
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Editor modes & IDE integration for GF
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!options(html): --toc
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!encoding:utf-8
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
We collect GF modes for various editors on this page. Contributions are
|
||||
welcome!
|
||||
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
Grammatical Framework: Frequently Asked Quuestions
|
||||
Aarne Ranta
|
||||
%%date(%c)
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags gf-bibliography.t2t
|
||||
|
||||
%!style:../css/style.css
|
||||
%!target:html
|
||||
%!options(html): --toc
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): #BR <br>
|
||||
%!encoding:utf-8
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
|
||||
===What has been done with GF?===
|
||||
|
||||
**Translation**: systems with any number of parallel languages, with input in one language and output in all the others.
|
||||
|
||||
**Natural language generation** (NLG): translation from a formal language to natural languages.
|
||||
|
||||
**Ontology verbalization** is a special case of NLG.
|
||||
|
||||
**Language training**: grammar and vocabulary training systems.
|
||||
|
||||
**Human-computer interaction**: natural language interfaces, spoken dialogue systems.
|
||||
|
||||
**Linguistics**: comparisons between languages.
|
||||
|
||||
|
||||
|
||||
===What parts does GF have?===
|
||||
|
||||
A **grammar compiler**, used for compiling grammars to parsing, generation, and translation code.
|
||||
|
||||
A **run-time system**, used for parsing, generation and translation. The run-time system is available in several languages:
|
||||
Haskell, Java, C, C++, Javascript, and Python. The point with this is that you can include GF-based parsing and generation in
|
||||
larger programs written in any of these languages.
|
||||
|
||||
A **resource grammar library**, containing the morphology and basic syntax of currently 26 languages.
|
||||
|
||||
A **web application toolkit**, containing server-side (Haskell) and client-side (Javascript) libraries.
|
||||
|
||||
An **integrated development environment**, the GF-Eclipse plug-in.
|
||||
|
||||
A **shell**, i.e. a command interpreter for testing and developing GF grammars. This is the program started by the command ``gf`` in a terminal.
|
||||
|
||||
|
||||
|
||||
===Is GF open-source?===
|
||||
|
||||
|
||||
===Can I use GF for commercial applications?===
|
||||
|
||||
Yes. Those parts of GF that you will need to distribute - the run-time system and the libraries - are licensed under LGPL and BSD; it's up to you to choose which.
|
||||
|
||||
|
||||
|
||||
===When was GF started?===
|
||||
|
||||
|
||||
===Where does the name GF come from?===
|
||||
|
||||
GF = Grammatical Framework = LF + concrete syntax
|
||||
|
||||
LF = Logical Framework
|
||||
|
||||
Logical Frameworks are implementations of type theory, which have been built since the 1980's to support formalized mathematics. GF has its roots in
|
||||
type theory, which is widely used in the semantics of natural language. Some of these ideas were first implemented in ALF, Another Logical Framework,
|
||||
in 1992; the book //Type-Theoretical Grammar// (by A. Ranta, OUP 1994) has a chapter and an appendix on this. The first implementations did not have
|
||||
a parser, and GF proper, started in 1998, was an implementation of yet another LF together with concrete syntax supporting generation and parsing.
|
||||
Grammatical Framework was a natural name for this. We tried to avoid it in the beginning, because it sounded pretentious in its generality. But the
|
||||
name was just too natural to be avoided.
|
||||
|
||||
|
||||
|
||||
===Is GF backward compatible?===
|
||||
|
||||
|
||||
|
||||
===Do I need Haskell to use GF?===
|
||||
|
||||
No. GF is a language of its own, and you don't need to know Haskell. And if you download the GF binary, you don't need any Haskell tools. But if you want to
|
||||
become a GF developer, then it's better you install GF from the latest source, and then you need the GHC Haskell compiler to compile GF. But even then, you
|
||||
don't need to know Haskell yourself.
|
||||
|
||||
|
||||
===What is a lock field?===
|
||||
|
||||
@@ -68,9 +68,9 @@ metavariables and the type of the expression.
|
||||
Prints a set of strings in the .dot format (the graphviz format).
|
||||
The graph can be saved in a file by the wf command as usual.
|
||||
If the -view flag is defined, the graph is saved in a temporary file
|
||||
which is processed by graphviz and displayed by the program indicated
|
||||
by the flag. The target format is postscript, unless overridden by the
|
||||
flag -format.
|
||||
which is processed by 'dot' (graphviz) and displayed by the program indicated
|
||||
by the view flag. The target format is png, unless overridden by the
|
||||
flag -format. Results from multiple trees are combined to pdf with convert (ImageMagick).
|
||||
|
||||
|
||||
- Options:
|
||||
@@ -151,6 +151,7 @@ of a pipe.
|
||||
| ``-one`` | pick the first strings, if there is any, from records and tables
|
||||
| ``-table`` | show all strings labelled by parameters
|
||||
| ``-unqual`` | hide qualifying module names
|
||||
| ``-trace`` | trace computations
|
||||
|
||||
|
||||
#NORMAL
|
||||
@@ -242,7 +243,7 @@ and thus cannot be a part of a pipe.
|
||||
|
||||
====e = empty====
|
||||
#NOINDENT
|
||||
``e`` = ``empty``: //empty the environment.//
|
||||
``e`` = ``empty``: //empty the environment (except the command history).//
|
||||
|
||||
#TINY
|
||||
|
||||
@@ -281,6 +282,19 @@ but the resulting .gf file must be imported separately.
|
||||
#NORMAL
|
||||
|
||||
|
||||
#VSPACE
|
||||
|
||||
====eh = execute_history====
|
||||
#NOINDENT
|
||||
``eh`` = ``execute_history``: //read commands from a file and execute them.//
|
||||
|
||||
#TINY
|
||||
|
||||
- Syntax: ``eh FILE``
|
||||
|
||||
#NORMAL
|
||||
|
||||
|
||||
#VSPACE
|
||||
|
||||
====gr = generate_random====
|
||||
@@ -434,12 +448,14 @@ sequences; see example.
|
||||
| ``-list`` | show all forms and variants, comma-separated on one line (cf. l -all)
|
||||
| ``-multi`` | linearize to all languages (default)
|
||||
| ``-table`` | show all forms labelled by parameters
|
||||
| ``-tabtreebank`` | show the tree and its linearizations on a tab-separated line
|
||||
| ``-treebank`` | show the tree and tag linearizations with language names
|
||||
| ``-bind`` | bind tokens separated by Prelude.BIND, i.e. &+
|
||||
| ``-chars`` | lexer that makes every non-space character a token
|
||||
| ``-from_amharic`` | from unicode to GF Amharic transliteration
|
||||
| ``-from_ancientgreek`` | from unicode to GF ancient Greek transliteration
|
||||
| ``-from_arabic`` | from unicode to GF Arabic transliteration
|
||||
| ``-from_arabic_unvocalized`` | from unicode to GF unvocalized Arabic transliteration
|
||||
| ``-from_cp1251`` | decode from cp1251 (Cyrillic used in Bulgarian resource)
|
||||
| ``-from_devanagari`` | from unicode to GF Devanagari transliteration
|
||||
| ``-from_greek`` | from unicode to GF modern Greek transliteration
|
||||
@@ -453,11 +469,14 @@ sequences; see example.
|
||||
| ``-from_urdu`` | from unicode to GF Urdu transliteration
|
||||
| ``-from_utf8`` | decode from utf8 (default)
|
||||
| ``-lexcode`` | code-like lexer
|
||||
| ``-lexgreek`` | lexer normalizing ancient Greek accentuation
|
||||
| ``-lexgreek2`` | lexer normalizing ancient Greek accentuation for text with vowel length annotations
|
||||
| ``-lexmixed`` | mixture of text and code, as in LaTeX (code between $...$, \(...)\, \[...\])
|
||||
| ``-lextext`` | text-like lexer
|
||||
| ``-to_amharic`` | from GF Amharic transliteration to unicode
|
||||
| ``-to_ancientgreek`` | from GF ancient Greek transliteration to unicode
|
||||
| ``-to_arabic`` | from GF Arabic transliteration to unicode
|
||||
| ``-to_arabic_unvocalized`` | from GF unvocalized Arabic transliteration to unicode
|
||||
| ``-to_cp1251`` | encode to cp1251 (Cyrillic used in Bulgarian resource)
|
||||
| ``-to_devanagari`` | from GF Devanagari transliteration to unicode
|
||||
| ``-to_greek`` | from GF modern Greek transliteration to unicode
|
||||
@@ -473,6 +492,7 @@ sequences; see example.
|
||||
| ``-to_utf8`` | encode to utf8 (default)
|
||||
| ``-unchars`` | unlexer that puts no spaces between tokens
|
||||
| ``-unlexcode`` | code-like unlexer
|
||||
| ``-unlexgreek`` | unlexer de-normalizing ancient Greek accentuation
|
||||
| ``-unlexmixed`` | mixture of text and code (code between $...$, \(...)\, \[...\])
|
||||
| ``-unlextext`` | text-like unlexer
|
||||
| ``-unwords`` | unlexer that puts a single space between tokens (default)
|
||||
@@ -513,6 +533,7 @@ trees where a function node is a metavariable.
|
||||
| ``-from_amharic`` | from unicode to GF Amharic transliteration
|
||||
| ``-from_ancientgreek`` | from unicode to GF ancient Greek transliteration
|
||||
| ``-from_arabic`` | from unicode to GF Arabic transliteration
|
||||
| ``-from_arabic_unvocalized`` | from unicode to GF unvocalized Arabic transliteration
|
||||
| ``-from_cp1251`` | decode from cp1251 (Cyrillic used in Bulgarian resource)
|
||||
| ``-from_devanagari`` | from unicode to GF Devanagari transliteration
|
||||
| ``-from_greek`` | from unicode to GF modern Greek transliteration
|
||||
@@ -526,11 +547,14 @@ trees where a function node is a metavariable.
|
||||
| ``-from_urdu`` | from unicode to GF Urdu transliteration
|
||||
| ``-from_utf8`` | decode from utf8 (default)
|
||||
| ``-lexcode`` | code-like lexer
|
||||
| ``-lexgreek`` | lexer normalizing ancient Greek accentuation
|
||||
| ``-lexgreek2`` | lexer normalizing ancient Greek accentuation for text with vowel length annotations
|
||||
| ``-lexmixed`` | mixture of text and code, as in LaTeX (code between $...$, \(...)\, \[...\])
|
||||
| ``-lextext`` | text-like lexer
|
||||
| ``-to_amharic`` | from GF Amharic transliteration to unicode
|
||||
| ``-to_ancientgreek`` | from GF ancient Greek transliteration to unicode
|
||||
| ``-to_arabic`` | from GF Arabic transliteration to unicode
|
||||
| ``-to_arabic_unvocalized`` | from GF unvocalized Arabic transliteration to unicode
|
||||
| ``-to_cp1251`` | encode to cp1251 (Cyrillic used in Bulgarian resource)
|
||||
| ``-to_devanagari`` | from GF Devanagari transliteration to unicode
|
||||
| ``-to_greek`` | from GF modern Greek transliteration to unicode
|
||||
@@ -546,6 +570,7 @@ trees where a function node is a metavariable.
|
||||
| ``-to_utf8`` | encode to utf8 (default)
|
||||
| ``-unchars`` | unlexer that puts no spaces between tokens
|
||||
| ``-unlexcode`` | code-like unlexer
|
||||
| ``-unlexgreek`` | unlexer de-normalizing ancient Greek accentuation
|
||||
| ``-unlexmixed`` | mixture of text and code (code between $...$, \(...)\, \[...\])
|
||||
| ``-unlextext`` | text-like unlexer
|
||||
| ``-unwords`` | unlexer that puts a single space between tokens (default)
|
||||
@@ -666,10 +691,9 @@ command (flag -printer):
|
||||
fa finite automaton in graphviz format
|
||||
gsl Nuance speech recognition format
|
||||
haskell Haskell (abstract syntax)
|
||||
java Java (abstract syntax)
|
||||
js JavaScript (whole grammar)
|
||||
jsgf JSGF speech recognition format
|
||||
lambda_prolog LambdaProlog (abstract syntax)
|
||||
lp_byte_code Bytecode for Teyjus (abstract syntax, experimental)
|
||||
pgf_pretty human-readable pgf
|
||||
prolog Prolog (whole grammar)
|
||||
python Python (whole grammar)
|
||||
@@ -753,6 +777,7 @@ To see transliteration tables, use command ut.
|
||||
| ``-from_amharic`` | from unicode to GF Amharic transliteration
|
||||
| ``-from_ancientgreek`` | from unicode to GF ancient Greek transliteration
|
||||
| ``-from_arabic`` | from unicode to GF Arabic transliteration
|
||||
| ``-from_arabic_unvocalized`` | from unicode to GF unvocalized Arabic transliteration
|
||||
| ``-from_cp1251`` | decode from cp1251 (Cyrillic used in Bulgarian resource)
|
||||
| ``-from_devanagari`` | from unicode to GF Devanagari transliteration
|
||||
| ``-from_greek`` | from unicode to GF modern Greek transliteration
|
||||
@@ -766,11 +791,14 @@ To see transliteration tables, use command ut.
|
||||
| ``-from_urdu`` | from unicode to GF Urdu transliteration
|
||||
| ``-from_utf8`` | decode from utf8 (default)
|
||||
| ``-lexcode`` | code-like lexer
|
||||
| ``-lexgreek`` | lexer normalizing ancient Greek accentuation
|
||||
| ``-lexgreek2`` | lexer normalizing ancient Greek accentuation for text with vowel length annotations
|
||||
| ``-lexmixed`` | mixture of text and code, as in LaTeX (code between $...$, \(...)\, \[...\])
|
||||
| ``-lextext`` | text-like lexer
|
||||
| ``-to_amharic`` | from GF Amharic transliteration to unicode
|
||||
| ``-to_ancientgreek`` | from GF ancient Greek transliteration to unicode
|
||||
| ``-to_arabic`` | from GF Arabic transliteration to unicode
|
||||
| ``-to_arabic_unvocalized`` | from GF unvocalized Arabic transliteration to unicode
|
||||
| ``-to_cp1251`` | encode to cp1251 (Cyrillic used in Bulgarian resource)
|
||||
| ``-to_devanagari`` | from GF Devanagari transliteration to unicode
|
||||
| ``-to_greek`` | from GF modern Greek transliteration to unicode
|
||||
@@ -786,6 +814,7 @@ To see transliteration tables, use command ut.
|
||||
| ``-to_utf8`` | encode to utf8 (default)
|
||||
| ``-unchars`` | unlexer that puts no spaces between tokens
|
||||
| ``-unlexcode`` | code-like unlexer
|
||||
| ``-unlexgreek`` | unlexer de-normalizing ancient Greek accentuation
|
||||
| ``-unlexmixed`` | mixture of text and code (code between $...$, \(...)\, \[...\])
|
||||
| ``-unlextext`` | text-like unlexer
|
||||
| ``-unwords`` | unlexer that puts a single space between tokens (default)
|
||||
@@ -799,13 +828,14 @@ To see transliteration tables, use command ut.
|
||||
|
||||
- Examples:
|
||||
|
||||
| ``l (EAdd 3 4) | ps -code`` | linearize code-like output
|
||||
| ``ps -lexer=code | p -cat=Exp`` | parse code-like input
|
||||
| ``l (EAdd 3 4) | ps -unlexcode`` | linearize code-like output
|
||||
| ``ps -lexcode | p -cat=Exp`` | parse code-like input
|
||||
| ``gr -cat=QCl | l | ps -bind`` | linearization output from LangFin
|
||||
| ``ps -to_devanagari "A-p"`` | show Devanagari in UTF8 terminal
|
||||
| ``rf -file=Hin.gf | ps -env=quotes -to_devanagari`` | convert translit to UTF8
|
||||
| ``rf -file=Ara.gf | ps -from_utf8 -env=quotes -from_arabic`` | convert UTF8 to transliteration
|
||||
| ``ps -to=chinese.trans "abc"`` | apply transliteration defined in file chinese.trans
|
||||
| ``ps -lexgreek "a)gavoi` a)'nvrwpoi' tines*"`` | normalize ancient greek accentuation
|
||||
|
||||
|
||||
#NORMAL
|
||||
@@ -828,7 +858,6 @@ are type checking and semantic computation.
|
||||
- Options:
|
||||
|
||||
| ``-compute`` | compute by using semantic definitions (def)
|
||||
| ``-paraphrase`` | paraphrase by using semantic definitions (def)
|
||||
| ``-largest`` | sort trees from largest to smallest, in number of nodes
|
||||
| ``-nub`` | remove duplicate trees
|
||||
| ``-smallest`` | sort trees from smallest to largest, in number of nodes
|
||||
@@ -838,12 +867,10 @@ are type checking and semantic computation.
|
||||
- Flags:
|
||||
|
||||
| ``-number`` | take at most this many trees
|
||||
| ``-transfer`` | syntactic transfer by applying function, recursively in subtrees
|
||||
|
||||
- Examples:
|
||||
|
||||
| ``pt -compute (plus one two)`` | compute value
|
||||
| ``p "4 dogs love 5 cats" | pt -transfer=digits2numeral | l`` | four...five...
|
||||
|
||||
|
||||
#NORMAL
|
||||
@@ -990,8 +1017,6 @@ This command requires a source grammar to be in scope, imported with 'import -re
|
||||
The operations include the parameter constructors that are in scope.
|
||||
The optional TYPE filters according to the value type.
|
||||
The grep STRINGs filter according to other substrings of the type signatures.
|
||||
This command must be a line of its own, and thus cannot be a part
|
||||
of a pipe.
|
||||
|
||||
- Syntax: ``so (-grep=STRING)* TYPE?``
|
||||
- Options:
|
||||
@@ -1002,6 +1027,12 @@ of a pipe.
|
||||
|
||||
| ``-grep`` | substring used for filtering (the command can have many of these)
|
||||
|
||||
- Examples:
|
||||
|
||||
| ``so Det`` | show all opers that create a Det
|
||||
| ``so -grep=Prep`` | find opers relating to Prep
|
||||
| ``so | wf -file=/tmp/opers`` | write the list of opers to a file
|
||||
|
||||
|
||||
#NORMAL
|
||||
|
||||
@@ -1113,6 +1144,7 @@ This command must be a line of its own, and thus cannot be a part of a pipe.
|
||||
| ``-amharic`` | Amharic
|
||||
| ``-ancientgreek`` | ancient Greek
|
||||
| ``-arabic`` | Arabic
|
||||
| ``-arabic_unvocalized`` | unvocalized Arabic
|
||||
| ``-devanagari`` | Devanagari
|
||||
| ``-greek`` | modern Greek
|
||||
| ``-hebrew`` | unvocalized Hebrew
|
||||
@@ -1137,35 +1169,41 @@ This command must be a line of its own, and thus cannot be a part of a pipe.
|
||||
#TINY
|
||||
|
||||
Prints a dependency tree in the .dot format (the graphviz format, default)
|
||||
or LaTeX (flag -output=latex)
|
||||
or the CoNLL/MaltParser format (flag -output=conll for training, malt_input
|
||||
for unanalysed input).
|
||||
By default, the last argument is the head of every abstract syntax
|
||||
function; moreover, the head depends on the head of the function above.
|
||||
The graph can be saved in a file by the wf command as usual.
|
||||
If the -view flag is defined, the graph is saved in a temporary file
|
||||
which is processed by graphviz and displayed by the program indicated
|
||||
by the flag. The target format is png, unless overridden by the
|
||||
flag -format.
|
||||
which is processed by dot (graphviz) and displayed by the program indicated
|
||||
by the view flag. The target format is png, unless overridden by the
|
||||
flag -format. Results from multiple trees are combined to pdf with convert (ImageMagick).
|
||||
See also 'vp -showdep' for another visualization of dependencies.
|
||||
|
||||
|
||||
- Options:
|
||||
|
||||
| ``-v`` | show extra information
|
||||
| ``-conll2latex`` | convert conll to latex
|
||||
|
||||
- Flags:
|
||||
|
||||
| ``-file`` | configuration file for labels per fun, format 'fun l1 ... label ... l2'
|
||||
| ``-format`` | format of the visualization file (default "png")
|
||||
| ``-output`` | output format of graph source (default "dot")
|
||||
| ``-view`` | program to open the resulting file (default "open")
|
||||
| ``-abslabels`` | abstract configuration file for labels, format per line 'fun label*'
|
||||
| ``-cnclabels`` | concrete configuration file for labels, format per line 'fun {words|*} pos label head'
|
||||
| ``-file`` | same as abslabels (abstract configuration file)
|
||||
| ``-format`` | format of the visualization file using dot (default "png")
|
||||
| ``-output`` | output format of graph source (latex, conll, dot (default but deprecated))
|
||||
| ``-view`` | program to open the resulting graph file (default "open")
|
||||
| ``-lang`` | the language of analysis
|
||||
|
||||
- Examples:
|
||||
|
||||
| ``gr | vd`` | generate a tree and show dependency tree in .dot
|
||||
| ``gr | vd -view=open`` | generate a tree and display dependency tree on a Mac
|
||||
| ``gr -number=1000 | vd -file=dep.labels -output=malt`` | generate training treebank
|
||||
| ``gr -number=100 | vd -file=dep.labels -output=malt_input`` | generate test sentences
|
||||
| ``gr | vd -view=open`` | generate a tree and display dependency tree on with Mac's 'open'
|
||||
| ``gr | vd -view=open -output=latex`` | generate a tree and display latex dependency tree with Mac's 'open'
|
||||
| ``gr -number=1000 | vd -abslabels=Lang.labels -cnclabels=LangSwe.labels -output=conll`` | generate a random treebank
|
||||
| ``rf -file=ex.conll | vd -conll2latex | wf -file=ex.tex`` | convert conll file to latex
|
||||
|
||||
|
||||
#NORMAL
|
||||
@@ -1182,15 +1220,16 @@ flag -format.
|
||||
Prints a parse tree in the .dot format (the graphviz format).
|
||||
The graph can be saved in a file by the wf command as usual.
|
||||
If the -view flag is defined, the graph is saved in a temporary file
|
||||
which is processed by graphviz and displayed by the program indicated
|
||||
by the flag. The target format is png, unless overridden by the
|
||||
flag -format.
|
||||
which is processed by dot (graphviz) and displayed by the program indicated
|
||||
by the view flag. The target format is png, unless overridden by the
|
||||
flag -format. Results from multiple trees are combined to pdf with convert (ImageMagick).
|
||||
|
||||
|
||||
- Options:
|
||||
|
||||
| ``-showcat`` | show categories in the tree nodes (default)
|
||||
| ``-nocat`` | don't show categories
|
||||
| ``-showdep`` | show dependency labels
|
||||
| ``-showfun`` | show function names in the tree nodes
|
||||
| ``-nofun`` | don't show function names (default)
|
||||
| ``-showleaves`` | show the leaves of the tree (default)
|
||||
@@ -1198,6 +1237,8 @@ flag -format.
|
||||
|
||||
- Flags:
|
||||
|
||||
| ``-lang`` | the language to visualize
|
||||
| ``-file`` | configuration file for dependency labels with -deps, format per line 'fun label*'
|
||||
| ``-format`` | format of the visualization file (default "png")
|
||||
| ``-view`` | program to open the resulting file (default "open")
|
||||
| ``-nodefont`` | font for tree nodes (default: Times -- graphviz standard font)
|
||||
@@ -1210,7 +1251,8 @@ flag -format.
|
||||
- Examples:
|
||||
|
||||
| ``p "John walks" | vp`` | generate a tree and show parse tree as .dot script
|
||||
| ``gr | vp -view="open"`` | generate a tree and display parse tree on a Mac
|
||||
| ``gr | vp -view=open`` | generate a tree and display parse tree on a Mac
|
||||
| ``p "she loves us" | vp -view=open -showdep -file=uddeps.labels -nocat`` | show a visual variant of a dependency tree
|
||||
|
||||
|
||||
#NORMAL
|
||||
@@ -1227,9 +1269,9 @@ flag -format.
|
||||
Prints a set of trees in the .dot format (the graphviz format).
|
||||
The graph can be saved in a file by the wf command as usual.
|
||||
If the -view flag is defined, the graph is saved in a temporary file
|
||||
which is processed by graphviz and displayed by the program indicated
|
||||
by the flag. The target format is postscript, unless overridden by the
|
||||
flag -format.
|
||||
which is processed by dot (graphviz) and displayed by the command indicated
|
||||
by the view flag. The target format is postscript, unless overridden by the
|
||||
flag -format. Results from multiple trees are combined to pdf with convert (ImageMagick).
|
||||
With option -mk, use for showing library style function names of form 'mkC'.
|
||||
|
||||
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>GF People</title>
|
||||
<meta charset="UTF-8">
|
||||
<link rel=stylesheet href="../css/style.css">
|
||||
<meta name = "viewport" content = "width = device-width">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<IMG SRC="Logos/gf0.png" alt="[GF]">
|
||||
|
||||
<h1>Grammatical Framework: Authors and Acknowledgements</h1>
|
||||
|
||||
</center>
|
||||
|
||||
The current developers and maintainers are
|
||||
<a href="http://www.chalmers.se/cse/EN/organization/divisions/computing-science/people/angelov-krasimir">Krasimir Angelov</a>,
|
||||
<a href="http://www.cse.chalmers.se/~hallgren/">Thomas Hallgren</a>,
|
||||
and
|
||||
<a href="http://www.cse.chalmers.se/~aarne/">Aarne Ranta</a>. Bug reports should be
|
||||
posted via the
|
||||
<a href="http://code.google.com/p/grammatical-framework/issues/list">GF bug tracker</a>.
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
Also the following people have contributed code to some of the versions:
|
||||
|
||||
<dl>
|
||||
|
||||
<dt>Grégoire Détrez (University of Gothenburg)
|
||||
<dt>Ramona Enache (University of Gothenburg)
|
||||
<dt>
|
||||
<a href="http://www.cse.chalmers.se/alumni/bringert">Björn Bringert</a> (University of Gothenburg)
|
||||
<dt>
|
||||
Håkan Burden (University of Gothenburg)
|
||||
<dt>
|
||||
Hans-Joachim Daniels (Karlsruhe)
|
||||
<dt>
|
||||
<a href="http://www.cs.chalmers.se/~markus">Markus Forsberg</a> (Chalmers)
|
||||
<dt>
|
||||
<a href="http://www.cs.chalmers.se/~krijo">Kristofer Johannisson</a> (University of Gothenburg)
|
||||
<dt>
|
||||
<a href="http://www.cs.chalmers.se/~janna">Janna Khegai</a> (Chalmers)
|
||||
<dt>
|
||||
<a href="http://www.cse.chalmers.se/~peb">Peter Ljunglöf</a> (University of Gothenburg)
|
||||
<dt>
|
||||
Petri Mäenpää (Nokia)
|
||||
</dl>
|
||||
|
||||
|
||||
At least the following colleagues are thanked for suggestions,
|
||||
bug reports, and other indirect contributions to the code. (Notice:
|
||||
these are early contributors - the list has not been updated since 2004 or so).
|
||||
|
||||
<p>
|
||||
|
||||
<a href="http://www.di.unito.it/~stefano/">Stefano Berardi</a> (Torino),
|
||||
|
||||
Pascal Boldini (Paris),
|
||||
|
||||
<a href="http://www.dur.ac.uk/~dcs0pcc/">Paul Callaghan</a> (Durham),
|
||||
|
||||
Lauri Carlson (Helsinki),
|
||||
|
||||
<a href="http://www.cse.chalmers.se/~koen">Koen Claessen</a> (Chalmers),
|
||||
|
||||
<a href="http://www.cling.gu.se/~cooper">Robin Cooper</a> (Gothenburg),
|
||||
|
||||
<a href="http://www.cse.chalmers.se/~coquand">Thierry Coquand</a> (Chalmers),
|
||||
|
||||
<a
|
||||
href="http://www.xrce.xerox.com/people/dymetman/dymetman.html">Marc
|
||||
Dymetman</a> (XRCE),
|
||||
|
||||
Bertrand Grégoire (Tudor Institure, Luxembourg),
|
||||
|
||||
<a href="http://www.cse.chalmers.se/~reiner">Reiner Hähnle</a> (Chalmers),
|
||||
|
||||
<a href="http://pauillac.inria.fr/~huet/">Gérard Huet</a> (INRIA),
|
||||
|
||||
<a href="http://www.cse.chalmers.se/~patrikj">Patrik Jansson</a> (Chalmers),
|
||||
|
||||
Bernard Jaulin (Paris),
|
||||
|
||||
<a href="http://www.xrce.xerox.com/people/karttunen/karttunen.html">
|
||||
Lauri Karttunen</a> (PARC),
|
||||
|
||||
Matti Kinnunen (Nokia),
|
||||
|
||||
<a
|
||||
href="http://www.xrce.xerox.com/people/lux/">Veronika
|
||||
Lux</a> (XRCE),
|
||||
|
||||
Per Martin-Löf (Stockholm),
|
||||
|
||||
<a href="http://www.cse.chalmers.se/~bengt">Bengt Nordström</a> (Chalmers),
|
||||
|
||||
<a
|
||||
href="http://www.cis.uni-muenchen.de/studenten/stud_homepages/okrslar/reklame.html">
|
||||
Martin Okrslar</a> (CIS),
|
||||
|
||||
Jianmin Pang (Durham),
|
||||
|
||||
<a
|
||||
href="http://www.xrce.xerox.com/people/pogodalla/index.fr.html">Sylvain
|
||||
Pogodalla</a> (XRCE),
|
||||
|
||||
<a href="http://www.inria.fr/Loic.Pottier">Loïc Pottier</a> (INRIA),
|
||||
|
||||
|
||||
<a href="http://www2.parc.com/istl/members/zaenen/">Annie Zaenen</a> (PARC)
|
||||
|
||||
<p>
|
||||
|
||||
The GF logo was designed by Uula Ranta.
|
||||
|
||||
<p>
|
||||
|
||||
From 2001 to 2004, GF enjoyed funding from the
|
||||
<a href="http://www.vinnova.se">Vinnova</a> foundation, within the
|
||||
<a href="http://www.cse.chalmers.se/research/group/Language-technology/ILT.html">
|
||||
Interactive Languge Technology</a> project.
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
63
doc/gf-people.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
title: "Grammatical Framework: Authors and Acknowledgements"
|
||||
---
|
||||
|
||||
## Current maintainers
|
||||
|
||||
The current maintainers of GF are
|
||||
|
||||
[Krasimir Angelov](http://www.chalmers.se/cse/EN/organization/divisions/computing-science/people/angelov-krasimir),
|
||||
[Thomas Hallgren](http://www.cse.chalmers.se/~hallgren/),
|
||||
[Aarne Ranta](http://www.cse.chalmers.se/~aarne/),
|
||||
[John J. Camilleri](http://johnjcamilleri.com), and
|
||||
[Inari Listenmaa](https://inariksit.github.io/).
|
||||
|
||||
This page is otherwise not up to date.
|
||||
For detailed data about contributors to the code repositories since 2007, see
|
||||
[here (gf-core)](https://github.com/GrammaticalFramework/gf-core/graphs/contributors)
|
||||
and
|
||||
[here (gf-rgl)](https://github.com/GrammaticalFramework/gf-rgl/graphs/contributors).
|
||||
|
||||
## Previous contributors
|
||||
|
||||
The following people have contributed code to some of the versions:
|
||||
|
||||
- Grégoire Détrez (University of Gothenburg)
|
||||
- Ramona Enache (University of Gothenburg)
|
||||
- [Björn Bringert](http://www.cse.chalmers.se/alumni/bringert) (University of Gothenburg)
|
||||
- Håkan Burden (University of Gothenburg)
|
||||
- Hans-Joachim Daniels (Karlsruhe)
|
||||
- [Markus Forsberg](http://www.cs.chalmers.se/~markus) (Chalmers)
|
||||
- [Kristofer Johannisson](http://www.cs.chalmers.se/~krijo) (University of Gothenburg)
|
||||
- [Janna Khegai](http://www.cs.chalmers.se/~janna) (Chalmers)
|
||||
- [Peter Ljunglöf](http://www.cse.chalmers.se/~peb) (University of Gothenburg)
|
||||
- Petri Mäenpää (Nokia)
|
||||
|
||||
At least the following colleagues are thanked for suggestions, bug
|
||||
reports, and other indirect contributions to the code.
|
||||
|
||||
- [Stefano Berardi](http://www.di.unito.it/~stefano/) (Torino)
|
||||
- Pascal Boldini (Paris)
|
||||
- [Paul Callaghan](http://www.dur.ac.uk/~dcs0pcc/) (Durham)
|
||||
- Lauri Carlson (Helsinki)
|
||||
- [Koen Claessen](http://www.cse.chalmers.se/~koen) (Chalmers)
|
||||
- [Robin Cooper](http://www.cling.gu.se/~cooper) (Gothenburg)
|
||||
- [Thierry Coquand](http://www.cse.chalmers.se/~coquand) (Chalmers)
|
||||
- [Marc Dymetman](http://www.xrce.xerox.com/people/dymetman/dymetman.html) (XRCE)
|
||||
- Bertrand Grégoire (Tudor Institute, Luxembourg)
|
||||
- [Reiner Hähnle](http://www.cse.chalmers.se/~reiner) (Chalmers)
|
||||
- [Gérard Huet](http://pauillac.inria.fr/~huet/) (INRIA)
|
||||
- [Patrik Jansson](http://www.cse.chalmers.se/~patrikj) (Chalmers)
|
||||
- Bernard Jaulin (Paris)
|
||||
- [Lauri Karttunen](http://www.xrce.xerox.com/people/karttunen/karttunen.html) (PARC)
|
||||
- Matti Kinnunen (Nokia)
|
||||
- [Veronika Lux](http://www.xrce.xerox.com/people/lux/) (XRCE)
|
||||
- Per Martin-Löf (Stockholm)
|
||||
- [Bengt Nordström](http://www.cse.chalmers.se/~bengt) (Chalmers)
|
||||
- [Martin Okrslar](http://www.cis.uni-muenchen.de/studenten/stud_homepages/okrslar/reklame.html) (CIS)
|
||||
- Jianmin Pang (Durham)
|
||||
- [Sylvain Pogodalla](http://www.xrce.xerox.com/people/pogodalla/index.fr.html) (XRCE)
|
||||
- [Loïc Pottier](http://www.inria.fr/Loic.Pottier) (INRIA)
|
||||
- [Annie Zaenen](http://www2.parc.com/istl/members/zaenen/) (PARC)
|
||||
|
||||
The GF logo was designed by Uula Ranta.
|
||||
@@ -1,158 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>GF Quickstart</title>
|
||||
<link rel=stylesheet href="../css/style.css">
|
||||
<meta name = "viewport" content = "width = device-width">
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
|
||||
<center>
|
||||
<img src="Logos/gf0.png">
|
||||
<p>
|
||||
Aarne Ranta
|
||||
<p>
|
||||
October 2011 for GF 3.3
|
||||
|
||||
<p>
|
||||
|
||||
<h1>Grammatical Framework Quick Start</h1>
|
||||
|
||||
</center>
|
||||
|
||||
This Quick Start shows a few examples of how GF can be used.
|
||||
We assume that you have downloaded and installed GF, so that
|
||||
the command <tt>gf</tt> works for you. See download and install
|
||||
instructions <a href="../download/index.html">here</a>.
|
||||
|
||||
<h2>Want to try without downloading?</h2>
|
||||
|
||||
<a href="../demos/phrasebook/">Using GF translation</a> with an existing grammar.
|
||||
|
||||
<p>
|
||||
|
||||
<a href="../demos/gfse/">Writing GF grammars</a> in the cloud, without installing GF.
|
||||
|
||||
|
||||
|
||||
|
||||
<h2>Using GF for translation and generation</h2>
|
||||
|
||||
When you have downloaded and installed GF:
|
||||
<ol>
|
||||
<li> Copy the files
|
||||
<a href="../examples/tutorial/food/Food.gf"><tt>Food.gf</tt></a>,
|
||||
<a href="../examples/tutorial/food/FoodEng.gf"><tt>FoodEng.gf</tt></a>, and
|
||||
<a href="../examples/tutorial/food/FoodIta.gf"><tt>FoodIta.gf</tt></a>.
|
||||
Or go to <tt>GF/examples/tutorial/food/</tt>, if you have downloaded the
|
||||
GF sources.
|
||||
|
||||
<li> Start GF with the shell command (without the prompt <tt>$</tt>)
|
||||
<pre>
|
||||
$ gf FoodIta.gf FoodEng.gf
|
||||
</pre>
|
||||
Alternatively, start GF with <tt>gf</tt> and give the GF command <tt>import FoodIta.gf FoodEng.gf</tt>.
|
||||
|
||||
<li> <b>Translation</b>. Try your first translation by giving the GF command
|
||||
<pre>
|
||||
parse "this cheese is very very Italian" | linearize
|
||||
</pre>
|
||||
Notice that the parser accept the tabulator for word completion.
|
||||
|
||||
<li> <b>Generation</b>. Random-generate sentences in two languages:
|
||||
<pre>
|
||||
generate_random | linearize
|
||||
</pre>
|
||||
|
||||
<li> <b>Other commands</b>. Use the help command
|
||||
<pre>
|
||||
help
|
||||
</pre>
|
||||
<li> <b>More examples</b>. Go to <tt>GF/examples/phrasebook</tt> or some other
|
||||
subdirectory of <tt>GF/examples/</tt>. Or try a resource grammar by, for instance,
|
||||
<pre>
|
||||
import alltenses/LangEng.gfo alltenses/LangGer.gfo
|
||||
|
||||
parse -lang=Eng "I love you" | linearize -treebank
|
||||
</pre>
|
||||
The resource grammars are found relative to the value of <tt>GF_LIB_PATH</tt>, which
|
||||
you may have to set; see <a href="../download/index.html">here</a> for instructions.
|
||||
|
||||
|
||||
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
<h2>Grammar development</h2>
|
||||
|
||||
Add words to the <tt>Food</tt>
|
||||
grammars and try the above commands again. For instance, add the following lines:
|
||||
<pre>
|
||||
Bread : Kind ; -- in Food.gf
|
||||
Bread = {s = "bread"} ; -- in FoodEng.gf
|
||||
Bread = {s = "pane"} ; -- in FoodIta.gf
|
||||
</pre>
|
||||
and start GF again with the same command. Now you can even translate
|
||||
<i>this bread is very Italian</i>.
|
||||
</ol>
|
||||
To lear more on GF commands and
|
||||
grammar development, go to the one of the tutorials:
|
||||
<ul>
|
||||
<li> <a href="tutorial/gf-tutorial.html">GF Tutorial</a>: older, more programmer-oriented
|
||||
<li> <a href="gf-lrec-2010.pdf">GF Resource Tutorial</a>: newer, more linguist-oriented
|
||||
</ul>
|
||||
To learn about how GF is used for easily writing grammars for 16 languages, consult the
|
||||
<ul>
|
||||
<li> <a href="../lib/doc/synopsis.html">GF Resource Grammar Library</a>.
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Run-time grammars and web applications</h2>
|
||||
|
||||
GF has its own "machine language", PGF (Portable Grammar Format),
|
||||
which is recommended for use in applications at run time. To produce a PGF file from
|
||||
the two grammars above, do
|
||||
<pre>
|
||||
gf -make FoodIta.gf FoodEng.gf
|
||||
wrote Food.pgf
|
||||
</pre>
|
||||
You can use this in Haskell and Java programs, and also on web services, such as
|
||||
<ul>
|
||||
<li> the
|
||||
<a href="http://cloud.grammaticalframework.org/minibar/minibar.html">minibar</a>
|
||||
fridge magnets
|
||||
</ul>
|
||||
|
||||
The quickest way to provide a GF web service is to start GF with the <tt>-server</tt> option:
|
||||
<pre>
|
||||
$ gf -server
|
||||
This is GF version 3.3
|
||||
Built on linux/i386 with ghc-7.0, flags: interrupt server cclazy
|
||||
Document root = /usr/local/share/gf-3.3/www
|
||||
Starting HTTP server, open http://localhost:41296/ in your web browser.
|
||||
</pre>
|
||||
You can view it locally by pointing your
|
||||
browser to the URL shown. You can add your own <tt>.pgf</tt> grammar to the service by
|
||||
copying it over to the <tt>documentRoot</tt> directory. Just push "reload" in
|
||||
your browser after each such update.
|
||||
|
||||
<p>
|
||||
|
||||
To build more customized web application, consult the
|
||||
<a href="http://code.google.com/p/grammatical-framework/wiki/SideBar?tm=6">developer wiki</a>.
|
||||
|
||||
|
||||
<h2>User group</h2>
|
||||
|
||||
You are welcome to join the <A HREF="http://groups.google.com/group/gf-dev">User Group</A>
|
||||
to get help and discuss GF-related issues!
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body></html>
|
||||
@@ -1,493 +0,0 @@
|
||||
GF Quick Reference
|
||||
Aarne Ranta
|
||||
April 4, 2006
|
||||
|
||||
% NOTE: this is a txt2tags file.
|
||||
% Create an html file from this file using:
|
||||
% txt2tags -thtml gf-reference.t2t
|
||||
|
||||
%!style:../css/style.css
|
||||
%!target:html
|
||||
%!options: --toc
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
This is a quick reference on GF grammars. It aims to
|
||||
cover all forms of expression available when writing
|
||||
grammars. It assumes basic knowledge of GF, which
|
||||
can be acquired from the
|
||||
[GF Tutorial http://www.grammaticalframework.org/doc/tutorial/gf-tutorial.html].
|
||||
Help on GF commands is obtained on line by the
|
||||
help command (``help``), and help on invoking
|
||||
GF with (``gf -help``).
|
||||
|
||||
|
||||
===A complete example===
|
||||
|
||||
This is a complete example of a GF grammar divided
|
||||
into three modules in files. The grammar recognizes the
|
||||
phrases //one pizza// and //two pizzas//.
|
||||
|
||||
File ``Order.gf``:
|
||||
```
|
||||
abstract Order = {
|
||||
cat
|
||||
Order ;
|
||||
Item ;
|
||||
fun
|
||||
One, Two : Item -> Order ;
|
||||
Pizza : Item ;
|
||||
}
|
||||
```
|
||||
File ``OrderEng.gf`` (the top file):
|
||||
```
|
||||
--# -path=.:prelude
|
||||
concrete OrderEng of Order =
|
||||
open Res, Prelude in {
|
||||
flags startcat=Order ;
|
||||
lincat
|
||||
Order = SS ;
|
||||
Item = {s : Num => Str} ;
|
||||
lin
|
||||
One it = ss ("one" ++ it.s ! Sg) ;
|
||||
Two it = ss ("two" ++ it.s ! Pl) ;
|
||||
Pizza = regNoun "pizza" ;
|
||||
}
|
||||
```
|
||||
File ``Res.gf``:
|
||||
```
|
||||
resource Res = open Prelude in {
|
||||
param Num = Sg | Pl ;
|
||||
oper regNoun : Str -> {s : Num => Str} =
|
||||
\dog -> {s = table {
|
||||
Sg => dog ;
|
||||
_ => dog + "s"
|
||||
}
|
||||
} ;
|
||||
}
|
||||
```
|
||||
To use this example, do
|
||||
```
|
||||
% gf -- in shell: start GF
|
||||
> i OrderEng.gf -- in GF: import grammar
|
||||
> p "one pizza" -- parse string
|
||||
> l Two Pizza -- linearize tree
|
||||
```
|
||||
|
||||
|
||||
|
||||
===Modules and files===
|
||||
|
||||
One module per file.
|
||||
File named ``Foo.gf`` contains module named
|
||||
``Foo``.
|
||||
|
||||
Each module has the structure
|
||||
```
|
||||
moduletypename =
|
||||
Inherits ** -- optional
|
||||
open Opens in -- optional
|
||||
{ Judgements }
|
||||
```
|
||||
Inherits are names of modules of the same type.
|
||||
Inheritance can be restricted:
|
||||
```
|
||||
Mo[f,g], -- inherit only f,g from Mo
|
||||
Lo-[f,g] -- inheris all but f,g from Lo
|
||||
```
|
||||
Opens are possible in ``concrete`` and ``resource``.
|
||||
They are names of modules of these two types, possibly
|
||||
qualified:
|
||||
```
|
||||
(M = Mo), -- refer to f as M.f or Mo.f
|
||||
(Lo = Lo) -- refer to f as Lo.f
|
||||
```
|
||||
Module types and judgements in them:
|
||||
```
|
||||
abstract A -- cat, fun, def, data
|
||||
concrete C of A -- lincat, lin, lindef, printname
|
||||
resource R -- param, oper
|
||||
|
||||
interface I -- like resource, but can have
|
||||
oper f : T without definition
|
||||
instance J of I -- like resource, defines opers
|
||||
that I leaves undefined
|
||||
incomplete -- functor: concrete that opens
|
||||
concrete CI of A = one or more interfaces
|
||||
open I in ...
|
||||
concrete CJ of A = -- completion: concrete that
|
||||
CI with instantiates a functor by
|
||||
(I = J) instances of open interfaces
|
||||
```
|
||||
The forms
|
||||
``param``, ``oper``
|
||||
may appear in ``concrete`` as well, but are then
|
||||
not inherited to extensions.
|
||||
|
||||
All modules can moreover have ``flags`` and comments.
|
||||
Comments have the forms
|
||||
```
|
||||
-- till the end of line
|
||||
{- any number of lines between -}
|
||||
--# used for compiler pragmas
|
||||
```
|
||||
A ``concrete`` can be opened like a ``resource``.
|
||||
It is translated as follows:
|
||||
```
|
||||
cat C ---> oper C : Type =
|
||||
lincat C = T T ** {lock_C : {}}
|
||||
|
||||
fun f : G -> C ---> oper f : A* -> C* = \g ->
|
||||
lin f = t t g ** {lock_C = <>}
|
||||
```
|
||||
An ``abstract`` can be opened like an ``interface``.
|
||||
Any ``concrete`` of it then works as an ``instance``.
|
||||
|
||||
|
||||
|
||||
===Judgements===
|
||||
|
||||
```
|
||||
cat C -- declare category C
|
||||
cat C (x:A)(y:B x) -- dependent category C
|
||||
cat C A B -- same as C (x : A)(y : B)
|
||||
fun f : T -- declare function f of type T
|
||||
def f = t -- define f as t
|
||||
def f p q = t -- define f by pattern matching
|
||||
data C = f | g -- set f,g as constructors of C
|
||||
data f : A -> C -- same as
|
||||
fun f : A -> C; data C=f
|
||||
|
||||
lincat C = T -- define lin.type of cat C
|
||||
lin f = t -- define lin. of fun f
|
||||
lin f x y = t -- same as lin f = \x y -> t
|
||||
lindef C = \s -> t -- default lin. of cat C
|
||||
printname fun f = s -- printname shown in menus
|
||||
printname cat C = s -- printname shown in menus
|
||||
printname f = s -- same as printname fun f = s
|
||||
|
||||
param P = C | D Q R -- define parameter type P
|
||||
with constructors
|
||||
C : P, D : Q -> R -> P
|
||||
oper h : T = t -- define oper h of type T
|
||||
oper h = t -- omit type, if inferrable
|
||||
|
||||
flags p=v -- set value of flag p
|
||||
```
|
||||
Judgements are terminated by semicolons (``;``).
|
||||
Subsequent judgments of the same form may share the
|
||||
keyword:
|
||||
```
|
||||
cat C ; D ; -- same as cat C ; cat D ;
|
||||
```
|
||||
Judgements can also share RHS:
|
||||
```
|
||||
fun f,g : A -- same as fun f : A ; g : A
|
||||
```
|
||||
|
||||
|
||||
===Types===
|
||||
|
||||
Abstract syntax (in ``fun``):
|
||||
```
|
||||
C -- basic type, if cat C
|
||||
C a b -- basic type for dep. category
|
||||
(x : A) -> B -- dep. functions from A to B
|
||||
(_ : A) -> B -- nondep. functions from A to B
|
||||
(p,q : A) -> B -- same as (p : A)-> (q : A) -> B
|
||||
A -> B -- same as (_ : A) -> B
|
||||
Int -- predefined integer type
|
||||
Float -- predefined float type
|
||||
String -- predefined string type
|
||||
```
|
||||
Concrete syntax (in ``lincat``):
|
||||
```
|
||||
Str -- token lists
|
||||
P -- parameter type, if param P
|
||||
P => B -- table type, if P param. type
|
||||
{s : Str ; p : P}-- record type
|
||||
{s,t : Str} -- same as {s : Str ; t : Str}
|
||||
{a : A} **{b : B}-- record type extension, same as
|
||||
{a : A ; b : B}
|
||||
A * B * C -- tuple type, same as
|
||||
{p1 : A ; p2 : B ; p3 : C}
|
||||
Ints n -- type of n first integers
|
||||
```
|
||||
Resource (in ``oper``): all those of concrete, plus
|
||||
```
|
||||
Tok -- tokens (subtype of Str)
|
||||
A -> B -- functions from A to B
|
||||
Int -- integers
|
||||
Strs -- list of prefixes (for pre)
|
||||
PType -- parameter type
|
||||
Type -- any type
|
||||
```
|
||||
As parameter types, one can use any finite type:
|
||||
``P`` defined in ``param P``,
|
||||
``Ints n``, and record types of parameter types.
|
||||
|
||||
|
||||
|
||||
===Expressions===
|
||||
|
||||
Syntax trees = full function applications
|
||||
```
|
||||
f a b -- : C if fun f : A -> B -> C
|
||||
1977 -- : Int
|
||||
3.14 -- : Float
|
||||
"foo" -- : String
|
||||
```
|
||||
Higher-Order Abstract syntax (HOAS): functions as arguments:
|
||||
```
|
||||
F a (\x -> c) -- : C if a : A, c : C (x : B),
|
||||
fun F : A -> (B -> C) -> C
|
||||
```
|
||||
Tokens and token lists
|
||||
```
|
||||
"hello" -- : Tok, singleton Str
|
||||
"hello" ++ "world" -- : Str
|
||||
["hello world"] -- : Str, same as "hello" ++ "world"
|
||||
"hello" + "world" -- : Tok, computes to "helloworld"
|
||||
[] -- : Str, empty list
|
||||
```
|
||||
Parameters
|
||||
```
|
||||
Sg -- atomic constructor
|
||||
VPres Sg P2 -- applied constructor
|
||||
{n = Sg ; p = P3} -- record of parameters
|
||||
```
|
||||
Tables
|
||||
```
|
||||
table { -- by full branches
|
||||
Sg => "mouse" ;
|
||||
Pl => "mice"
|
||||
}
|
||||
table { -- by pattern matching
|
||||
Pl => "mice" ;
|
||||
_ => "mouse" -- wildcard pattern
|
||||
}
|
||||
table {
|
||||
n => regn n "cat" -- variable pattern
|
||||
}
|
||||
table Num {...} -- table given with arg. type
|
||||
table ["ox"; "oxen"] -- table as course of values
|
||||
\\_ => "fish" -- same as table {_ => "fish"}
|
||||
\\p,q => t -- same as \\p => \\q => t
|
||||
|
||||
t ! p -- select p from table t
|
||||
case e of {...} -- same as table {...} ! e
|
||||
```
|
||||
Records
|
||||
```
|
||||
{s = "Liz"; g = Fem} -- record in full form
|
||||
{s,t = "et"} -- same as {s = "et";t= "et"}
|
||||
{s = "Liz"} ** -- record extension: same as
|
||||
{g = Fem} {s = "Liz" ; g = Fem}
|
||||
|
||||
<a,b,c> -- tuple, same as {p1=a;p2=b;p3=c}
|
||||
```
|
||||
Functions
|
||||
```
|
||||
\x -> t -- lambda abstract
|
||||
\x,y -> t -- same as \x -> \y -> t
|
||||
\x,_ -> t -- binding not in t
|
||||
```
|
||||
Local definitions
|
||||
```
|
||||
let x : A = d in t -- let definition
|
||||
let x = d in t -- let defin, type inferred
|
||||
let x=d ; y=e in t -- same as
|
||||
let x=d in let y=e in t
|
||||
let {...} in t -- same as let ... in t
|
||||
|
||||
t where {...} -- same as let ... in t
|
||||
```
|
||||
Free variation
|
||||
```
|
||||
variants {x ; y} -- both x and y possible
|
||||
variants {} -- nothing possible
|
||||
```
|
||||
Prefix-dependent choices
|
||||
```
|
||||
pre {"a" ; "an" / v} -- "an" before v, "a" otherw.
|
||||
strs {"a" ; "i" ;"o"}-- list of condition prefixes
|
||||
```
|
||||
Typed expression
|
||||
```
|
||||
<t:T> -- same as t, to help type inference
|
||||
```
|
||||
Accessing bound variables in ``lin``: use fields ``$1, $2, $3,...``.
|
||||
Example:
|
||||
```
|
||||
fun F : (A : Set) -> (El A -> Prop) -> Prop ;
|
||||
lin F A B = {s = ["for all"] ++ A.s ++ B.$1 ++ B.s}
|
||||
```
|
||||
|
||||
|
||||
===Pattern matching===
|
||||
|
||||
These patterns can be used in branches of ``table`` and
|
||||
``case`` expressions. Patterns are matched in the order in
|
||||
which they appear in the grammar.
|
||||
```
|
||||
C -- atomic param constructor
|
||||
C p q -- param constr. applied to patterns
|
||||
x -- variable, matches anything
|
||||
_ -- wildcard, matches anything
|
||||
"foo" -- string
|
||||
56 -- integer
|
||||
{s = p ; y = q} -- record, matches extensions too
|
||||
<p,q> -- tuple, same as {p1=p ; p2=q}
|
||||
p | q -- disjunction, binds to first match
|
||||
x@p -- binds x to what p matches
|
||||
- p -- negation
|
||||
p + "s" -- sequence of two string patterns
|
||||
p* -- repetition of a string pattern
|
||||
```
|
||||
|
||||
===Sample library functions===
|
||||
|
||||
```
|
||||
-- lib/prelude/Predef.gf
|
||||
drop : Int -> Tok -> Tok -- drop prefix of length
|
||||
take : Int -> Tok -> Tok -- take prefix of length
|
||||
tk : Int -> Tok -> Tok -- drop suffix of length
|
||||
dp : Int -> Tok -> Tok -- take suffix of length
|
||||
occur : Tok -> Tok -> PBool -- test if substring
|
||||
occurs : Tok -> Tok -> PBool -- test if any char occurs
|
||||
show : (P:Type) -> P ->Tok -- param to string
|
||||
read : (P:Type) -> Tok-> P -- string to param
|
||||
toStr : (L:Type) -> L ->Str -- find "first" string
|
||||
|
||||
-- lib/prelude/Prelude.gf
|
||||
param Bool = True | False
|
||||
oper
|
||||
SS : Type -- the type {s : Str}
|
||||
ss : Str -> SS -- construct SS
|
||||
cc2 : (_,_ : SS) -> SS -- concat SS's
|
||||
optStr : Str -> Str -- string or empty
|
||||
strOpt : Str -> Str -- empty or string
|
||||
bothWays : Str -> Str -> Str -- X++Y or Y++X
|
||||
init : Tok -> Tok -- all but last char
|
||||
last : Tok -> Tok -- last char
|
||||
prefixSS : Str -> SS -> SS
|
||||
postfixSS : Str -> SS -> SS
|
||||
infixSS : Str -> SS -> SS -> SS
|
||||
if_then_else : (A : Type) -> Bool -> A -> A -> A
|
||||
if_then_Str : Bool -> Str -> Str -> Str
|
||||
```
|
||||
|
||||
|
||||
===Flags===
|
||||
|
||||
Flags can appear, with growing priority,
|
||||
- in files, judgement ``flags`` and without dash (``-``)
|
||||
- as flags to ``gf`` when invoked, with dash
|
||||
- as flags to various GF commands, with dash
|
||||
|
||||
|
||||
Some common flags used in grammars:
|
||||
```
|
||||
startcat=cat use this category as default
|
||||
|
||||
lexer=literals int and string literals recognized
|
||||
lexer=code like program code
|
||||
lexer=text like text: spacing, capitals
|
||||
lexer=textlit text, unknowns as string lits
|
||||
|
||||
unlexer=code like program code
|
||||
unlexer=codelit code, remove string lit quotes
|
||||
unlexer=text like text: punctuation, capitals
|
||||
unlexer=textlit text, remove string lit quotes
|
||||
unlexer=concat remove all spaces
|
||||
unlexer=bind remove spaces around "&+"
|
||||
|
||||
optimize=all_subs best for almost any concrete
|
||||
optimize=values good for lexicon concrete
|
||||
optimize=all usually good for resource
|
||||
optimize=noexpand for resource, if =all too big
|
||||
```
|
||||
For the full set of values for ``FLAG``,
|
||||
use on-line ``h -FLAG``.
|
||||
|
||||
|
||||
|
||||
===File import search paths===
|
||||
|
||||
Colon-separated list of directories searched in the
|
||||
given order:
|
||||
```
|
||||
--# -path=.:../abstract:../common:prelude
|
||||
```
|
||||
This can be (in order of increasing priority), as
|
||||
first line in the file, as flag to ``gf``
|
||||
when invoked, or as flag to the ``i`` command.
|
||||
The prefix ``--#`` is used only in files.
|
||||
|
||||
GF attempts to satisfy an ``import`` command by searching for the
|
||||
import filename in the above search paths, initially qualified
|
||||
relative to the current working directory. If the file is not found in
|
||||
that initial expansion, the search paths are re-qualified relative to
|
||||
the directories given in the ``GF_LIB_PATH`` environment variable. If
|
||||
``GF_LIB_PATH`` is not defined, its default value is
|
||||
``/usr/local/share/gf-3.9/lib`` (assuming you have GF version 3.9).
|
||||
|
||||
If your GF resource grammar libraries are installed somewhere else,
|
||||
you will want to set ``GF_LIB_PATH`` to point there instead. In a
|
||||
pinch, you can point to the ``GF/lib/src/`` folder in your clone of
|
||||
the GF source code repository.
|
||||
|
||||
Developers of resource grammars may find it useful to define multiple
|
||||
directories, colon-separated, in ``GF_LIB_PATH``.
|
||||
|
||||
|
||||
===Alternative grammar formats===
|
||||
|
||||
**Old GF** (before GF 2.0):
|
||||
all judgements in any kinds of modules,
|
||||
division into files uses ``include``s.
|
||||
A file ``Foo.gf`` is recognized as the old format
|
||||
if it lacks a module header.
|
||||
|
||||
**Context-free** (file ``foo.cf``). The form of rules is e.g.
|
||||
```
|
||||
Fun. S ::= NP "is" AP ;
|
||||
```
|
||||
If ``Fun`` is omitted, it is generated automatically.
|
||||
Rules must be one per line. The RHS can be empty.
|
||||
|
||||
**Extended BNF** (file ``foo.ebnf``). The form of rules is e.g.
|
||||
```
|
||||
S ::= (NP+ ("is" | "was") AP | V NP*) ;
|
||||
```
|
||||
where the RHS is a regular expression of categories
|
||||
and quoted tokens: ``"foo", CAT, T U, T|U, T*, T+, T?``, or empty.
|
||||
Rule labels are generated automatically.
|
||||
|
||||
|
||||
**Probabilistic grammars** (not a separate format).
|
||||
You can set the probability of a function ``f`` (in its value category) by
|
||||
```
|
||||
--# prob f 0.009
|
||||
```
|
||||
These are put into a file given to GF using the ``probs=File`` flag
|
||||
on command line. This file can be the grammar file itself.
|
||||
|
||||
**Example-based grammars** (file ``foo.gfe``). Expressions of the form
|
||||
```
|
||||
in Cat "example string"
|
||||
```
|
||||
are preprocessed by using a parser given by the flag
|
||||
```
|
||||
--# -resource=File
|
||||
```
|
||||
and the result is written to ``foo.gf``.
|
||||
|
||||
|
||||
===References===
|
||||
|
||||
[GF Homepage http://www.grammaticalframework.org/]
|
||||
|
||||
A. Ranta, Grammatical Framework: A Type-Theoretical Grammar Formalism.
|
||||
//The Journal of Functional Programming//, vol. 14:2. 2004, pp. 145-189.
|
||||
|
||||
@@ -1,15 +1,32 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<HTML>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<HEAD>
|
||||
<TITLE>GF Language Reference Manual</TITLE>
|
||||
</HEAD><BODY BGCOLOR="white" TEXT="black">
|
||||
<P ALIGN="center"><CENTER><H1>GF Language Reference Manual</H1>
|
||||
<TITLE>GF Language Reference Manual</TITLE>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
||||
<style>
|
||||
code {
|
||||
color: inherit;
|
||||
}
|
||||
center {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
</style>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<div class="container-fluid my-5" style="max-width:1200px">
|
||||
|
||||
<P ALIGN="center">
|
||||
<CENTER>
|
||||
<a href="..">
|
||||
<img src="Logos/gf1.svg" height="200px" class="mb-3" alt="GF Logo">
|
||||
</a>
|
||||
<H1>GF Language Reference Manual</H1>
|
||||
<FONT SIZE="4">
|
||||
<I>Aarne Ranta</I>, <I>Krasimir Angelov</I><BR>June 2014, GF 3.6
|
||||
</FONT></CENTER>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<P></P>
|
||||
<UL>
|
||||
<LI><A HREF="#toc1">Overview of GF</A>
|
||||
@@ -92,7 +109,7 @@
|
||||
</UL>
|
||||
|
||||
<P></P>
|
||||
<HR NOSHADE SIZE=1>
|
||||
<HR>
|
||||
<P></P>
|
||||
<P>
|
||||
|
||||
@@ -482,7 +499,7 @@ to reuse abstract and concrete modules as resources. The following table
|
||||
gives, for all module types, the possible module types of their <I>extends</I>
|
||||
and <I>opens</I>, as well as the forms of judgement legal in that module type.
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>module type</TH>
|
||||
<TH>extends</TH>
|
||||
@@ -553,7 +570,7 @@ system, replacing modules by types and functions. This model could actually
|
||||
be developed towards treating modules in GF as first-class objects; so far,
|
||||
however, this step has not been motivated by any practical needs.
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>module</TH>
|
||||
<TH COLSPAN="2">object and type</TH>
|
||||
@@ -918,7 +935,7 @@ The table moreover indicates whether the judgement has a default value, and
|
||||
whether it contributes to the <B>name base</B>, i.e. introduces a new
|
||||
name to the scope.
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>judgement</TH>
|
||||
<TH>where</TH>
|
||||
@@ -1658,7 +1675,7 @@ inherited modules.
|
||||
<P>
|
||||
Here are some flags commonly included in grammars.
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>flag</TH>
|
||||
<TH>value</TH>
|
||||
@@ -1721,7 +1738,7 @@ Type and other expressions have a system of <B>precedences</B>. The following ta
|
||||
summarizes all expression forms, from the highest to the lowest precedence.
|
||||
Some expressions are moreover left- or right-associative.
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>prec</TH>
|
||||
<TH>expression example</TH>
|
||||
@@ -2128,7 +2145,7 @@ where
|
||||
GF provides three predefined categories for abstract syntax, with predefined
|
||||
expressions:
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>category</TH>
|
||||
<TH COLSPAN="2">expressions</TH>
|
||||
@@ -2264,7 +2281,7 @@ Expressions of type <CODE>Str</CODE> have the following canonical forms:
|
||||
<LI><B>the empty token list</B>, <CODE>[]</CODE>
|
||||
<LI><B>concatenation</B>, <I>s</I> <CODE>++</CODE> <I>t</I>, where <I>s,t</I> : <CODE>Str</CODE>
|
||||
<LI><B>prefix-dependent choice</B>,
|
||||
<CODE>pre {p<sub>1</sub> => s<sub>1</sub> ; ... ; p<sub>n</sub> => s<sub>n</sub> ; _ => s }, where
|
||||
<CODE>pre {p<sub>1</sub> => s<sub>1</sub> ; ... ; p<sub>n</sub> => s<sub>n</sub> ; _ => s }</CODE>, where
|
||||
<UL>
|
||||
<LI><I>s</I>, <i>s</i><sub>1</sub>,...,<i>s</i><sub>n</sub>, <i>p</i><sub>1</sub>,...,<i>p</i><sub>n</sub> : <CODE>Str</CODE>
|
||||
</UL>
|
||||
@@ -3016,7 +3033,7 @@ The following predefined operations are defined in the resource module
|
||||
<CODE>prelude/Predef.gf</CODE>. Their implementations are defined as
|
||||
a part of the GF grammar compiler.
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>operation</TH>
|
||||
<TH>type</TH>
|
||||
@@ -3120,23 +3137,44 @@ a part of the GF grammar compiler.
|
||||
<TR>
|
||||
<TD><CODE>nonExist</CODE></TD>
|
||||
<TD><CODE>Str</CODE></TD>
|
||||
<TD>this is a special token marking<BR/>
|
||||
<TD>a special token marking<BR/>
|
||||
non-existing morphological forms</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>BIND</CODE></TD>
|
||||
<TD><CODE>Str</CODE></TD>
|
||||
<TD>this is a special token marking<BR/>
|
||||
<TD>a special token marking<BR/>
|
||||
that the surrounding tokens should not<BR/>
|
||||
be separated by space</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>SOFT_BIND</CODE></TD>
|
||||
<TD><CODE>Str</CODE></TD>
|
||||
<TD>this is a special token marking<BR/>
|
||||
<TD>a special token marking<BR/>
|
||||
that the surrounding tokens may not<BR/>
|
||||
be separated by space</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>SOFT_SPACE</CODE></TD>
|
||||
<TD><CODE>Str</CODE></TD>
|
||||
<TD>a special token marking<BR/>
|
||||
that the space between the surrounding tokens<BR/>
|
||||
is optional</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>CAPIT</CODE></TD>
|
||||
<TD><CODE>Str</CODE></TD>
|
||||
<TD>a special token marking<BR/>
|
||||
that the first character in the next token<BR/>
|
||||
should be capitalized</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD><CODE>ALL_CAPIT</CODE></TD>
|
||||
<TD><CODE>Str</CODE></TD>
|
||||
<TD>a special token marking<BR/>
|
||||
that the next word should be<BR/>
|
||||
in all capital letters</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P></P>
|
||||
@@ -3181,7 +3219,7 @@ the abstract syntax.
|
||||
<B>Compiler pragmas</B> are a special form of comments prefixed with <CODE>--#</CODE>.
|
||||
Currently GF interprets the following pragmas.
|
||||
</P>
|
||||
<TABLE CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>pragma</TH>
|
||||
<TH COLSPAN="2">explanation</TH>
|
||||
@@ -3279,7 +3317,7 @@ The rules have the form
|
||||
where an <I>RHS</I> can be any regular expression
|
||||
built from quoted strings and category symbols, in the following ways:
|
||||
</P>
|
||||
<TABLE ALIGN="center" CELLPADDING="4" BORDER="1">
|
||||
<TABLE class="table">
|
||||
<TR>
|
||||
<TH>RHS item</TH>
|
||||
<TH COLSPAN="2">explanation</TH>
|
||||
@@ -4579,6 +4617,6 @@ All other symbols are terminals.
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P></P>
|
||||
|
||||
</BODY></HTML>
|
||||
</div>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
The GF Software System
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!options(html): --toc
|
||||
%!options(html): --toc-level=4
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
%!postproc(html): "#VSPACE" "<hr>"
|
||||
%!postproc(html): "#NORMAL" ""
|
||||
%!postproc(html): "#TINY" ""
|
||||
@@ -13,7 +10,7 @@ The GF Software System
|
||||
|
||||
The GF software system implements the GF programming language. Its
|
||||
components are
|
||||
- the //compiler//,
|
||||
- the //compiler//,
|
||||
translating ``.gf`` source files to ``.gfo`` object files, to
|
||||
``.pgf`` run-time grammars, and to various other formats
|
||||
- the //run-time system//,
|
||||
@@ -43,7 +40,7 @@ The shell maintains a //state//, to which belong
|
||||
|
||||
|
||||
Unless file arguments are provided to the ``gf`` command, the shell starts in an
|
||||
empty state, with no grammars and no history.
|
||||
empty state, with no grammars and no history.
|
||||
|
||||
In the shell, a set of commands
|
||||
is available. Some of these commands may change the grammars in the state. The general
|
||||
@@ -59,7 +56,7 @@ syntax of commands is given by the following BNF grammar:
|
||||
ARGUMENT ::= QUOTED_STRING | TREE
|
||||
VALUE ::= IDENT | QUOTED_STRING
|
||||
```
|
||||
A command pipe is a sequence of commands interpreted in such a way
|
||||
A command pipe is a sequence of commands interpreted in such a way
|
||||
that the output of each command
|
||||
is send as input to the next. The option ``-tr`` causes GF to show a trace,
|
||||
i.e. the intermediate result of the command to which it is attached.
|
||||
@@ -69,7 +66,7 @@ executed one by one, in the order of appearance.
|
||||
|
||||
===GF shell commands===
|
||||
|
||||
The full set of GF shell commands is listed below with explanations.
|
||||
The full set of GF shell commands is listed below with explanations.
|
||||
This list can also be obtained in the GF shell by the command ``help -full``.
|
||||
|
||||
%!include: gf-help-full.txt
|
||||
@@ -77,14 +74,14 @@ This list can also be obtained in the GF shell by the command ``help -full``.
|
||||
==The GF batch compiler==
|
||||
|
||||
With the option ``-batch``, GF can be invoked in batch mode, i.e.
|
||||
without opening the shell, to compile files from ``.gf`` to ``.gfo``.
|
||||
The ``-s`` option ("silent") eliminates all messages except errors.
|
||||
without opening the shell, to compile files from ``.gf`` to ``.gfo``.
|
||||
The ``-s`` option ("silent") eliminates all messages except errors.
|
||||
```
|
||||
$ gf -batch -s LangIta.gf
|
||||
```
|
||||
With the option ``-make``, and as a set of
|
||||
top-level grammar files (with the same abstract syntax) as arguments,
|
||||
GF produces a ``.pgf`` file. The flag ``-optimize-pgf`` minimizes
|
||||
GF produces a ``.pgf`` file. The flag ``-optimize-pgf`` minimizes
|
||||
the size of the ``.pgf`` file, and is recommended for grammars to be shipped.
|
||||
```
|
||||
$ gf -make -optimize-pgf LangIta.gf LangEng.gf LangGer.gf
|
||||
@@ -107,5 +104,3 @@ To run GF from a //script//, redirection of standard input can be used:
|
||||
```
|
||||
The file ``script.gfs`` should then contain a sequence of GF commands, one per line.
|
||||
Unrecognized command lines are skipped without terminating GF.
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ December 2010 for GF 3.2
|
||||
% txt2tags --toc -ttex gf-tutorial.txt
|
||||
|
||||
%!target:html
|
||||
%!encoding: iso-8859-1
|
||||
%!encoding: utf-8
|
||||
%!options: --toc
|
||||
|
||||
%!postproc(tex) : "\\subsection\*" "\\newslide"
|
||||
@@ -836,8 +836,8 @@ Finnish and an Italian concrete syntaxes:
|
||||
lin
|
||||
Hello recip = {s = "terve" ++ recip.s} ;
|
||||
World = {s = "maailma"} ;
|
||||
Mum = {s = "äiti"} ;
|
||||
Friends = {s = "ystävät"} ;
|
||||
Mum = {s = "äiti"} ;
|
||||
Friends = {s = "ystävät"} ;
|
||||
}
|
||||
|
||||
concrete HelloIta of Hello = {
|
||||
@@ -925,7 +925,7 @@ Default of the language flag (``-lang``): the last-imported concrete syntax.
|
||||
**Multilingual generation**:
|
||||
```
|
||||
> parse -lang=HelloEng "hello friends" | linearize
|
||||
terve ystävät
|
||||
terve ystävät
|
||||
ciao amici
|
||||
hello friends
|
||||
```
|
||||
@@ -1335,7 +1335,7 @@ Just (?) replace English words with their dictionary equivalents:
|
||||
Phrase, Item, Kind, Quality = {s : Str} ;
|
||||
|
||||
lin
|
||||
Is item quality = {s = item.s ++ "č" ++ quality.s} ;
|
||||
Is item quality = {s = item.s ++ "è" ++ quality.s} ;
|
||||
This kind = {s = "questo" ++ kind.s} ;
|
||||
That kind = {s = "quel" ++ kind.s} ;
|
||||
QKind quality kind = {s = kind.s ++ quality.s} ;
|
||||
@@ -1446,11 +1446,11 @@ linearizations in different languages:
|
||||
> gr -number=2 | l -treebank
|
||||
|
||||
Is (That Cheese) (Very Boring)
|
||||
quel formaggio č molto noioso
|
||||
quel formaggio è molto noioso
|
||||
that cheese is very boring
|
||||
|
||||
Is (That Cheese) Fresh
|
||||
quel formaggio č fresco
|
||||
quel formaggio è fresco
|
||||
that cheese is fresh
|
||||
```
|
||||
|
||||
@@ -1472,14 +1472,14 @@ answer given in another language.
|
||||
You can interrupt the quiz by entering a line consisting of a dot ('.').
|
||||
|
||||
this fish is warm
|
||||
questo pesce č caldo
|
||||
questo pesce è caldo
|
||||
> Yes.
|
||||
Score 1/1
|
||||
|
||||
this cheese is Italian
|
||||
questo formaggio č noioso
|
||||
> No, not questo formaggio č noioso, but
|
||||
questo formaggio č italiano
|
||||
questo formaggio è noioso
|
||||
> No, not questo formaggio è noioso, but
|
||||
questo formaggio è italiano
|
||||
|
||||
Score 1/2
|
||||
this fish is expensive
|
||||
@@ -1756,7 +1756,7 @@ Simultaneous extension and opening:
|
||||
lincat
|
||||
Question = SS ;
|
||||
lin
|
||||
QIs item quality = ss (item.s ++ "č" ++ quality.s) ;
|
||||
QIs item quality = ss (item.s ++ "è" ++ quality.s) ;
|
||||
Pizza = ss "pizza" ;
|
||||
}
|
||||
```
|
||||
@@ -2364,10 +2364,10 @@ in English, with special care taken of variations with the suffix
|
||||
|
||||
+ Implement the German **Umlaut** operation on word stems.
|
||||
The operation changes the vowel of the stressed stem syllable as follows:
|
||||
//a// to //ä//, //au// to //äu//, //o// to //ö//, and //u// to //ü//. You
|
||||
//a// to //ä//, //au// to //äu//, //o// to //ö//, and //u// to //ü//. You
|
||||
can assume that the operation only takes syllables as arguments. Test the
|
||||
operation to see whether it correctly changes //Arzt// to //Ärzt//,
|
||||
//Baum// to //Bäum//, //Topf// to //Töpf//, and //Kuh// to //Küh//.
|
||||
operation to see whether it correctly changes //Arzt// to //Ärzt//,
|
||||
//Baum// to //Bäum//, //Topf// to //Töpf//, and //Kuh// to //Küh//.
|
||||
|
||||
|
||||
|
||||
@@ -2480,10 +2480,10 @@ The command ``morpho_quiz = mq`` generates inflection exercises.
|
||||
Welcome to GF Morphology Quiz.
|
||||
...
|
||||
|
||||
réapparaître : VFin VCondit Pl P2
|
||||
réapparaitriez
|
||||
> No, not réapparaitriez, but
|
||||
réapparaîtriez
|
||||
réapparaître : VFin VCondit Pl P2
|
||||
réapparaitriez
|
||||
> No, not réapparaitriez, but
|
||||
réapparaîtriez
|
||||
Score 0/1
|
||||
```
|
||||
To create a list for later use, use the command ``morpho_list = ml``
|
||||
@@ -2563,7 +2563,7 @@ We need only number variation for the copula.
|
||||
```
|
||||
copula : Number -> Str =
|
||||
\n -> case n of {
|
||||
Sg => "č" ;
|
||||
Sg => "è" ;
|
||||
Pl => "sono"
|
||||
} ;
|
||||
```
|
||||
@@ -3305,13 +3305,13 @@ we can write a **functor instantiation**,
|
||||
oper
|
||||
wine_N = mkN "Wein" ;
|
||||
pizza_N = mkN "Pizza" "Pizzen" feminine ;
|
||||
cheese_N = mkN "Käse" "Käsen" masculine ;
|
||||
cheese_N = mkN "Käse" "Käsen" masculine ;
|
||||
fish_N = mkN "Fisch" ;
|
||||
fresh_A = mkA "frisch" ;
|
||||
warm_A = mkA "warm" "wärmer" "wärmste" ;
|
||||
warm_A = mkA "warm" "wärmer" "wärmste" ;
|
||||
italian_A = mkA "italienisch" ;
|
||||
expensive_A = mkA "teuer" ;
|
||||
delicious_A = mkA "köstlich" ;
|
||||
delicious_A = mkA "köstlich" ;
|
||||
boring_A = mkA "langweilig" ;
|
||||
}
|
||||
```
|
||||
@@ -3362,11 +3362,11 @@ Lexicon instance
|
||||
cheese_N = mkN "juusto" ;
|
||||
fish_N = mkN "kala" ;
|
||||
fresh_A = mkA "tuore" ;
|
||||
warm_A = mkA "lämmin" ;
|
||||
warm_A = mkA "lämmin" ;
|
||||
italian_A = mkA "italialainen" ;
|
||||
expensive_A = mkA "kallis" ;
|
||||
delicious_A = mkA "herkullinen" ;
|
||||
boring_A = mkA "tylsä" ;
|
||||
boring_A = mkA "tylsä" ;
|
||||
}
|
||||
```
|
||||
Functor instantiation
|
||||
@@ -3626,7 +3626,7 @@ Goals:
|
||||
- semantic definitions
|
||||
|
||||
These concepts are inherited from **type theory** (more precisely:
|
||||
constructive type theory, or Martin-Löf type theory).
|
||||
constructive type theory, or Martin-Löf type theory).
|
||||
|
||||
Type theory is the basis **logical frameworks**.
|
||||
|
||||
@@ -4639,7 +4639,7 @@ output. Therefore it can be a part of a pipe and read and write files.
|
||||
The simplest way to translate is to ``echo`` input to the program:
|
||||
```
|
||||
% echo "this wine is delicious" | ./trans Food.pgf
|
||||
questo vino č delizioso
|
||||
questo vino è delizioso
|
||||
```
|
||||
The result is given in all languages except the input language.
|
||||
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
FILES="darcs.txt transfer-reference.txt transfer-tutorial.txt \
|
||||
transfer.txt"
|
||||
|
||||
for f in $FILES; do
|
||||
h=`basename "$f" ".txt"`.html
|
||||
if [ "$f" -nt "$h" ]; then
|
||||
txt2tags $f
|
||||
else
|
||||
echo "$h is newer than $f, skipping"
|
||||
fi
|
||||
done
|
||||
@@ -1,10 +1,6 @@
|
||||
GF character encoding changes
|
||||
Thomas Hallgren
|
||||
%%mtime(%F)
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
2013-12-18
|
||||
|
||||
==Changes to character encodings in GF grammar files ==
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ GF 3.1.6 released 23 April 2010.
|
||||
- Windows (zipped executable):
|
||||
[``gf-3.1.6-bin-i486-windows.zip`` gf-3.1.6-bin-i486-windows.zip]
|
||||
(1.6 MB)
|
||||
- Ubuntu Linux (gzipped executable):
|
||||
- Ubuntu Linux (gzipped executable):
|
||||
[``gf-3.1.6-bin-i486-linux.gz`` gf-3.1.6-bin-i486-linux.gz]
|
||||
(1.7 MB)
|
||||
- compiled library package:
|
||||
@@ -25,7 +25,7 @@ GF 3.1.6 released 23 April 2010.
|
||||
- full source package (GF system, libraries, examples, documentation):
|
||||
[``gf-3.1.6-src.tar.gz`` gf-3.1.6-src.tar.gz]
|
||||
(11 MB)
|
||||
|
||||
|
||||
GF is also on [Hackage http://hackage.haskell.org/package/gf]
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ What's new? See the [release notes release-3.1.6.html].
|
||||
==Installation instructions==
|
||||
|
||||
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
It finds the libraries relative to the ``.exe`` file.
|
||||
|
||||
To install a binary package for MacOS X or Linux: uncompress the executable and
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TD><B> <TH>
|
||||
%!postproc(html): </B></TD> </TH>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
**GF 3.2.9** source-only snapshot was released on 12 September 2011.
|
||||
|
||||
What's new? Faster grammar compilation!
|
||||
@@ -77,9 +72,3 @@ The above notes for installing from source apply also in this case.
|
||||
- [GF 3.2 index-3.2.html] (December 2011).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TD><B> <TH>
|
||||
%!postproc(html): </B></TD> </TH>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
**GF 3.2** was released on 23 December 2010.
|
||||
|
||||
What's new? See the [Release notes release-3.2.html].
|
||||
@@ -27,7 +22,7 @@ More packages might be added later.
|
||||
|
||||
===Notes===
|
||||
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
It finds the libraries relative to the ``.exe`` file.
|
||||
|
||||
The ``.deb`` packages work on Ubuntu 10.04 and 10.10.
|
||||
@@ -105,8 +100,3 @@ Subsequently:
|
||||
```
|
||||
|
||||
The above notes for installing from source apply also in this case.
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <TD><B> <TH>
|
||||
%!postproc(html): </B></TD> </TH>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
**GF 3.3.3** was released on 3 March 2012.
|
||||
|
||||
What's new? See the [Release notes release-3.3.3.html].
|
||||
@@ -24,7 +18,7 @@ What's new? See the [Release notes release-3.3.3.html].
|
||||
|
||||
===Notes===
|
||||
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
It finds the libraries relative to the ``.exe`` file.
|
||||
|
||||
%The ``.deb`` packages work on Ubuntu 10.04 and 10.10.
|
||||
@@ -127,9 +121,3 @@ For more info, see the [GF Developers Guide ../doc/gf-developers.html].
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TD><B> <TH>
|
||||
%!postproc(html): </B></TD> </TH>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
**GF 3.3** was released on 27 October 2011.
|
||||
|
||||
What's new? See the [Release notes release-3.3.html].
|
||||
@@ -27,7 +22,7 @@ More packages might be added later.
|
||||
|
||||
===Notes===
|
||||
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
The Windows package is installed by just unpacking it anywhere.
|
||||
It finds the libraries relative to the ``.exe`` file.
|
||||
|
||||
%The ``.deb`` packages work on Ubuntu 10.04 and 10.10.
|
||||
@@ -115,9 +110,3 @@ The above notes for installing from source apply also in this case.
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): </HEAD> <STYLE>body { color: #333; } li>code,p>code,pre { color: #730; }</STYLE></HEAD>
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <TD><B> <TH>
|
||||
%!postproc(html): </B></TD> </TH>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
**GF 3.4** was released on 31 January 2013.
|
||||
|
||||
What's new? See the [Release notes release-3.4.html].
|
||||
@@ -20,14 +13,11 @@ What's new? See the [Release notes release-3.4.html].
|
||||
| Fedora (32-bit) | [Fedora RPMs /~hallgren/tmp/Fedora/] | ``sudo rpm -i ...``
|
||||
| Ubuntu (32-bit) | [gf_3.4-1_i386.deb gf_3.4-1_i386.deb] | ``sudo dpkg -i gf_3.4-1_i386.deb``
|
||||
| Ubuntu (64-bit) | [gf_3.4-1_amd64.deb gf_3.4-1_amd64.deb] | ``sudo dpkg -i gf_3.4-1_amd64.deb``
|
||||
| Windows | [gf-3.4-bin-windows.zip gf-3.4-bin-windows.zip] |
|
||||
%| ... | ... | ...
|
||||
|
||||
%More binary packages might be added later.
|
||||
| Windows | [gf-3.4-bin-windows.zip gf-3.4-bin-windows.zip] | -
|
||||
|
||||
===Notes===
|
||||
|
||||
%The Windows package is installed by just unpacking it anywhere.
|
||||
%The Windows package is installed by just unpacking it anywhere.
|
||||
%It finds the libraries relative to the ``.exe`` file.
|
||||
|
||||
The ``.deb`` packages work on Ubuntu 12.04, 12.10 and 13.04.
|
||||
@@ -153,8 +143,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): </HEAD> <STYLE>body { color: #333; } li>code,p>code,pre { color: #730; }</STYLE></HEAD>
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <TD><B> <TH>
|
||||
%!postproc(html): </B></TD> </TH>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
**GF 3.5** was released on 6 August 2013.
|
||||
|
||||
What's new? See the [Release notes release-3.5.html].
|
||||
@@ -157,8 +150,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): </HEAD> <STYLE>body { color: #333; } li>code,p>code,pre { color: #730; }</STYLE></HEAD>
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
%!postproc(html): <TD><I> <TD><small>
|
||||
%!postproc(html): </I></TD> </small></TD>
|
||||
|
||||
**GF 3.6** was released on 23 June 2014.
|
||||
|
||||
What's new? See the [Release notes release-3.6.html].
|
||||
@@ -177,8 +170,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/notes.css
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
%!postproc(html): <TD><I> <TD><small>
|
||||
%!postproc(html): </I></TD> </small></TD>
|
||||
|
||||
**GF 3.7.1** was released on 2 October 2015.
|
||||
|
||||
What's new? See the [Release notes release-3.7.1.html].
|
||||
@@ -46,7 +40,7 @@ The ``.deb`` packages work on Ubuntu 12.04, 14.04 and 15.04.
|
||||
|
||||
The packages for Mac OS X should work on at least 10.9, 10.10 and 10.11 (Mavericks, Yosemite and El Capitan).
|
||||
|
||||
(*) **Note** that for compatibility with OS X 10.11,
|
||||
(*) **Note** that for compatibility with OS X 10.11,
|
||||
``gf-3.7.1.pkg`` will install the ``gf`` executable in ``/usr/local/bin``
|
||||
instead of ``/usr/bin``, so make sure ``/usr/local/bin`` is in your ``$PATH``.
|
||||
Also, if you still have an older version of GF installed in ``/usr/bin``,
|
||||
@@ -180,8 +174,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,13 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): </HEAD> <STYLE>body { color: #333; } li>code,p>code,pre { color: #730; }</STYLE></HEAD>
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
%!postproc(html): <TD><I> <TD><small>
|
||||
%!postproc(html): </I></TD> </small></TD>
|
||||
|
||||
**GF 3.7** was released on 25 June 2015.
|
||||
|
||||
What's new? See the [Release notes release-3.7.html].
|
||||
@@ -173,8 +166,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/notes.css
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
%!postproc(html): <TD><I> <TD><small>
|
||||
%!postproc(html): </I></TD> </small></TD>
|
||||
|
||||
**GF 3.8** was released on 22 June 2016.
|
||||
|
||||
What's new? See the [Release notes release-3.8.html].
|
||||
@@ -49,7 +43,7 @@ Linux distributions.
|
||||
|
||||
The packages for Mac OS X should work on at least 10.9, 10.10 and 10.11 (Mavericks, Yosemite and El Capitan).
|
||||
|
||||
(*) **Note** that for compatibility with OS X 10.11,
|
||||
(*) **Note** that for compatibility with OS X 10.11,
|
||||
``gf-3.8.pkg`` will install the ``gf`` executable in ``/usr/local/bin``
|
||||
instead of ``/usr/bin``, so make sure ``/usr/local/bin`` is in your ``$PATH``.
|
||||
Also, if you still have an older version of GF installed in ``/usr/bin``,
|
||||
@@ -171,8 +165,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Grammatical Framework Download and Installation
|
||||
|
||||
|
||||
%!style:../css/notes.css
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
%!postproc(html): <TD><I> <TD><small>
|
||||
%!postproc(html): </I></TD> </small></TD>
|
||||
|
||||
**GF 3.9** was released on 11 August 2017.
|
||||
|
||||
What's new? See the [Release notes release-3.9.html].
|
||||
@@ -18,10 +12,11 @@ What's new? See the [Release notes release-3.9.html].
|
||||
| macOS | [gf-3.9.pkg gf-3.9.pkg] | //GF+S+C+J+P// | Double-click on the package icon
|
||||
| macOS | [gf-3.9-bin-intel-mac.tar.gz gf-3.9-bin-intel-mac.tar.gz] | //GF+S+C+J+P// | ``sudo tar -C /usr/local -zxf gf-3.9-bin-intel-mac.tar.gz``
|
||||
%| Fedora (32-bit) | [Fedora RPMs /~hallgren/tmp/Fedora/] | //GF+S+C+J+P// | ``sudo rpm -i ...``
|
||||
| Raspian 9.1 | [gf_3.9-1_armhf.deb gf_3.9-1_armhf.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_armhf.deb``
|
||||
| Raspbian 9.1 | [gf_3.9-1_armhf.deb gf_3.9-1_armhf.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_armhf.deb``
|
||||
| Ubuntu (32-bit) | [gf_3.9-1_i386.deb gf_3.9-1_i386.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_i386.deb``
|
||||
| Ubuntu (64-bit) | [gf_3.9-1_amd64.deb gf_3.9-1_amd64.deb] | //GF+S+C+J+P// | ``sudo dpkg -i gf_3.9-1_amd64.deb``
|
||||
| Windows | [gf-3.9-bin-windows.zip gf-3.9-bin-windows.zip] | //GF+S// | ``unzip gf-3.9-bin-windows.zip``
|
||||
|
||||
%| MINGW | [gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz] | //GF+S+C// | ``tar -C / gf-3.9-bin-i686-MINGW32_NT-6.1.tar.gz``
|
||||
%| ... | ... | ... | ...
|
||||
|
||||
@@ -176,6 +171,11 @@ The above notes for installing from source apply also in these cases.
|
||||
For more info on working with the GF source code, see the
|
||||
[GF Developers Guide ../doc/gf-developers.html].
|
||||
|
||||
==Using Stack==
|
||||
|
||||
You can also use [Stack https://www.haskellstack.org] to compile GF, just replace ``cabal install`` above
|
||||
with ``stack install`` (assuming you already have Stack set up).
|
||||
|
||||
==Older releases==
|
||||
|
||||
- [GF 3.8 index-3.8.html] (June 2016)
|
||||
@@ -190,8 +190,3 @@ For more info on working with the GF source code, see the
|
||||
- [GF 3.2 index-3.2.html] (December 2010).
|
||||
- [GF 3.1.6 index-3.1.6.html] (April 2010).
|
||||
- [GF 3.1 old-index.html] (December 2009).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
184
download/index.md
Normal file
@@ -0,0 +1,184 @@
|
||||
---
|
||||
title: Grammatical Framework Download and Installation
|
||||
...
|
||||
|
||||
**GF 3.10** was released on 2 December 2018.
|
||||
It is the first version of GF which _does not include the RGL_.
|
||||
|
||||
What's new? See the [release notes](release-3.10.html).
|
||||
|
||||
## Binary packages
|
||||
|
||||
| Platform | Download | Features | How to install |
|
||||
|:----------------|:---------------------------------------------------|:---------------|:-----------------------------------|
|
||||
| macOS | [gf-3.10.pkg](gf-3.10.pkg) | GF, S, C, J, P | Double-click on the package icon |
|
||||
| Ubuntu (64-bit) | [gf\_3.10-1\_amd64.deb](gf_3.10-1_amd64.deb) | GF, S, C, J, P | `sudo dpkg -i gf_3.10-1_amd64.deb` |
|
||||
| Windows | [gf-3.10-bin-windows.zip](gf-3.10-bin-windows.zip) | GF, S | `unzip gf-3.10-bin-windows.zip` |
|
||||
|
||||
<!--
|
||||
| macOS | [gf-3.10-bin-intel-mac.tar.gz](gf-3.10-bin-intel-mac.tar.gz) | GF,S,C,J,P | `sudo tar -C /usr/local -zxf gf-3.10-bin-intel-mac.tar.gz` |
|
||||
| Raspbian 9.1 | [gf\_3.10-1\_armhf.deb](gf_3.10-1_armhf.deb) | GF,S,C,J,P | `sudo dpkg -i gf_3.10-1_armhf.deb` |
|
||||
| Ubuntu (32-bit) | [gf\_3.10-1\_i386.deb](gf_3.10-1_i386.deb) | GF,S,C,J,P | `sudo dpkg -i gf_3.10-1_i386.deb` |
|
||||
-->
|
||||
|
||||
**Features**
|
||||
|
||||
- GF = GF shell and grammar compiler
|
||||
- S = `gf -server` mode
|
||||
- C = C run-time system
|
||||
- J/P = Java/Python binding to the C run-time system
|
||||
|
||||
### Notes
|
||||
|
||||
The Windows package is installed by just unpacking it anywhere. You will
|
||||
probably need to set the `PATH` and `GF_LIB_PATH` environment variables,
|
||||
see Inari's notes on [Installing GF on Windows](http://www.grammaticalframework.org/~inari/gf-windows.html#toc3).
|
||||
|
||||
The Ubuntu `.deb` packages should work on Ubuntu 16.04 and 18.04 and
|
||||
similar Linux distributions.
|
||||
|
||||
<!-- The Raspbian `.deb` package was created on a Raspberry Pi 3 and will
|
||||
probably work on other ARM-based systems running Debian 9 (stretch) or
|
||||
similar Linux distributions. -->
|
||||
|
||||
The packages for macOS (Mac OS X) should work on at least 10.13 and
|
||||
10.14 (High Sierra and Mojave)
|
||||
|
||||
<!-- The Mac OS and Linux `.tar.gz` packages are designed to be installed in
|
||||
`/usr/local`. You can install them in other locations, but then you need
|
||||
to set the `GF_LIB_PATH` environment variable:
|
||||
|
||||
```
|
||||
export GF_LIB_PATH=/usr/local/share/gf-3.10/lib
|
||||
```
|
||||
|
||||
where `/usr/local` should be replaced with the path to the location
|
||||
where you unpacked the package. -->
|
||||
|
||||
## Installing the latest release from source
|
||||
|
||||
[GF is on Hackage](http://hackage.haskell.org/package/gf), so under
|
||||
normal circumstances the procedure is fairly simple:
|
||||
|
||||
1. Install a recent version of the [Haskell
|
||||
Platform](http://hackage.haskell.org/platform) (see note below)
|
||||
2. `cabal update`
|
||||
3. On Linux: install some C libraries from your Linux distribution (see note below)
|
||||
4. `cabal install gf`
|
||||
|
||||
Note that this installs GF _without_ the RGL.
|
||||
|
||||
You can also download full source packages from GitHub at the following links:
|
||||
|
||||
- [GF releases](https://github.com/GrammaticalFramework/gf-core/releases)
|
||||
- [RGL releases](https://github.com/GrammaticalFramework/gf-rgl/releases)
|
||||
|
||||
### Notes
|
||||
|
||||
**Installation location**
|
||||
|
||||
The above steps installs GF for a single user. The executables are put
|
||||
in `$HOME/.cabal/bin` (or, with recent versions of the Haskell platform
|
||||
on Mac OS X, in `$HOME/Library/Haskell/bin`), so it is a good idea to
|
||||
put a line in your `.bash_profile` or `.profile` to add that directory
|
||||
to you path:
|
||||
|
||||
```
|
||||
PATH=$HOME/.cabal/bin:$PATH
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
PATH=$HOME/Library/Haskell/bin:$PATH
|
||||
```
|
||||
|
||||
**Build tools**
|
||||
|
||||
In order to compile GF you need the build tools **Alex** and **Happy**.
|
||||
These can be installed via Cabal, e.g.:
|
||||
|
||||
```
|
||||
cabal install alex happy
|
||||
```
|
||||
|
||||
or obtained by other means, depending on your OS.
|
||||
|
||||
**Haskeline**
|
||||
|
||||
GF uses [`haskeline`](http://hackage.haskell.org/package/haskeline), which
|
||||
on Linux depends on some non-Haskell libraries that won't be installed
|
||||
automatically by cabal, and therefore need to be installed manually.
|
||||
Here is one way to do this:
|
||||
|
||||
- On Ubuntu: `sudo apt-get install libghc-haskeline-dev`
|
||||
- On Fedora: `sudo yum install ghc-haskeline-devel`
|
||||
|
||||
**GHC version**
|
||||
|
||||
The GF source code has been updated to compile with GHC 8.4.
|
||||
Using older versions of GHC (e.g. 8.2, 8.0 and 7.10) should still work too.
|
||||
|
||||
## Installing from the latest developer source code
|
||||
|
||||
If you haven't already, clone the repository with:
|
||||
|
||||
```
|
||||
git clone https://github.com/GrammaticalFramework/gf-core.git
|
||||
```
|
||||
|
||||
If you've already cloned the repository previously, update with:
|
||||
|
||||
```
|
||||
git pull
|
||||
```
|
||||
|
||||
Then install with:
|
||||
|
||||
```
|
||||
cabal install
|
||||
```
|
||||
|
||||
or, if you're a Stack user:
|
||||
|
||||
```
|
||||
stack install
|
||||
```
|
||||
|
||||
The above notes for installing from source apply also in these cases.
|
||||
For more info on working with the GF source code, see the
|
||||
[GF Developers Guide](../doc/gf-developers.html).
|
||||
|
||||
## Installing the RGL from source
|
||||
|
||||
To install the RGL from source,
|
||||
you can download a release from [GitHub](https://github.com/GrammaticalFramework/gf-rgl/releases)
|
||||
or get the latest version by cloning the repository:
|
||||
|
||||
```
|
||||
git clone https://github.com/GrammaticalFramework/gf-rgl.git
|
||||
```
|
||||
|
||||
In both cases, once you have the RGL sources you can install them by running:
|
||||
|
||||
```
|
||||
make
|
||||
```
|
||||
|
||||
in the RGL folder.
|
||||
For more details about building the RGL, see the [RGL README](https://github.com/GrammaticalFramework/gf-rgl/blob/master/README.md).
|
||||
|
||||
## Older releases
|
||||
|
||||
- [GF 3.9](index-3.9.html) (August 2017)
|
||||
- [GF 3.8](index-3.8.html) (June 2016)
|
||||
- [GF 3.7.1](index-3.7.1.html) (October 2015)
|
||||
- [GF 3.7](index-3.7.html) (June 2015)
|
||||
- [GF 3.6](index-3.6.html) (June 2014)
|
||||
- [GF 3.5](index-3.5.html) (August 2013)
|
||||
- [GF 3.4](index-3.4.html) (January 2013)
|
||||
- [GF 3.3.3](index-3.3.3.html) (March 2012)
|
||||
- [GF 3.3](index-3.3.html) (October 2011)
|
||||
- [GF 3.2.9](index-3.2.9.html) source-only snapshot (September 2011)
|
||||
- [GF 3.2](index-3.2.html) (December 2010)
|
||||
- [GF 3.1.6](index-3.1.6.html) (April 2010)
|
||||
@@ -5,13 +5,13 @@ GF Version 3.1.6 Release Notes
|
||||
=Installation=
|
||||
|
||||
The binaries now work out of the box for each platform and support
|
||||
completions (file names and parsing), because readline has been
|
||||
completions (file names and parsing), because readline has been
|
||||
changed to haskeline.
|
||||
|
||||
To compile from source, GHC 6.12 is now required. But GHC is not needed
|
||||
if the binary executables are used.
|
||||
|
||||
Binaries (``.gfo`` and ``.pgf`` files) compiled with GF 3.1 are incompatible
|
||||
Binaries (``.gfo`` and ``.pgf`` files) compiled with GF 3.1 are incompatible
|
||||
with 3.1.6 and must either be removed; alternatively, the ``-src`` flag can be
|
||||
used when compiling.
|
||||
|
||||
@@ -24,8 +24,8 @@ Grammar language
|
||||
- improved support for dependent types (see ``SUMO``, ``nqueens`` in ``examples``)
|
||||
|
||||
|
||||
Shell commands and options (see ``help`` in GF for more information)
|
||||
- ``eb``: example-based grammar file conversion
|
||||
Shell commands and options (see ``help`` in GF for more information)
|
||||
- ``eb``: example-based grammar file conversion
|
||||
(see ``examples/animals/QuestionI.gf``)
|
||||
- ``vd = visualize_dependency``: show dependency tree
|
||||
- ``vp = visualize_parse``: show parse tree
|
||||
@@ -57,8 +57,3 @@ Internal
|
||||
|
||||
Javascript generation is not updated to the new PGF format.
|
||||
[GF 3.1 old-index.html] should still be used for building Javascript applications.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
16
download/release-3.10.md
Normal file
@@ -0,0 +1,16 @@
|
||||
---
|
||||
title: GF 3.10 Release Notes
|
||||
date: 2 December 2018
|
||||
...
|
||||
|
||||
## Installation
|
||||
|
||||
See the [download page](index.html).
|
||||
|
||||
## What's new
|
||||
|
||||
- In this release, the GF "core" (compiler and runtimes) have been split from the RGL.
|
||||
|
||||
### Other
|
||||
|
||||
- A lot of repository cleanup
|
||||
@@ -1,9 +1,6 @@
|
||||
GF Version 3.2 Release Notes
|
||||
December 2010
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <H1> <H1><IMG src="../doc/Logos/gf0.png">
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -34,8 +31,3 @@ See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
|
||||
- GF compiler: GPL
|
||||
- Run-time libraries and Resource Grammar Library: LGPL + BSD
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF Version 3.3.3 Release Notes
|
||||
March 2012
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><IMG src="../doc/Logos/gf0.png">
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -25,8 +21,3 @@ See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
- Fix for a bug that prevented the shell commands ``abstract_info``,
|
||||
``generate_random`` and ``generate_trees`` from working properly.
|
||||
- Various other small improvements and bug fixes.
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
GF Version 3.3 Release Notes
|
||||
October 2011
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta name = "viewport" content = "width = device-width"><TITLE>
|
||||
%!postproc(html): <H1> <H1><IMG src="../doc/Logos/gf0.png">
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
|
||||
==New features==
|
||||
|
||||
- Source language extension: it is now possible to override the oper definitions in an interface, by using the
|
||||
- Source language extension: it is now possible to override the oper definitions in an interface, by using the
|
||||
header syntax ``instance Foo of Bar - [f,g,h]``.
|
||||
- New functionalities in GF shell commands (more information with ``help`` command-name).
|
||||
- ``aw`` = ``align_words`` option ``-giza`` prints word alignments in Giza++ format.
|
||||
@@ -29,8 +25,3 @@ See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
and the web-based grammar editor.
|
||||
- Faster grammar compilation (also included in the GF 3.2.9 source-only
|
||||
snapshot).
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF Version 3.4 Release Notes
|
||||
January 2013
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -46,8 +42,3 @@ See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
- Some new functionality in the web-based grammar editor, e.g. preliminary
|
||||
support for public grammars.
|
||||
- Various other small improvements and bug fixes.
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF 3.5 Release Notes
|
||||
August 2013
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -70,7 +66,3 @@ of GF 3.4.
|
||||
[``network-2.4.1.1`` https://github.com/haskell/network/commit/f2168b1f8978b4ad9c504e545755f0795ac869ce].
|
||||
- Various other small improvements and bug fixes.
|
||||
%- [...]
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF 3.6 Release Notes
|
||||
June 2014
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -26,7 +22,7 @@ Closed [issues http://code.google.com/p/grammatical-framework/issues/list]:
|
||||
as ``--# -coding=``//enc//, instead of ``flags coding=``//enc//.
|
||||
See the separate document
|
||||
[GF character encoding changes encoding-change.html] for more details.
|
||||
- Record update: in record objects (but not types) of form ``r ** s``, the values assigned
|
||||
- Record update: in record objects (but not types) of form ``r ** s``, the values assigned
|
||||
in ``s`` now overwrite those in ``r``. In previous versions, record extensions with
|
||||
overlapping assignments in ``r`` and ``s`` were not supported, and their behaviour was
|
||||
unpredictable.
|
||||
@@ -107,8 +103,3 @@ Closed [issues http://code.google.com/p/grammatical-framework/issues/list]:
|
||||
- ``c-wordforword``: this works as ``c-translate`` but does a
|
||||
word-for-word lookup to create a (potentially very low quality)
|
||||
translation that can be used if all else fails.
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF 3.7.1 Release Notes
|
||||
October 2015
|
||||
|
||||
%!style:../css/notes.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -18,10 +14,10 @@ Over 170 changes have been pushed to the source repository since
|
||||
|
||||
====New features and notable changes====
|
||||
|
||||
- GF shell: ``cc -trace`` (preliminary): you can now do things like
|
||||
|
||||
- GF shell: ``cc -trace`` (preliminary): you can now do things like
|
||||
|
||||
``cc -trace mkV "debug"``
|
||||
|
||||
|
||||
to see a trace of all opers with their arguments and results during the
|
||||
computation of ``mkV "debug"``.
|
||||
|
||||
@@ -29,7 +25,7 @@ Over 170 changes have been pushed to the source repository since
|
||||
from the GF shell by starting GF with ``gf -cshell`` or ``gf -crun``.
|
||||
Only limited functionality is available when running the shell in these
|
||||
modes (use the ``help`` command in the shell for details):
|
||||
|
||||
|
||||
- You can only import ``.pgf`` files, not source files.
|
||||
- The ``-retain`` flag can not be used and the commands that require it to
|
||||
work are not available.
|
||||
@@ -77,8 +73,3 @@ Over 170 changes have been pushed to the source repository since
|
||||
you can leave ``&+`` uninterpreted instead of gluing the adjacent tokens.
|
||||
This means that the output is left in a format that can be parsed in
|
||||
a subsequent request.
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF 3.7 Release Notes
|
||||
June 2015
|
||||
|
||||
%!style:../css/style.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -40,7 +36,7 @@ Over 800 changes have been pushed to the source repository since
|
||||
``BIND``, ``SOFT_BIND``, ``SOFT_SPACE``, ``CAPIT``, ``ALL_CAPIT`` and
|
||||
``nonExist``.
|
||||
- It is now possible to define callbacks for literals from the Haskell
|
||||
binding to the C runtime. This is used for instance in
|
||||
binding to the C runtime. This is used for instance in
|
||||
the Wide Coverage translator on the Web.
|
||||
|
||||
|
||||
@@ -103,8 +99,3 @@ Over 800 changes have been pushed to the source repository since
|
||||
unused for 24 hours, to keep memory use down in long running servers.
|
||||
- PGF service: limit the number of parallel calls to the C run-time parse
|
||||
function to 4 by default. The limit can be changed with the ``-j`` flag.
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF 3.8 Release Notes
|
||||
June 2016
|
||||
|
||||
%!style:../css/notes.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -25,7 +21,7 @@ Roughly 400 changes have been pushed to the source repository since
|
||||
[universal dependency http://universaldependencies.org/] diagrams
|
||||
in various formats, see ``help vd``.
|
||||
- The C runtime now includes an experimental library for managing
|
||||
and querying ontologies built on top of the abstract syntax of
|
||||
and querying ontologies built on top of the abstract syntax of
|
||||
a grammar. Since the ontology is based on an abstract syntax,
|
||||
it is language independent by design. For now the library is
|
||||
only used in the GF Offline Translator. The library uses
|
||||
@@ -100,7 +96,3 @@ Roughly 400 changes have been pushed to the source repository since
|
||||
translations in the domain they cover.
|
||||
You can change the order in which the selected grammars are tried
|
||||
by dragging them up and down in the list.
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
GF 3.9 Release Notes
|
||||
August 2017
|
||||
|
||||
%!style:../css/notes.css
|
||||
%!postproc(html): <TITLE> <meta charset="UTF-8"><meta name = "viewport" content = "width = device-width"> <TITLE>
|
||||
%!postproc(html): <H1> <H1><a href="../"><IMG src="../doc/Logos/gf0.png"></a>
|
||||
|
||||
==Installation==
|
||||
|
||||
See the [download page http://www.grammaticalframework.org/download/index.html].
|
||||
@@ -36,7 +32,7 @@ very innefficient for some grammars.
|
||||
|
||||
- A new .NET binding for the GF runtime is available.
|
||||
|
||||
- The API in the Java binding is extended and it covers more from
|
||||
- The API in the Java binding is extended and it covers more from
|
||||
the full functionality of the C runtime.
|
||||
|
||||
|
||||
@@ -66,8 +62,3 @@ the full functionality of the C runtime.
|
||||
|
||||
- PGF service: support for language-specific depencency configurations in
|
||||
``command=deptree``.
|
||||
|
||||
|
||||
--------------------
|
||||
|
||||
[www.grammaticalframework.org http://www.grammaticalframework.org]
|
||||
|
||||
BIN
favicon.ico
Normal file
|
After Width: | Height: | Size: 15 KiB |
32
gf.cabal
@@ -1,5 +1,5 @@
|
||||
name: gf
|
||||
version: 3.9-git
|
||||
version: 3.10
|
||||
|
||||
cabal-version: >= 1.22
|
||||
build-type: Custom
|
||||
@@ -11,7 +11,7 @@ description: GF, Grammatical Framework, is a programming language for multilingu
|
||||
homepage: http://www.grammaticalframework.org/
|
||||
bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
|
||||
maintainer: Thomas Hallgren
|
||||
tested-with: GHC==7.6.3, GHC==7.8.3, GHC==7.10.3, GHC==8.0.2
|
||||
tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3
|
||||
|
||||
data-dir: src
|
||||
data-files:
|
||||
@@ -42,7 +42,7 @@ data-files:
|
||||
custom-setup
|
||||
setup-depends:
|
||||
base,
|
||||
Cabal >=1.4.0.0,
|
||||
Cabal >=1.22.0.0,
|
||||
directory,
|
||||
filepath,
|
||||
process >=1.0.1.1
|
||||
@@ -67,11 +67,6 @@ flag network-uri
|
||||
-- Description: Make -new-comp the default
|
||||
-- Default: True
|
||||
|
||||
flag custom-binary
|
||||
Description: Use a customised version of the binary package
|
||||
Default: True
|
||||
Manual: True
|
||||
|
||||
flag c-runtime
|
||||
Description: Include functionality from the C run-time library (which must be installed already)
|
||||
Default: False
|
||||
@@ -89,17 +84,14 @@ Library
|
||||
exceptions
|
||||
hs-source-dirs: src/runtime/haskell
|
||||
|
||||
if flag(custom-binary)
|
||||
other-modules:
|
||||
-- not really part of GF but I have changed the original binary library
|
||||
-- and we have to keep the copy for now.
|
||||
Data.Binary
|
||||
Data.Binary.Put
|
||||
Data.Binary.Get
|
||||
Data.Binary.Builder
|
||||
Data.Binary.IEEE754
|
||||
else
|
||||
build-depends: binary, data-binary-ieee754
|
||||
other-modules:
|
||||
-- not really part of GF but I have changed the original binary library
|
||||
-- and we have to keep the copy for now.
|
||||
Data.Binary
|
||||
Data.Binary.Put
|
||||
Data.Binary.Get
|
||||
Data.Binary.Builder
|
||||
Data.Binary.IEEE754
|
||||
|
||||
--ghc-options: -fwarn-unused-imports
|
||||
--if impl(ghc>=7.8)
|
||||
@@ -149,7 +141,7 @@ Library
|
||||
|
||||
---- GF compiler as a library:
|
||||
|
||||
build-depends: filepath, directory, time, time-compat, old-locale,
|
||||
build-depends: filepath, directory, time, time-compat,
|
||||
process, haskeline, parallel>=3
|
||||
|
||||
hs-source-dirs: src/compiler
|
||||
|
||||
698
index.html
@@ -1,418 +1,379 @@
|
||||
<!DOCTYPE html>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>GF - Grammatical Framework</TITLE>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="css/newstyle.css" title="GF">
|
||||
<link rel="alternate" href="https://github.com/GrammaticalFramework/gf-core/" title="GF GitHub repository">
|
||||
<meta name = "viewport" content = "width = device-width">
|
||||
<script type="text/javascript">
|
||||
function sitesearch() {
|
||||
var q=document.forms[0].q.value;
|
||||
var site=" site:www.grammaticalframework.org";
|
||||
var search=encodeURIComponent(q+site)
|
||||
document.location.href="http://www.google.com/search?q="+search
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<meta name="keywords" content="machine translation">
|
||||
</HEAD>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<body class=new>
|
||||
<title>GF - Grammatical Framework</title>
|
||||
<meta name="keywords" content="machine translation">
|
||||
|
||||
<div class="header sky blue">
|
||||
<img class="gflogo" src="doc/Logos/gf1.svg" alt="">
|
||||
<H1>Grammatical Framework</H1>
|
||||
<small class=tagline>A programming language for multilingual grammar applications</small>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.2/css/all.css" integrity="sha384-/rXc/GQVaYpyDdyxK+ecHPVYJSN9bmVFBvjA/9eOB+pb3F2w2N6fc5qB9Ew5yIns" crossorigin="anonymous">
|
||||
|
||||
<link rel="alternate" href="https://github.com/GrammaticalFramework/gf-core/" title="GF GitHub repository">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container-fluid my-5" style="max-width:1200px">
|
||||
|
||||
<div class="text-center">
|
||||
<img style="height:250px" src="doc/Logos/gf1.svg" alt="GF Logo">
|
||||
<h1 class="display-4" style="text-shadow: 1px 1px 5px #999;">Grammatical Framework</h1>
|
||||
<h4 class="text-black-50">A programming language for multilingual grammar applications</h4>
|
||||
</div>
|
||||
|
||||
<div class=menu>
|
||||
<div class="row my-4">
|
||||
|
||||
<div class=links>
|
||||
<h4>Use GF</h4>
|
||||
<ul>
|
||||
<li><a href="http://cloud.grammaticalframework.org/">GF Cloud<img class=right src="src/www/P/gf-cloud.png" alt="GF Cloud Service" title="GF Cloud Service"></a>
|
||||
<li><A HREF="demos/index.html">Other Demos</A>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><A HREF="http://www.grammaticalframework.org/download/index.html"><b>Download GF</b></A>
|
||||
<li><a href="doc/gf-editor-modes.html">GF Editor Modes</a>
|
||||
</ul>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<h3>Get started</h3>
|
||||
<ul>
|
||||
<li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a></li>
|
||||
<li>
|
||||
<a href="http://cloud.grammaticalframework.org/">
|
||||
GF Cloud
|
||||
<img src="http://www.grammaticalframework.org/src/www/P/gf-cloud.png" style="height:30px" class="ml-2">
|
||||
</a>
|
||||
</li>
|
||||
<li><a href="doc/tutorial/gf-tutorial.html">Tutorial</a></li>
|
||||
</ul>
|
||||
|
||||
<ul>
|
||||
<li><A HREF="http://groups.google.com/group/gf-dev">User Group</A>
|
||||
<li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Bug Reports</a>
|
||||
(<a href="http://code.google.com/p/grammatical-framework/issues/list">old</a>)
|
||||
</ul>
|
||||
</div>
|
||||
<a href="download/index.html" class="btn btn-primary ml-3">
|
||||
<i class="fas fa-download mr-1"></i>
|
||||
Download GF
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class=links>
|
||||
<h4>Learn GF</h4>
|
||||
<ul>
|
||||
<li><a href="https://www.youtube.com/watch?v=x1LFbDQhbso">Google Tech Talk</a>
|
||||
<li><A HREF="doc/gf-quickstart.html">QuickStart</A>
|
||||
<li><A HREF="doc/gf-reference.html">QuickRefCard</A>
|
||||
<li><A HREF="doc/gf-shell-reference.html">GF Shell Reference</A>
|
||||
<li><a href="http://school.grammaticalframework.org/"><b>GF Summer School</b></a>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><A HREF="gf-book">The GF Book</A>
|
||||
<li><A HREF="doc/tutorial/gf-tutorial.html">GF Tutorial</A>
|
||||
<li><A HREF="doc/gf-refman.html">Reference Manual</A>
|
||||
<li><A HREF="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</A> <small>[PDF]</small>
|
||||
</ul>
|
||||
<ul>
|
||||
<li><A HREF="lib/doc/synopsis.html">Library Synopsis</A>
|
||||
<li><A HREF="doc/gf-lrec-2010.pdf">Library Tutorial</A> <small>[PDF]</small>
|
||||
<li><A HREF="http://www.postcrashgames.com/gf_world/">Coverage Map</A>
|
||||
</ul>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<h3>Learn more</h3>
|
||||
|
||||
</div>
|
||||
<div class=links>
|
||||
<h4>Develop GF</h4>
|
||||
<ul>
|
||||
<li><a href="doc/gf-developers.html">GF Developers Guide</a>
|
||||
<li><A HREF="https://github.com/GrammaticalFramework/">GF on GitHub</A>
|
||||
<li><a href="/~hallgren/gf-experiment/browse/">Browse Source Code</a>
|
||||
<li><A HREF="doc/gf-people.html">Authors</A>
|
||||
</ul>
|
||||
<h4>Develop Applications</h4>
|
||||
<ul>
|
||||
<li><a href="http://hackage.haskell.org/package/gf-3.9/docs/PGF.html">PGF library API (Old Runtime)</a>
|
||||
<li><a href="doc/runtime-api.html">PGF library API (New Runtime)</a>
|
||||
<li><a href="src/ui/android/README">GF on Android (new)</a>
|
||||
<li><A HREF="/android/">GF on Android (old) </A>
|
||||
</ul>
|
||||
</div>
|
||||
<div class=links>
|
||||
<h4>Related to GF</h4>
|
||||
<ul>
|
||||
<li><A HREF="doc/gf-bibliography.html">Publications</A>
|
||||
<li><A HREF="http://remu.grammaticalframework.org/">The REMU Project</A>
|
||||
<li><A HREF="http://www.molto-project.eu">The MOLTO Project</A>
|
||||
<li><a href="http://en.wikipedia.org/wiki/Grammatical_Framework">GF on Wikipedia</a>
|
||||
<li><p><a href="Http://www.digitalgrammars.com/">Digital Grammars AB</a>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
<li><a href="gf-book">The GF Book</a></li>
|
||||
<li><a href="doc/gf-refman.html">Reference Manual</a></li>
|
||||
<li><a href="doc/gf-shell-reference.html">Shell Reference</a></li>
|
||||
<li><a href="http://www.molto-project.eu/sites/default/files/MOLTO_D2.3.pdf">Best Practices</a> <small>[PDF]</small></li>
|
||||
</ul>
|
||||
|
||||
<a href="lib/doc/synopsis/index.html" class="btn btn-primary ml-3">
|
||||
<i class="fab fa-readme mr-1"></i>
|
||||
RGL Synopsis
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.write('<div style="float: right; margin-top: 3ex;"> <form onsubmit="return sitesearch()" method=get action="http://www.google.com/search"> <input type=search name="q" placeholder="site search"> <input type=submit value="Search"> </form></div>')
|
||||
</script>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<h3>Develop</h3>
|
||||
<ul>
|
||||
<li><a href="doc/gf-developers.html">Developers Guide</a></li>
|
||||
<!-- <li><a href="/~hallgren/gf-experiment/browse/">Browse Source Code</a></li> -->
|
||||
<li><a href="http://hackage.haskell.org/package/gf/docs/PGF.html">PGF library API (Haskell runtime)</a></li>
|
||||
<li><a href="doc/runtime-api.html">PGF library API (C runtime)</a></li>
|
||||
<li><a href="http://hackage.haskell.org/package/gf/docs/GF.html">GF compiler API</a></li>
|
||||
<!-- <li><a href="src/ui/android/README">GF on Android (new)</a></li>
|
||||
<li><a href="/android/">GF on Android (old) </a></li> -->
|
||||
<li><a href="doc/gf-editor-modes.html">Text Editor Support</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<H2 class=noclear>News</H2>
|
||||
|
||||
<div class=news2>
|
||||
|
||||
<table class=news>
|
||||
<tr><td>2018-07-25:<td>The GF repository has been split in two:
|
||||
<a href="https://github.com/GrammaticalFramework/gf-core">gf-core</a> and
|
||||
<a href="https://github.com/GrammaticalFramework/gf-rgl">gf-rgl</a>.
|
||||
The original <a href="https://github.com/GrammaticalFramework/GF">GF</a> repository is now archived.
|
||||
<tr><td>2017-08-11:<td><strong>GF 3.9 released!</strong>
|
||||
<a href="download/release-3.9.html">Release notes</a>.
|
||||
<tr><td>2017-06-29:<td>GF is moving to <a href="https://github.com/GrammaticalFramework/GF/">GitHub</a>!
|
||||
<tr><td>2017-03-13:<td><strong>GF Summer School in Riga (Latvia), 14-25 August 2017</strong>
|
||||
<a href="http://school.grammaticalframework.org/2017/">Summer
|
||||
School web page</a>.
|
||||
<tr><td>2016-09-07:<td><strong>Google Tech Talk on GF</strong> <a
|
||||
href="https://www.youtube.com/watch?v=x1LFbDQhbso">on Youtube</a>.
|
||||
<tr><td>2016-07-05:<td>GitHub mirror temporarily not updated, due to server migration.
|
||||
<tr><td>2016-06-22:<td><strong>GF 3.8 released!</strong>
|
||||
<a href="download/release-3.8.html">Release notes</a>.
|
||||
<tr><td>2015-06-21:<td><strong>Summer School in Rule-Based Machine
|
||||
Translation in Alacant/Alicante (Spain), 11-21 July 2016</strong>
|
||||
featuring GF, Apertium, Matxin, and TectoMT.
|
||||
<a href="http://xixona.dlsi.ua.es/rbmt-summer-school/2016/">Summer
|
||||
School web page</a>.
|
||||
<tr><td>2016-06-14:<td>New resource grammar language: Nynorsk.
|
||||
<tr><td>2015-10-02:<td><strong>GF 3.7.1 released!</strong>
|
||||
<a href="download/release-3.7.1.html">Release notes</a>.
|
||||
<tr><td>2015-06-25:<td><strong>GF 3.7 released!</strong>
|
||||
<a href="download/release-3.7.html">Release notes</a>.
|
||||
<tr><td>2015-03-13:<td>New resource grammar language: Mongolian.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2015-02-09:<td><strong>GF Summer School in Gozo (Malta), 13-24 July 2015</strong>
|
||||
<a href="http://school.grammaticalframework.org/2015/">Summer
|
||||
School web page</a>.
|
||||
<tr><td>2014-06-23:<td><strong>GF 3.6 released!</strong>
|
||||
<a href="download/release-3.6.html">Release notes</a>.
|
||||
<tr><td>2014-03-11:
|
||||
<td>A company for commercial applications of GF has been founded:
|
||||
<a href="http://www.digitalgrammars.com/">Digital Grammars</a>.
|
||||
<tr><td>2013-11-25:
|
||||
<td>The default character encoding in GF grammar files will be changed
|
||||
from Latin-1 to UTF-8. See
|
||||
<a href="download/encoding-change.html">GF character encoding changes</a>
|
||||
for details.
|
||||
<tr><td>2013-10-18:<td>New resource grammar language: Estonian.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2013-09-18:<td>New <a href="https://github.com/GrammaticalFramework/gf-contrib">GF contributions repository</a>, hosted on GitHub.
|
||||
<tr><td>2013-08-06:<td><strong>GF 3.5 released!</strong>
|
||||
<a href="download/release-3.5.html">Release notes</a>.
|
||||
<tr><td>2013-07-26:<td>Started a page with <A HREF="lib/doc/rgl-publications.html">RGL Documentation and Publications</A>.
|
||||
<tr><td>2013-06-24:<td>We are now running the IRC channel <a href="https://webchat.freenode.net/?channels=gf"><strong><code>#gf</code></strong></a> on the Freenode network.
|
||||
<tr><td>2013-06-19:<td>New resource grammar language: Maltese.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2013-04-25:<td>New resource grammar language: Greek.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2013-01-31:<td><strong>GF 3.4 released!</strong>
|
||||
<a href="download/release-3.4.html">Release notes</a>.
|
||||
<tr><td>2012-12-10:<td>
|
||||
<a href="http://www.postcrashgames.com/gf_world/">Resource Grammar Library
|
||||
coverage map</a>, created by Tommi Nieminen.
|
||||
<!--
|
||||
<tr><td>2012-11-18:<td>
|
||||
<A HREF="http://school.grammaticalframework.org/2013">GF Summer School</A>
|
||||
in Frauenchiemsee, 18-30 August 2013.
|
||||
<tr><td>2012-11-18:<td>New resource grammar language: Chinese.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
Complete but not yet perfect.
|
||||
<tr><td>2012-06-29:<td>GF sources now mirrored in GitHub, with change
|
||||
statistics and other browsing features.
|
||||
See <a href="https://github.com/GrammaticalFramework/GF/"><tt>github.com/GrammaticalFramework/GF</tt></a>
|
||||
<tr><td>2012-05-07:<td>New resource grammar language: Japanese.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2012-03-23:<td>There will be a
|
||||
<a href="gf-tutorial-icfp-2012/">GF tutorial at ICFP 2012</a>
|
||||
in Copenhagen.
|
||||
<tr><td>2012-03-03:<td><strong>GF 3.3.3 released!</strong>
|
||||
<a href="download/release-3.3.3.html">Release notes</a>.
|
||||
<tr><td>2012-02-24:<td>New resource grammar languages: Hindi, Sindhi.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2011-12-29:<td>New resource grammar languages: Latvian, Thai.
|
||||
See <a href="lib/doc/synopsis.html">library synopsis</a>.
|
||||
<tr><td>2011-10-27:<td><strong>GF 3.3 released!</strong>
|
||||
<a href="download/release-3.3.html">Release notes</a>.
|
||||
<tr><td>2011-09-20:<td>There is now a page collecting
|
||||
<a href="doc/gf-editor-modes.html">editor modes for GF</a>.
|
||||
Contributions are welcome!
|
||||
<tr><td>2011-09-12:<td><strong>GF 3.2.9</strong> source snapshot with faster grammar compilation available. See <a href="download/index.html">Downloads</a>.
|
||||
<tr><td>2011-04-22:<td><a href="android/tutorial/">JPGF Android Tutorial</a> added.
|
||||
<tr><td>2011-04-15:<td>The <a href="gf-book">GF Book</a> is available.
|
||||
<tr><td>2011-01-13:<td><a href="http://www.molto-project.eu/node/1177">Phrasedroid
|
||||
available on the Android Market</a>.
|
||||
<tr><td>2011-01-04:<td>GF is part of the
|
||||
<a href="http://www.clt.gu.se/clt-toolkit">CLT Toolkit</a>.
|
||||
<tr><td>2010-12-23:<td><strong>GF 3.2 released!</strong>
|
||||
<a href="download/release-3.2.html">Release notes</a>.
|
||||
-->
|
||||
</table>
|
||||
<div class="col-sm-6 col-md-3">
|
||||
<h3>Contribute</h3>
|
||||
<ul>
|
||||
<li><a href="http://groups.google.com/group/gf-dev">Mailing List</a></li>
|
||||
<li><a href="https://github.com/GrammaticalFramework/gf-core/issues">Issue Tracker</a></li>
|
||||
<li><a href="doc/gf-people.html">Authors</a></li>
|
||||
<li><a href="http://school.grammaticalframework.org/2018/">Summer School</a></li>
|
||||
</ul>
|
||||
<a href="https://github.com/GrammaticalFramework/" class="btn btn-primary ml-3">
|
||||
<i class="fab fa-github mr-1"></i>
|
||||
GF on GitHub
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<H2>What is GF</H2>
|
||||
<P>
|
||||
<h2>What is GF?</h2>
|
||||
<p>
|
||||
GF, Grammatical Framework, is a programming language for
|
||||
<B>multilingual grammar applications</B>. It is
|
||||
</P>
|
||||
<UL>
|
||||
<LI>a <B>special-purpose language for grammars</B>, like
|
||||
<strong>multilingual grammar applications</strong>. It is
|
||||
</p>
|
||||
<ul>
|
||||
<li>a <strong>special-purpose language for grammars</strong>, like
|
||||
<a href="http://dinosaur.compilertools.net/yacc/">YACC</a>,
|
||||
<a href="http://www.gnu.org/software/bison/">Bison</a>,
|
||||
<a href="http://www.haskell.org/happy/">Happy</a>,
|
||||
<a href="http://bnfc.digitalgrammars.com/">BNFC</a>,
|
||||
but not restricted to programming languages
|
||||
<LI>a <B>functional programming language</B>, like
|
||||
</li>
|
||||
<li>a <strong>functional programming language</strong>, like
|
||||
<a href="http://www.haskell.org/">Haskell</a>,
|
||||
<a href="http://en.wikipedia.org/wiki/Lisp_(programming_language)">Lisp</a>,
|
||||
<a href="http://ocaml.org/">OCaml</a>,
|
||||
<a href="http://www.smlnj.org/">SML</a>,
|
||||
<a href="http://schemers.org/">Scheme</a>,
|
||||
but specialized to grammar writing
|
||||
<LI>a <B>development platform for natural language grammars</B>, like
|
||||
</li>
|
||||
<li>a <strong>development platform for natural language grammars</strong>, like
|
||||
<a href="http://moin.delph-in.net/LkbTop">LKB</a>,
|
||||
<a href="http://www2.parc.com/isl/groups/nltt/xle/">XLE</a>,
|
||||
<a href="http://www.issco.unige.ch/en/research/projects/regulus/news.shtml">Regulus</a>,
|
||||
but based on functional programming and type theory
|
||||
<LI>a <B>categorial grammar formalism</B>, like
|
||||
</li>
|
||||
<li>a <strong>categorial grammar formalism</strong>, like
|
||||
<a href="http://www.loria.fr/equipes/calligramme/acg/">ACG</a>,
|
||||
<a href="http://openccg.sourceforge.net/">CCG</a>,
|
||||
but specialized for multilingual grammars,
|
||||
<LI>a <B>logical framework</B>, like
|
||||
</li>
|
||||
<li>a <strong>logical framework</strong>, like
|
||||
<a href="http://wiki.portal.chalmers.se/agda/pmwiki.php">Agda</a>,
|
||||
<a href="http://coq.inria.fr/">Coq</a>,
|
||||
<a href="http://www.cl.cam.ac.uk/research/hvg/Isabelle/">Isabelle</a>,
|
||||
but equipped with concrete syntax in addition to logic
|
||||
<li>a <b>platform for machine translation</b>, like
|
||||
</li>
|
||||
<li>a <strong>platform for machine translation</strong>, like
|
||||
<a href="http://www.statmt.org/moses/">Moses</a>,
|
||||
<a href="http://www.apertium.org/">Apertium</a>,
|
||||
but based on deep structural analysis (and usually applied for
|
||||
limited fragments of language).
|
||||
</UL>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<P>
|
||||
<p>
|
||||
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.
|
||||
</P>
|
||||
<H2>Applications</H2>
|
||||
<P>
|
||||
GF can be used for building
|
||||
</P>
|
||||
<UL>
|
||||
<LI><A HREF="http://cloud.grammaticalframework.org/translator/">translation systems</A>
|
||||
<LI><A HREF="http://cloud.grammaticalframework.org/minibar/minibar.html">multilingual web gadgets</A>
|
||||
<LI><A HREF="http://www.cs.chalmers.se/~hallgren/Alfa/Tutorial/GFplugin.html">natural-language interfaces</A>
|
||||
<LI><A HREF="http://www.youtube.com/watch?v=1bfaYHWS6zU">dialogue systems</A>
|
||||
<LI><A HREF="lib/doc/synopsis.html">natural language resources</A>
|
||||
</UL>
|
||||
|
||||
<H2>Availability</H2>
|
||||
<P>
|
||||
GF is <B>open-source</B>, licensed under <A HREF="LICENSE">GPL</A> (the program) and
|
||||
<A HREF="./LICENSE">LGPL</A> and <A HREF="./LICENSE">BSD</A> (the libraries). It
|
||||
is available for
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Linux
|
||||
<LI>Mac OS X
|
||||
<LI>Windows
|
||||
<li>Android mobile platform (via Java; runtime)
|
||||
<LI>via compilation to JavaScript, almost any platform that has a web browser (runtime)
|
||||
</UL>
|
||||
|
||||
<H2>Projects</H2>
|
||||
<P>
|
||||
GF was first created in 1998 at
|
||||
<A HREF="http://www.xrce.xerox.com/">Xerox Research Centre Europe</A>,
|
||||
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.
|
||||
</P>
|
||||
<P>
|
||||
Later projects using GF and involving third parties include, in chronological order,
|
||||
</P>
|
||||
<UL>
|
||||
<LI><A HREF="http://www.cs.chalmers.se/~hallgren/Alfa/Tutorial/GFplugin.html">GF-Alfa</A>:
|
||||
natural language interface to formal proofs
|
||||
<LI><A HREF="http://efficient.citi.tudor.lu/index_noframe.html">Efficient</A>:
|
||||
authoring tool for business models.
|
||||
<LI><A HREF="http://www.key-project.org/">GF-KeY</A>:
|
||||
authoring and translation of software specifications
|
||||
<LI><A HREF="http://www.talk-project.org">TALK</A>:
|
||||
multilingual and multimodal spoken dialogue systems
|
||||
<LI><A HREF="http://webalt.math.helsinki.fi/">WebALT</A>:
|
||||
multilingual generation of mathematical exercises (commercial project)
|
||||
<LI><A HREF="http://spraakbanken.gu.se/sal/">SALDO</A>:
|
||||
Swedish morphological dictionary based on rules developed for GF and
|
||||
<A HREF="http://www.cse.chalmers.se/alumni/markus/FM/">Functional Morphology</A>
|
||||
<LI><a href="http://www.molto-project.eu">MOLTO</a>:
|
||||
multilingual online translation
|
||||
<LI><a href="http://remu.grammaticalframework.org">REMU</a>:
|
||||
reliable multilingual digital communication.
|
||||
</UL>
|
||||
<p>
|
||||
Here is a <a
|
||||
href="http://videos.xrce.xerox.com/index.php/videos/index/618">talk
|
||||
about GF at XRCE</a>,
|
||||
14 years later.
|
||||
|
||||
<P>
|
||||
Academically, GF has been used in at least ten PhD theses and resulted
|
||||
in more than a hundred
|
||||
scientific publications (see <A HREF="doc/gf-bibliography.html">GF publication list</A>).
|
||||
</P>
|
||||
<H2>Programming in GF</H2>
|
||||
<P>
|
||||
GF is easy to learn by following the <A HREF="doc/tutorial/gf-tutorial.html">tutorial</A>.
|
||||
You can write your first translator in 15 minutes.
|
||||
</P>
|
||||
<P>
|
||||
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:
|
||||
</P>
|
||||
<UL>
|
||||
<LI>Haskell
|
||||
<li>Java, in particular the Android platform
|
||||
<LI>JavaScript
|
||||
<LI>Speech recognition: HTK/ATK, Nuance, JSGF
|
||||
</UL>
|
||||
|
||||
<P>
|
||||
The GF programming language is high-level and advanced, featuring
|
||||
</P>
|
||||
<UL>
|
||||
<LI>static type checking
|
||||
<LI>higher-order functions
|
||||
<LI>dependent types
|
||||
<LI>pattern matching with data constructors and regular expressions
|
||||
<LI>module system with multiple inheritance and parametrized modules
|
||||
</UL>
|
||||
|
||||
<h3>Getting help</h3>
|
||||
<p>
|
||||
If you need some help with GF, the first places to start are the <a href="doc/tutorial/gf-tutorial.html">Tutorial</a> and <a href="doc/gf-refman.html">Reference</a> pages.
|
||||
The printed <a href="gf-book">book</a> contains all the material in the tutorial and some extra bits, and is the recommended reference for GF.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We run the IRC channel <strong><code>#gf</code></strong> on the Freenode network, where you are welcome to look for help with small questions or just start a general discussion.
|
||||
IRC logs (in raw format) are available <a href="irc/">here</a>.
|
||||
If you have a larger question which the community may benefit from, we recommend you ask it on the <a href="http://groups.google.com/group/gf-dev">mailing list</a>.
|
||||
</p>
|
||||
<hr>
|
||||
|
||||
<H2>Libraries</H2>
|
||||
<P>
|
||||
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
|
||||
<A HREF="lib/doc/synopsis.html">GF resource grammar library</A> has
|
||||
support for an increasing number of languages, currently including
|
||||
</P>
|
||||
<ol class=languages>
|
||||
<LI>Afrikaans
|
||||
<LI>Amharic (partial)
|
||||
<LI>Arabic (partial)
|
||||
<LI>Bulgarian
|
||||
<LI>Catalan
|
||||
<LI>Chinese
|
||||
<LI>Danish
|
||||
<LI>Dutch
|
||||
<LI>English
|
||||
<LI>Estonian
|
||||
<LI>Finnish
|
||||
<LI>French
|
||||
<LI>German
|
||||
<li>Greek ancient (partial)
|
||||
<li>Greek modern
|
||||
<li>Hebrew (fragments)
|
||||
<LI>Hindi
|
||||
<LI><A HREF="http://www.interlingua.com/">Interlingua</A>
|
||||
<LI>Japanese
|
||||
<LI>Italian
|
||||
<LI>Latin (fragments)
|
||||
<LI>Latvian
|
||||
<li>Maltese
|
||||
<li>Mongolian
|
||||
<LI>Nepali
|
||||
<LI>Norwegian bokmål
|
||||
<LI>Norwegian nynorsk
|
||||
<LI>Persian
|
||||
<LI>Polish
|
||||
<li>Punjabi
|
||||
<LI>Romanian
|
||||
<LI>Russian
|
||||
<LI>Sindhi
|
||||
<LI>Slovene (partial)
|
||||
<LI>Spanish
|
||||
<li>Swahili (fragments)
|
||||
<LI>Swedish
|
||||
<LI>Thai
|
||||
<LI>Turkish (fragments)
|
||||
<LI>Urdu
|
||||
</ol>
|
||||
<div class="row">
|
||||
|
||||
<P>
|
||||
Adding a language to the resource library takes 3 to 9
|
||||
months - contributions
|
||||
are welcome! You can start with the <A HREF="doc/gf-lrec-2010.pdf">resource grammarian's tutorial</A>.
|
||||
<div class="col-md-6">
|
||||
<h2>Applications & Availability</h2>
|
||||
<p>
|
||||
GF can be used for building
|
||||
<a href="http://cloud.grammaticalframework.org/translator/">translation systems</a>,
|
||||
<a href="http://cloud.grammaticalframework.org/minibar/minibar.html">multilingual web gadgets</a>,
|
||||
<a href="http://www.cs.chalmers.se/~hallgren/Alfa/Tutorial/GFplugin.html">natural-language interfaces</a>,
|
||||
<a href="http://www.youtube.com/watch?v=1bfaYHWS6zU">dialogue systems</a>, and
|
||||
<a href="lib/doc/synopsis/index.html">natural language resources</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
GF is <strong>open-source</strong>, licensed under <a href="LICENSE">GPL</a> (the program) and
|
||||
<a href="LICENSE">LGPL</a> and <a href="LICENSE">BSD</a> (the libraries). It
|
||||
is available for
|
||||
</p>
|
||||
<ul>
|
||||
<li>Linux</li>
|
||||
<li>macOS</li>
|
||||
<li>Windows</li>
|
||||
<li>Android mobile platform (via Java; runtime)</li>
|
||||
<li>via compilation to JavaScript, almost any platform that has a web browser (runtime)</li>
|
||||
</ul>
|
||||
|
||||
<h2>Programming in GF</h2>
|
||||
<p>
|
||||
GF is easy to learn by following the <a href="doc/tutorial/gf-tutorial.html">tutorial</a>.
|
||||
You can write your first translator in 15 minutes.
|
||||
</p>
|
||||
<p>
|
||||
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:
|
||||
</p>
|
||||
<ul>
|
||||
<li>Haskell</li>
|
||||
<li>Java, in particular the Android platform</li>
|
||||
<li>JavaScript</li>
|
||||
<li>Speech recognition: HTK/ATK, Nuance, JSGF</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
The GF programming language is high-level and advanced, featuring:
|
||||
</p>
|
||||
<ul>
|
||||
<li>static type checking</li>
|
||||
<li>higher-order functions</li>
|
||||
<li>dependent types</li>
|
||||
<li>pattern matching with data constructors and regular expressions</li>
|
||||
<li>module system with multiple inheritance and parametrized modules</li>
|
||||
</ul>
|
||||
|
||||
<h3>Getting help</h3>
|
||||
<p>
|
||||
If you need some help with GF, the first places to start are the <a href="doc/tutorial/gf-tutorial.html">Tutorial</a> and <a href="doc/gf-refman.html">Reference</a> pages.
|
||||
The printed <a href="gf-book">book</a> contains all the material in the tutorial and some extra bits, and is the recommended reference for GF.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
We run the IRC channel <strong><code>#gf</code></strong> on the Freenode network, where you are welcome to look for help with small questions or just start a general discussion.
|
||||
IRC logs (in raw format) are available <a href="http://www.grammaticalframework.org/irc/">here</a>.
|
||||
If you have a larger question which the community may benefit from, we recommend you ask it on the <a href="http://groups.google.com/group/gf-dev">mailing list</a>.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<h2>News</h2>
|
||||
|
||||
<dl class="row">
|
||||
<dt class="col-sm-3 text-center text-nowrap">2018-12-03</dt>
|
||||
<dd class="col-sm-9">
|
||||
<a href="http://school.grammaticalframework.org/2018/">Sixth GF Summer School</a> in Stellenbosch (South Africa), 3–14 December 2018
|
||||
</dd>
|
||||
<dt class="col-sm-3 text-center text-nowrap">2018-12-02</dt>
|
||||
<dd class="col-sm-9">
|
||||
<strong>GF 3.10 released.</strong>
|
||||
<!-- <a href="download/release-3.10.html">Release notes</a> -->
|
||||
</dd>
|
||||
<dt class="col-sm-3 text-center text-nowrap">2018-07-25</dt>
|
||||
<dd class="col-sm-9">
|
||||
The GF repository has been split in two:
|
||||
<a href="https://github.com/GrammaticalFramework/gf-core">gf-core</a> and
|
||||
<a href="https://github.com/GrammaticalFramework/gf-rgl">gf-rgl</a>.
|
||||
The original <a href="https://github.com/GrammaticalFramework/GF">GF</a> repository is now archived.
|
||||
</dd>
|
||||
<dt class="col-sm-3 text-center text-nowrap">2017-08-11</dt>
|
||||
<dd class="col-sm-9">
|
||||
<strong>GF 3.9 released.</strong>
|
||||
<a href="download/release-3.9.html">Release notes</a>
|
||||
</dd>
|
||||
<dt class="col-sm-3 text-center text-nowrap">2017-06-29</dt>
|
||||
<dd class="col-sm-9">
|
||||
GF is moving to <a href="https://github.com/GrammaticalFramework/GF/">GitHub</a>.</dd>
|
||||
<dt class="col-sm-3 text-center text-nowrap">2017-03-13</dt>
|
||||
<dd class="col-sm-9">
|
||||
<a href="http://school.grammaticalframework.org/2017/">GF Summer School</a> in Riga (Latvia), 14-25 August 2017
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<h2>Projects</h2>
|
||||
<p>
|
||||
GF was first created in 1998 at
|
||||
<a href="http://www.xrce.xerox.com/">Xerox Research Centre Europe</a>,
|
||||
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.
|
||||
</p>
|
||||
<p>
|
||||
Later projects using GF and involving third parties include, in chronological order:
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="http://www.cs.chalmers.se/~hallgren/Alfa/Tutorial/GFplugin.html">GF-Alfa</a>:
|
||||
natural language interface to formal proofs
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://efficient.citi.tudor.lu/index_noframe.html">Efficient</a>:
|
||||
authoring tool for business models.
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://www.key-project.org/">GF-KeY</a>:
|
||||
authoring and translation of software specifications
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://www.talk-project.org">TALK</a>:
|
||||
multilingual and multimodal spoken dialogue systems
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://webalt.math.helsinki.fi/">WebALT</a>:
|
||||
multilingual generation of mathematical exercises (commercial project)
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://spraakbanken.gu.se/sal/">SALDO</a>:
|
||||
Swedish morphological dictionary based on rules developed for GF and
|
||||
<a href="http://www.cse.chalmers.se/alumni/markus/FM/">Functional Morphology</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://www.molto-project.eu">MOLTO</a>:
|
||||
multilingual online translation
|
||||
</li>
|
||||
<li>
|
||||
<a href="http://remu.grammaticalframework.org">REMU</a>:
|
||||
reliable multilingual digital communication
|
||||
</li>
|
||||
</ul>
|
||||
<!-- <p>
|
||||
Here is a <a
|
||||
href="http://videos.xrce.xerox.com/index.php/videos/index/618">talk
|
||||
about GF at XRCE</a>,
|
||||
14 years later.
|
||||
</p> -->
|
||||
|
||||
<p>
|
||||
Academically, GF has been used in at least ten PhD theses and resulted
|
||||
in more than a hundred scientific publications.
|
||||
<!-- (see <a href="doc/gf-bibliography.html">GF publication list</a>). -->
|
||||
</p>
|
||||
|
||||
<h2>Libraries</h2>
|
||||
<p>
|
||||
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
|
||||
<a href="lib/doc/synopsis/index.html">GF resource grammar library</a> has
|
||||
support for an increasing number of languages, currently including
|
||||
Afrikaans,
|
||||
Amharic (partial),
|
||||
Arabic (partial),
|
||||
Bulgarian,
|
||||
Catalan,
|
||||
Chinese,
|
||||
Danish,
|
||||
Dutch,
|
||||
English,
|
||||
Estonian,
|
||||
Finnish,
|
||||
French,
|
||||
German,
|
||||
Greek ancient (partial),
|
||||
Greek modern,
|
||||
Hebrew (fragments),
|
||||
Hindi,
|
||||
Interlingua,
|
||||
Japanese,
|
||||
Italian,
|
||||
Latin (fragments),
|
||||
Latvian,
|
||||
Maltese,
|
||||
Mongolian,
|
||||
Nepali,
|
||||
Norwegian bokmål,
|
||||
Norwegian nynorsk,
|
||||
Persian,
|
||||
Polish,
|
||||
Punjabi,
|
||||
Romanian,
|
||||
Russian,
|
||||
Sindhi,
|
||||
Slovene (partial),
|
||||
Spanish,
|
||||
Swahili (fragments),
|
||||
Swedish,
|
||||
Thai,
|
||||
Turkish (fragments),
|
||||
Urdu
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Adding a language to the resource library takes 3 to 9
|
||||
months - contributions
|
||||
are welcome! You can start with the <a href="doc/gf-lrec-2010.pdf">resource grammarian's tutorial</a>.
|
||||
</p>
|
||||
|
||||
</div><!-- .col-6 -->
|
||||
|
||||
</div><!-- .row -->
|
||||
|
||||
</div><!-- .container -->
|
||||
|
||||
<footer class="bg-light mt-5 py-5">
|
||||
<div class="container mb-5">
|
||||
<div class="row">
|
||||
<div>
|
||||
<div>
|
||||
</footer>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
||||
@@ -423,5 +384,6 @@ try {
|
||||
var pageTracker = _gat._getTracker("UA-7811807-3");
|
||||
pageTracker._trackPageview();
|
||||
} catch(err) {}</script>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -373,8 +373,6 @@ optDescr =
|
||||
"Enable or disable global grammar optimization. This could significantly reduce the size of the final PGF file",
|
||||
Option [] ["split-pgf"] (NoArg (splitPGF True))
|
||||
"Split the PGF into one file per language. This allows the runtime to load only individual languages",
|
||||
Option [] ["stem"] (onOff (toggleOptimize OptStem) True) "Perform stem-suffix analysis (default on).",
|
||||
Option [] ["cse"] (onOff (toggleOptimize OptCSE) True) "Perform common sub-expression elimination (default on).",
|
||||
Option [] ["cfg"] (ReqArg cfgTransform "TRANS") "Enable or disable specific CFG transformations. TRANS = merge, no-merge, bottomup, no-bottomup, ...",
|
||||
Option [] ["heuristic_search_factor"] (ReqArg (readDouble (\d o -> o { optHeuristicFactor = Just d })) "FACTOR") "Set the heuristic search factor for statistical parsing",
|
||||
Option [] ["case_sensitive"] (onOff (\v -> set $ \o -> o{optCaseSensitive=v}) True) "Set the parser in case-sensitive/insensitive mode [sensitive by default]",
|
||||
@@ -448,8 +446,6 @@ optDescr =
|
||||
optimize_pgf x = set $ \o -> o { optOptimizePGF = x }
|
||||
splitPGF x = set $ \o -> o { optSplitPGF = x }
|
||||
|
||||
toggleOptimize x b = set $ setOptimization' x b
|
||||
|
||||
cfgTransform x = let (x', b) = case x of
|
||||
'n':'o':'-':rest -> (rest, False)
|
||||
_ -> (x, True)
|
||||
|
||||
@@ -23,7 +23,7 @@ import GF.System.Console (setConsoleEncoding)
|
||||
-- Run @gf --help@ for usage info.
|
||||
main :: IO ()
|
||||
main = do
|
||||
setConsoleEncoding
|
||||
--setConsoleEncoding
|
||||
uncurry mainOpts =<< getOptions
|
||||
|
||||
-- | Get and parse GF command line arguments. Fix relative paths.
|
||||
|
||||
@@ -57,7 +57,7 @@ pgfToCFG pgf lang = mkCFG (showCId (lookStartCat pgf)) extCats (startRules ++ co
|
||||
|
||||
topdownRules cat = f cat []
|
||||
where
|
||||
f cat rules = maybe rules (Set.fold g rules) (IntMap.lookup cat (productions cnc))
|
||||
f cat rules = maybe rules (Set.foldr g rules) (IntMap.lookup cat (productions cnc))
|
||||
|
||||
g (PApply funid args) rules = (cncfuns cnc ! funid,args) : rules
|
||||
g (PCoerce cat) rules = f cat rules
|
||||
|
||||
@@ -1,489 +0,0 @@
|
||||
{-# LANGUAGE FlexibleInstances, FlexibleContexts #-}
|
||||
-- | This is a layer on top of "Data.Binary" with its own 'Binary' class
|
||||
-- and customised instances for 'Word', 'Int' and 'Double'.
|
||||
-- The 'Int' and 'Word' instance use a variable-length encoding to save space
|
||||
-- for small numbers. The 'Double' instance uses the standard IEEE754 encoding.
|
||||
module PGF.Data.Binary (
|
||||
|
||||
-- * The Binary class
|
||||
Binary(..)
|
||||
|
||||
-- * The Get and Put monads
|
||||
, Get , Put, runPut
|
||||
|
||||
-- * Useful helpers for writing instances
|
||||
, putWord8 , getWord8 , putWord16be , getWord16be
|
||||
|
||||
-- * Binary serialisation
|
||||
, encode , decode
|
||||
|
||||
-- * IO functions for serialisation
|
||||
, encodeFile , decodeFile
|
||||
|
||||
, encodeFile_ , decodeFile_
|
||||
|
||||
-- * Useful
|
||||
, Word8, Word16
|
||||
|
||||
) where
|
||||
|
||||
|
||||
import Data.Word
|
||||
|
||||
import qualified Data.Binary as Bin
|
||||
import Data.Binary.Put
|
||||
import Data.Binary.Get
|
||||
import Data.Binary.IEEE754 ( putFloat64be, getFloat64be)
|
||||
import Control.Monad
|
||||
import Control.Exception
|
||||
import Foreign
|
||||
import System.IO
|
||||
|
||||
import Data.ByteString.Lazy (ByteString)
|
||||
import qualified Data.ByteString.Lazy as L
|
||||
|
||||
--import Data.Char (chr,ord)
|
||||
--import Data.List (unfoldr)
|
||||
|
||||
-- And needed for the instances:
|
||||
import qualified Data.ByteString as B
|
||||
import qualified Data.Map as Map
|
||||
import qualified Data.Set as Set
|
||||
import qualified Data.IntMap as IntMap
|
||||
import qualified Data.IntSet as IntSet
|
||||
--import qualified Data.Ratio as R
|
||||
|
||||
--import qualified Data.Tree as T
|
||||
|
||||
import Data.Array.Unboxed
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
-- | The @Binary@ class provides 'put' and 'get', methods to encode and
|
||||
-- decode a Haskell value to a lazy ByteString. It mirrors the Read and
|
||||
-- Show classes for textual representation of Haskell types, and is
|
||||
-- suitable for serialising Haskell values to disk, over the network.
|
||||
--
|
||||
-- For parsing and generating simple external binary formats (e.g. C
|
||||
-- structures), Binary may be used, but in general is not suitable
|
||||
-- for complex protocols. Instead use the Put and Get primitives
|
||||
-- directly.
|
||||
--
|
||||
-- Instances of Binary should satisfy the following property:
|
||||
--
|
||||
-- > decode . encode == id
|
||||
--
|
||||
-- That is, the 'get' and 'put' methods should be the inverse of each
|
||||
-- other. A range of instances are provided for basic Haskell types.
|
||||
--
|
||||
class Binary t where
|
||||
-- | Encode a value in the Put monad.
|
||||
put :: t -> Put
|
||||
-- | Decode a value in the Get monad
|
||||
get :: Get t
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Wrappers to run the underlying monad
|
||||
|
||||
-- | Encode a value using binary serialisation to a lazy ByteString.
|
||||
--
|
||||
encode :: Binary a => a -> ByteString
|
||||
encode = runPut . put
|
||||
{-# INLINE encode #-}
|
||||
|
||||
-- | Decode a value from a lazy ByteString, reconstructing the original structure.
|
||||
--
|
||||
decode :: Binary a => ByteString -> a
|
||||
decode = runGet get
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Convenience IO operations
|
||||
|
||||
-- | Lazily serialise a value to a file
|
||||
--
|
||||
-- This is just a convenience function, it's defined simply as:
|
||||
--
|
||||
-- > encodeFile f = B.writeFile f . encode
|
||||
--
|
||||
-- So for example if you wanted to compress as well, you could use:
|
||||
--
|
||||
-- > B.writeFile f . compress . encode
|
||||
--
|
||||
encodeFile :: Binary a => FilePath -> a -> IO ()
|
||||
encodeFile f v = L.writeFile f (encode v)
|
||||
|
||||
encodeFile_ :: FilePath -> Put -> IO ()
|
||||
encodeFile_ f m = L.writeFile f (runPut m)
|
||||
|
||||
-- | Lazily reconstruct a value previously written to a file.
|
||||
--
|
||||
-- This is just a convenience function, it's defined simply as:
|
||||
--
|
||||
-- > decodeFile f = return . decode =<< B.readFile f
|
||||
--
|
||||
-- So for example if you wanted to decompress as well, you could use:
|
||||
--
|
||||
-- > return . decode . decompress =<< B.readFile f
|
||||
--
|
||||
decodeFile :: Binary a => FilePath -> IO a
|
||||
decodeFile f = bracket (openBinaryFile f ReadMode) hClose $ \h -> do
|
||||
s <- L.hGetContents h
|
||||
evaluate $ runGet get s
|
||||
|
||||
decodeFile_ :: FilePath -> Get a -> IO a
|
||||
decodeFile_ f m = bracket (openBinaryFile f ReadMode) hClose $ \h -> do
|
||||
s <- L.hGetContents h
|
||||
evaluate $ runGet m s
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- For ground types, the standard instances can be reused,
|
||||
-- but for container types it would imply using
|
||||
-- the standard instances for all types of values in the container...
|
||||
|
||||
instance Binary () where put=Bin.put; get=Bin.get
|
||||
instance Binary Bool where put=Bin.put; get=Bin.get
|
||||
instance Binary Word8 where put=Bin.put; get=Bin.get
|
||||
instance Binary Word16 where put=Bin.put; get=Bin.get
|
||||
instance Binary Char where put=Bin.put; get=Bin.get
|
||||
|
||||
-- -- GF doesn't need these:
|
||||
--instance Binary Ordering where put=Bin.put; get=Bin.get
|
||||
--instance Binary Word32 where put=Bin.put; get=Bin.get
|
||||
--instance Binary Word64 where put=Bin.put; get=Bin.get
|
||||
--instance Binary Int8 where put=Bin.put; get=Bin.get
|
||||
--instance Binary Int16 where put=Bin.put; get=Bin.get
|
||||
--instance Binary Int32 where put=Bin.put; get=Bin.get
|
||||
|
||||
--instance Binary Int64 where put=Bin.put; get=Bin.get -- needed by instance Binary ByteString
|
||||
|
||||
------------------------------------------------------------------------
|
||||
|
||||
-- Words are written as sequence of bytes. The last bit of each
|
||||
-- byte indicates whether there are more bytes to be read
|
||||
instance Binary Word where
|
||||
put i | i <= 0x7f = do put a
|
||||
| i <= 0x3fff = do put (a .|. 0x80)
|
||||
put b
|
||||
| i <= 0x1fffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put c
|
||||
| i <= 0xfffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put d
|
||||
-- -- #if WORD_SIZE_IN_BITS < 64
|
||||
| otherwise = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put e
|
||||
{-
|
||||
-- Restricted to 32 bits even on 64-bit systems, so that negative
|
||||
-- Ints are written as 5 bytes instead of 10 bytes (TH 2013-02-13)
|
||||
--#else
|
||||
| i <= 0x7ffffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put e
|
||||
| i <= 0x3ffffffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put (e .|. 0x80)
|
||||
put f
|
||||
| i <= 0x1ffffffffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put (e .|. 0x80)
|
||||
put (f .|. 0x80)
|
||||
put g
|
||||
| i <= 0xffffffffffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put (e .|. 0x80)
|
||||
put (f .|. 0x80)
|
||||
put (g .|. 0x80)
|
||||
put h
|
||||
| i <= 0xffffffffffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put (e .|. 0x80)
|
||||
put (f .|. 0x80)
|
||||
put (g .|. 0x80)
|
||||
put h
|
||||
| i <= 0x7fffffffffffffff = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put (e .|. 0x80)
|
||||
put (f .|. 0x80)
|
||||
put (g .|. 0x80)
|
||||
put (h .|. 0x80)
|
||||
put j
|
||||
| otherwise = do put (a .|. 0x80)
|
||||
put (b .|. 0x80)
|
||||
put (c .|. 0x80)
|
||||
put (d .|. 0x80)
|
||||
put (e .|. 0x80)
|
||||
put (f .|. 0x80)
|
||||
put (g .|. 0x80)
|
||||
put (h .|. 0x80)
|
||||
put (j .|. 0x80)
|
||||
put k
|
||||
-- #endif
|
||||
-}
|
||||
where
|
||||
a = fromIntegral ( i .&. 0x7f) :: Word8
|
||||
b = fromIntegral (shiftR i 7 .&. 0x7f) :: Word8
|
||||
c = fromIntegral (shiftR i 14 .&. 0x7f) :: Word8
|
||||
d = fromIntegral (shiftR i 21 .&. 0x7f) :: Word8
|
||||
e = fromIntegral (shiftR i 28 .&. 0x7f) :: Word8
|
||||
{-
|
||||
f = fromIntegral (shiftR i 35 .&. 0x7f) :: Word8
|
||||
g = fromIntegral (shiftR i 42 .&. 0x7f) :: Word8
|
||||
h = fromIntegral (shiftR i 49 .&. 0x7f) :: Word8
|
||||
j = fromIntegral (shiftR i 56 .&. 0x7f) :: Word8
|
||||
k = fromIntegral (shiftR i 63 .&. 0x7f) :: Word8
|
||||
-}
|
||||
get = do i <- getWord8
|
||||
(if i <= 0x7f
|
||||
then return (fromIntegral i)
|
||||
else do n <- get
|
||||
return $ (n `shiftL` 7) .|. (fromIntegral (i .&. 0x7f)))
|
||||
|
||||
-- Int has the same representation as Word
|
||||
instance Binary Int where
|
||||
put i = put (fromIntegral i :: Word)
|
||||
get = liftM toInt32 (get :: Get Word)
|
||||
where
|
||||
-- restrict to 32 bits (for PGF portability, TH 2013-02-13)
|
||||
toInt32 w = fromIntegral (fromIntegral w::Int32)::Int
|
||||
|
||||
------------------------------------------------------------------------
|
||||
--
|
||||
-- Portable, and pretty efficient, serialisation of Integer
|
||||
--
|
||||
|
||||
-- Fixed-size type for a subset of Integer
|
||||
--type SmallInt = Int32
|
||||
|
||||
-- Integers are encoded in two ways: if they fit inside a SmallInt,
|
||||
-- they're written as a byte tag, and that value. If the Integer value
|
||||
-- is too large to fit in a SmallInt, it is written as a byte array,
|
||||
-- along with a sign and length field.
|
||||
{-
|
||||
instance Binary Integer where
|
||||
|
||||
{-# INLINE put #-}
|
||||
put n | n >= lo && n <= hi = do
|
||||
putWord8 0
|
||||
put (fromIntegral n :: SmallInt) -- fast path
|
||||
where
|
||||
lo = fromIntegral (minBound :: SmallInt) :: Integer
|
||||
hi = fromIntegral (maxBound :: SmallInt) :: Integer
|
||||
|
||||
put n = do
|
||||
putWord8 1
|
||||
put sign
|
||||
put (unroll (abs n)) -- unroll the bytes
|
||||
where
|
||||
sign = fromIntegral (signum n) :: Word8
|
||||
|
||||
{-# INLINE get #-}
|
||||
get = do
|
||||
tag <- get :: Get Word8
|
||||
case tag of
|
||||
0 -> liftM fromIntegral (get :: Get SmallInt)
|
||||
_ -> do sign <- get
|
||||
bytes <- get
|
||||
let v = roll bytes
|
||||
return $! if sign == (1 :: Word8) then v else - v
|
||||
|
||||
--
|
||||
-- Fold and unfold an Integer to and from a list of its bytes
|
||||
--
|
||||
unroll :: Integer -> [Word8]
|
||||
unroll = unfoldr step
|
||||
where
|
||||
step 0 = Nothing
|
||||
step i = Just (fromIntegral i, i `shiftR` 8)
|
||||
|
||||
roll :: [Word8] -> Integer
|
||||
roll = foldr unstep 0
|
||||
where
|
||||
unstep b a = a `shiftL` 8 .|. fromIntegral b
|
||||
|
||||
instance (Binary a,Integral a) => Binary (R.Ratio a) where
|
||||
put r = put (R.numerator r) >> put (R.denominator r)
|
||||
get = liftM2 (R.%) get get
|
||||
-}
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Instances for the first few tuples
|
||||
|
||||
instance (Binary a, Binary b) => Binary (a,b) where
|
||||
put (a,b) = put a >> put b
|
||||
get = liftM2 (,) get get
|
||||
|
||||
instance (Binary a, Binary b, Binary c) => Binary (a,b,c) where
|
||||
put (a,b,c) = put a >> put b >> put c
|
||||
get = liftM3 (,,) get get get
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,b,c,d) where
|
||||
put (a,b,c,d) = put a >> put b >> put c >> put d
|
||||
get = liftM4 (,,,) get get get get
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a,b,c,d,e) where
|
||||
put (a,b,c,d,e) = put a >> put b >> put c >> put d >> put e
|
||||
get = liftM5 (,,,,) get get get get get
|
||||
|
||||
--
|
||||
-- and now just recurse:
|
||||
--
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d, Binary e, Binary f)
|
||||
=> Binary (a,b,c,d,e,f) where
|
||||
put (a,b,c,d,e,f) = put (a,(b,c,d,e,f))
|
||||
get = do (a,(b,c,d,e,f)) <- get ; return (a,b,c,d,e,f)
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g)
|
||||
=> Binary (a,b,c,d,e,f,g) where
|
||||
put (a,b,c,d,e,f,g) = put (a,(b,c,d,e,f,g))
|
||||
get = do (a,(b,c,d,e,f,g)) <- get ; return (a,b,c,d,e,f,g)
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d, Binary e,
|
||||
Binary f, Binary g, Binary h)
|
||||
=> Binary (a,b,c,d,e,f,g,h) where
|
||||
put (a,b,c,d,e,f,g,h) = put (a,(b,c,d,e,f,g,h))
|
||||
get = do (a,(b,c,d,e,f,g,h)) <- get ; return (a,b,c,d,e,f,g,h)
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d, Binary e,
|
||||
Binary f, Binary g, Binary h, Binary i)
|
||||
=> Binary (a,b,c,d,e,f,g,h,i) where
|
||||
put (a,b,c,d,e,f,g,h,i) = put (a,(b,c,d,e,f,g,h,i))
|
||||
get = do (a,(b,c,d,e,f,g,h,i)) <- get ; return (a,b,c,d,e,f,g,h,i)
|
||||
|
||||
instance (Binary a, Binary b, Binary c, Binary d, Binary e,
|
||||
Binary f, Binary g, Binary h, Binary i, Binary j)
|
||||
=> Binary (a,b,c,d,e,f,g,h,i,j) where
|
||||
put (a,b,c,d,e,f,g,h,i,j) = put (a,(b,c,d,e,f,g,h,i,j))
|
||||
get = do (a,(b,c,d,e,f,g,h,i,j)) <- get ; return (a,b,c,d,e,f,g,h,i,j)
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Container types
|
||||
|
||||
instance Binary a => Binary [a] where
|
||||
put l = put (length l) >> mapM_ put l
|
||||
get = do n <- get :: Get Int
|
||||
xs <- replicateM n get
|
||||
return xs
|
||||
|
||||
instance (Binary a) => Binary (Maybe a) where
|
||||
put Nothing = putWord8 0
|
||||
put (Just x) = putWord8 1 >> put x
|
||||
get = do
|
||||
w <- getWord8
|
||||
case w of
|
||||
0 -> return Nothing
|
||||
_ -> liftM Just get
|
||||
|
||||
instance (Binary a, Binary b) => Binary (Either a b) where
|
||||
put (Left a) = putWord8 0 >> put a
|
||||
put (Right b) = putWord8 1 >> put b
|
||||
get = do
|
||||
w <- getWord8
|
||||
case w of
|
||||
0 -> liftM Left get
|
||||
_ -> liftM Right get
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- ByteStrings (have specially efficient instances)
|
||||
|
||||
instance Binary B.ByteString where
|
||||
put bs = do put (B.length bs)
|
||||
putByteString bs
|
||||
get = get >>= getByteString
|
||||
|
||||
--
|
||||
-- Using old versions of fps, this is a type synonym, and non portable
|
||||
--
|
||||
-- Requires 'flexible instances'
|
||||
--
|
||||
{-
|
||||
instance Binary ByteString where
|
||||
put bs = do put (fromIntegral (L.length bs) :: Int)
|
||||
putLazyByteString bs
|
||||
get = get >>= getLazyByteString
|
||||
-}
|
||||
------------------------------------------------------------------------
|
||||
-- Maps and Sets
|
||||
|
||||
instance (Ord a, Binary a) => Binary (Set.Set a) where
|
||||
put s = put (Set.size s) >> mapM_ put (Set.toAscList s)
|
||||
get = liftM Set.fromDistinctAscList get
|
||||
|
||||
instance (Ord k, Binary k, Binary e) => Binary (Map.Map k e) where
|
||||
put m = put (Map.size m) >> mapM_ put (Map.toAscList m)
|
||||
get = liftM Map.fromDistinctAscList get
|
||||
|
||||
instance Binary IntSet.IntSet where
|
||||
put s = put (IntSet.size s) >> mapM_ put (IntSet.toAscList s)
|
||||
get = liftM IntSet.fromDistinctAscList get
|
||||
|
||||
instance (Binary e) => Binary (IntMap.IntMap e) where
|
||||
put m = put (IntMap.size m) >> mapM_ put (IntMap.toAscList m)
|
||||
get = liftM IntMap.fromDistinctAscList get
|
||||
|
||||
------------------------------------------------------------------------
|
||||
-- Floating point
|
||||
|
||||
-- instance Binary Double where
|
||||
-- put d = put (decodeFloat d)
|
||||
-- get = liftM2 encodeFloat get get
|
||||
|
||||
instance Binary Double where
|
||||
put = putFloat64be
|
||||
get = getFloat64be
|
||||
{-
|
||||
instance Binary Float where
|
||||
put f = put (decodeFloat f)
|
||||
get = liftM2 encodeFloat get get
|
||||
-}
|
||||
------------------------------------------------------------------------
|
||||
-- Trees
|
||||
{-
|
||||
instance (Binary e) => Binary (T.Tree e) where
|
||||
put (T.Node r s) = put r >> put s
|
||||
get = liftM2 T.Node get get
|
||||
-}
|
||||
------------------------------------------------------------------------
|
||||
-- Arrays
|
||||
|
||||
instance (Binary i, Ix i, Binary e) => Binary (Array i e) where
|
||||
put a = do
|
||||
put (bounds a)
|
||||
put (rangeSize $ bounds a) -- write the length
|
||||
mapM_ put (elems a) -- now the elems.
|
||||
get = do
|
||||
bs <- get
|
||||
n <- get -- read the length
|
||||
xs <- replicateM n get -- now the elems.
|
||||
return (listArray bs xs)
|
||||
|
||||
--
|
||||
-- The IArray UArray e constraint is non portable. Requires flexible instances
|
||||
--
|
||||
instance (Binary i, Ix i, Binary e, IArray UArray e) => Binary (UArray i e) where
|
||||
put a = do
|
||||
put (bounds a)
|
||||
put (rangeSize $ bounds a) -- now write the length
|
||||
mapM_ put (elems a)
|
||||
get = do
|
||||
bs <- get
|
||||
n <- get
|
||||
xs <- replicateM n get
|
||||
return (listArray bs xs)
|
||||
@@ -1,27 +0,0 @@
|
||||
name: pgf-binary
|
||||
version: 0.5
|
||||
|
||||
cabal-version: >= 1.10
|
||||
build-type: Simple
|
||||
license: BSD3
|
||||
--license-file: LICENSE
|
||||
synopsis: Custom version of the binary-0.5 package for the PGF library
|
||||
homepage: http://www.grammaticalframework.org/
|
||||
--bug-reports: http://code.google.com/p/grammatical-framework/issues/list
|
||||
maintainer: Thomas Hallgren
|
||||
stability: provisional
|
||||
category: Data, Parsing
|
||||
tested-with: GHC==7.4.2, GHC==7.8.3
|
||||
|
||||
source-repository head
|
||||
type: darcs
|
||||
location: http://www.grammaticalframework.org/
|
||||
|
||||
Library
|
||||
default-language: Haskell2010
|
||||
build-depends: base >= 4.3 && <5, binary, data-binary-ieee754,
|
||||
containers, array, bytestring
|
||||
exposed-modules: PGF.Data.Binary
|
||||
|
||||
ghc-options: -fwarn-unused-imports -O2
|
||||
extensions: FlexibleInstances, FlexibleContexts
|
||||
@@ -12,6 +12,9 @@ module PGF2.Internal(-- * Access the internal structures
|
||||
build, eAbs, eApp, eMeta, eFun, eVar, eTyped, eImplArg, dTyp, hypo,
|
||||
AbstrInfo, newAbstr, ConcrInfo, newConcr, newPGF,
|
||||
|
||||
-- * Expose PGF and Concr for FFI with C
|
||||
PGF(..), Concr(..),
|
||||
|
||||
-- * Write an in-memory PGF to a file
|
||||
writePGF
|
||||
) where
|
||||
|
||||
@@ -374,7 +374,7 @@ browse pgf id = fmap (\def -> (def,producers,consumers)) definition
|
||||
Just (hyps,_,_) -> Just $ render (text "cat" <+> ppCId id <+> hsep (snd (mapAccumL (ppHypo 4) [] hyps)))
|
||||
Nothing -> Nothing
|
||||
|
||||
(producers,consumers) = Map.foldWithKey accum ([],[]) (funs (abstract pgf))
|
||||
(producers,consumers) = Map.foldrWithKey accum ([],[]) (funs (abstract pgf))
|
||||
where
|
||||
accum f (ty,_,_,_) (plist,clist) =
|
||||
let !plist' = if id `elem` ps then f : plist else plist
|
||||
|
||||
@@ -190,7 +190,7 @@ foldForest :: (FunId -> [PArg] -> b -> b) -> (Expr -> [String] -> b -> b) -> b -
|
||||
foldForest f g b fcat forest =
|
||||
case IntMap.lookup fcat forest of
|
||||
Nothing -> b
|
||||
Just set -> Set.fold foldProd b set
|
||||
Just set -> Set.foldr foldProd b set
|
||||
where
|
||||
foldProd (PCoerce fcat) b = foldForest f g b fcat forest
|
||||
foldProd (PApply funid args) b = f funid args b
|
||||
|
||||
@@ -185,8 +185,8 @@ filterProductions prods0 prods
|
||||
| prods0 == prods1 = prods0
|
||||
| otherwise = filterProductions prods1 prods
|
||||
where
|
||||
prods1 = IntMap.foldWithKey foldProdSet IntMap.empty prods
|
||||
hoc = IntMap.fold (\set !hoc -> Set.fold accumHOC hoc set) IntSet.empty prods
|
||||
prods1 = IntMap.foldrWithKey foldProdSet IntMap.empty prods
|
||||
hoc = IntMap.foldr (\set !hoc -> Set.foldr accumHOC hoc set) IntSet.empty prods
|
||||
|
||||
foldProdSet fid set !prods
|
||||
| Set.null set1 = prods
|
||||
@@ -204,7 +204,7 @@ filterProductions prods0 prods
|
||||
accumHOC _ hoc = hoc
|
||||
|
||||
splitLexicalRules cnc p_prods =
|
||||
IntMap.foldWithKey split (IntMap.empty,IntMap.empty) p_prods
|
||||
IntMap.foldrWithKey split (IntMap.empty,IntMap.empty) p_prods
|
||||
where
|
||||
split fid set (lex,syn) =
|
||||
let (lex0,syn0) = Set.partition isLexical set
|
||||
|
||||
@@ -198,7 +198,7 @@ recoveryStates open_types (EState abs cnc chart) =
|
||||
Nothing -> []
|
||||
|
||||
complete open_fcats items ac =
|
||||
foldl (Set.fold (\(Active j' ppos funid seqid args keyc) ->
|
||||
foldl (Set.foldr (\(Active j' ppos funid seqid args keyc) ->
|
||||
(:) (Active j' (ppos+1) funid seqid args keyc)))
|
||||
items
|
||||
[set | fcat <- open_fcats, (set,_) <- lookupACByFCat fcat ac]
|
||||
@@ -363,7 +363,7 @@ process flit ftok cnc (item@(Active j ppos funid seqid args key0):items) acc cha
|
||||
|
||||
items2 = case lookupAC key0 ((active chart:actives chart) !! (k-j)) of
|
||||
Nothing -> items
|
||||
Just (set,sc) -> Set.fold (\(Active j' ppos funid seqid args keyc) ->
|
||||
Just (set,sc) -> Set.foldr (\(Active j' ppos funid seqid args keyc) ->
|
||||
let SymCat d _ = unsafeAt (unsafeAt (sequences cnc) seqid) ppos
|
||||
PArg hypos _ = args !! d
|
||||
in (:) (Active j' (ppos+1) funid seqid (updateAt d (PArg hypos fid) args) keyc)) items set
|
||||
@@ -395,7 +395,7 @@ process flit ftok cnc (item@(Active j ppos funid seqid args key0):items) acc cha
|
||||
predict flit ftok cnc forest key0 key@(AK fid lbl) k acc items =
|
||||
let (acc1,items1) = case IntMap.lookup fid forest of
|
||||
Nothing -> (acc,items)
|
||||
Just set -> Set.fold foldProd (acc,items) set
|
||||
Just set -> Set.foldr foldProd (acc,items) set
|
||||
|
||||
(acc2,items2) = case IntMap.lookup fid (lexicon cnc) >>= IntMap.lookup lbl of
|
||||
Just tmap -> let (mb_v,toks) = TrieMap.decompose (TrieMap.map (toItems key0 k) tmap)
|
||||
|
||||
@@ -79,12 +79,12 @@ unionsWith f = foldl (unionWith f) empty
|
||||
elems :: TrieMap k v -> [v]
|
||||
elems tr = collect tr []
|
||||
where
|
||||
collect (Tr mb_v m) xs = maybe id (:) mb_v (Map.fold collect xs m)
|
||||
collect (Tr mb_v m) xs = maybe id (:) mb_v (Map.foldr collect xs m)
|
||||
|
||||
toList :: TrieMap k v -> [([k],v)]
|
||||
toList tr = collect [] tr []
|
||||
where
|
||||
collect ks (Tr mb_v m) xs = maybe id (\v -> (:) (ks,v)) mb_v (Map.foldWithKey (\k -> collect (k:ks)) xs m)
|
||||
collect ks (Tr mb_v m) xs = maybe id (\v -> (:) (ks,v)) mb_v (Map.foldrWithKey (\k -> collect (k:ks)) xs m)
|
||||
|
||||
fromListWith :: Ord k => (v -> v -> v) -> [([k],v)] -> TrieMap k v
|
||||
fromListWith f xs = foldl' (\trie (ks,v) -> insertWith f ks v trie) empty xs
|
||||
|
||||
@@ -35,7 +35,8 @@ import PGF.Macros (lookValCat, BracketedString(..))
|
||||
|
||||
import qualified Data.Map as Map
|
||||
--import qualified Data.IntMap as IntMap
|
||||
import Data.List (intersperse,nub,mapAccumL,find,groupBy)
|
||||
import Data.List (intersperse,nub,mapAccumL,find,groupBy,sortBy)
|
||||
import Data.Ord (comparing)
|
||||
--import Data.Char (isDigit)
|
||||
import Data.Maybe (fromMaybe)
|
||||
import Text.PrettyPrint
|
||||
@@ -777,15 +778,22 @@ fixCoNLL labels conll = map fixc conll where
|
||||
getDep j label = maybe j id $ lookup (label,j) [((label,j),i) | i:word:fun:pos:cat:x_:j:label:xs <- conll]
|
||||
|
||||
getCncDepLabels :: String -> CncLabels
|
||||
getCncDepLabels = map merge . groupBy (\ (x,_) (a,_) -> x == a) . concatMap analyse . filter choose . lines where
|
||||
getCncDepLabels =
|
||||
map merge .
|
||||
groupBy (\ (x,_) (a,_) -> x == a) .
|
||||
sortBy (comparing fst) .
|
||||
concatMap analyse .
|
||||
filter choose .
|
||||
lines
|
||||
where
|
||||
--- choose is for compatibility with the general notation
|
||||
choose line = notElem '(' line && elem '{' line --- ignoring non-local (with "(") and abstract (without "{") rules
|
||||
|
||||
analyse line = case break (=='{') line of
|
||||
(beg,_:ws) -> case break (=='}') ws of
|
||||
(toks,_:target) -> case (words beg, words target) of
|
||||
(fun:_,[ label,j]) -> [(fun, (tok, (id, label,j))) | tok <- getToks toks]
|
||||
(fun:_,[pos,label,j]) -> [(fun, (tok, (const pos,label,j))) | tok <- getToks toks]
|
||||
(toks,_:target) -> case (getToks beg, words target) of
|
||||
(funs,[ label,j]) -> [(fun, (tok, (id, label,j))) | fun <- funs, tok <- getToks toks]
|
||||
(funs,[pos,label,j]) -> [(fun, (tok, (const pos,label,j))) | fun <- funs, tok <- getToks toks]
|
||||
_ -> []
|
||||
_ -> []
|
||||
_ -> []
|
||||
@@ -794,7 +802,9 @@ getCncDepLabels = map merge . groupBy (\ (x,_) (a,_) -> x == a) . concatMap ana
|
||||
Just new -> return new
|
||||
_ -> lookup "*" (map snd rules)
|
||||
)
|
||||
getToks = words . map (\c -> if elem c "\"," then ' ' else c)
|
||||
getToks = map unquote . filter (/=",") . toks
|
||||
toks s = case lex s of [(t,"")] -> [t] ; [(t,cc)] -> t:toks cc ; _ -> []
|
||||
unquote s = case s of '"':cc@(_:_) | last cc == '"' -> init cc ; _ -> s
|
||||
|
||||
printCoNLL :: CoNLL -> String
|
||||
printCoNLL = unlines . map (concat . intersperse "\t")
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: pgf
|
||||
version: 3.9.1-git
|
||||
version: 3.10
|
||||
|
||||
cabal-version: >= 1.20
|
||||
build-type: Simple
|
||||
@@ -12,11 +12,6 @@ bug-reports: https://github.com/GrammaticalFramework/gf-core/issues
|
||||
maintainer: Thomas Hallgren
|
||||
tested-with: GHC==7.6.3, GHC==7.8.3, GHC==7.10.3, GHC==8.0.2
|
||||
|
||||
flag custom-binary
|
||||
Description: Use a customised version of the binary package
|
||||
Default: True
|
||||
Manual: True
|
||||
|
||||
Library
|
||||
default-language: Haskell2010
|
||||
build-depends: base >= 4.6 && <5,
|
||||
@@ -29,17 +24,14 @@ Library
|
||||
mtl,
|
||||
exceptions
|
||||
|
||||
if flag(custom-binary)
|
||||
other-modules:
|
||||
-- not really part of GF but I have changed the original binary library
|
||||
-- and we have to keep the copy for now.
|
||||
Data.Binary
|
||||
Data.Binary.Put
|
||||
Data.Binary.Get
|
||||
Data.Binary.Builder
|
||||
Data.Binary.IEEE754
|
||||
else
|
||||
build-depends: binary, data-binary-ieee754
|
||||
other-modules:
|
||||
-- not really part of GF but I have changed the original binary library
|
||||
-- and we have to keep the copy for now.
|
||||
Data.Binary
|
||||
Data.Binary.Put
|
||||
Data.Binary.Get
|
||||
Data.Binary.Builder
|
||||
Data.Binary.IEEE754
|
||||
|
||||
--ghc-options: -fwarn-unused-imports
|
||||
--if impl(ghc>=7.8)
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
name: gf-server
|
||||
version: 1.0
|
||||
cabal-version: >= 1.8
|
||||
build-type: Custom
|
||||
license: GPL
|
||||
license-file: ../../LICENSE
|
||||
synopsis: FastCGI Server for Grammatical Framework
|
||||
|
||||
flag content
|
||||
Description:
|
||||
Build content service (requires fastcgi and hsql-mysql packages)
|
||||
(In Ubuntu: apt-get install libghc-fastcgi-dev libghc-hsql-mysql-dev)
|
||||
Default: False
|
||||
|
||||
flag http
|
||||
Description: Build pgf-http (deprecated, replaced by gf -server)
|
||||
Default: False
|
||||
|
||||
flag fastcgi
|
||||
Description: Build librar & pgf-service executable with fastcgi support
|
||||
Default: True
|
||||
|
||||
flag c-runtime
|
||||
Description: Include functionality from the C run-time library (which must be installed already)
|
||||
Default: False
|
||||
|
||||
flag network-uri
|
||||
description: Get Network.URI from the network-uri package
|
||||
default: True
|
||||
|
||||
Library
|
||||
exposed-modules: PGFService FastCGIUtils CGIUtils ServeStaticFile RunHTTP Cache
|
||||
other-modules: URLEncoding CGI Fold
|
||||
hs-source-dirs: . transfer
|
||||
|
||||
if flag(fastcgi)
|
||||
build-depends: fastcgi >= 3001.0.2.2
|
||||
-- Install it in Ubuntu with: apt-get install libghc-fastcgi-dev
|
||||
else
|
||||
Buildable: False
|
||||
|
||||
build-depends: base >=4.2 && <5,
|
||||
time, time-compat, old-locale,
|
||||
directory,
|
||||
filepath,
|
||||
containers,
|
||||
process,
|
||||
gf >= 3.6,
|
||||
cgi >= 3001.1.7.3,
|
||||
httpd-shed>=0.4.0.2,
|
||||
mtl,
|
||||
exceptions,
|
||||
json >= 0.3.3,
|
||||
utf8-string >= 0.3.1.1,
|
||||
bytestring,
|
||||
pretty,
|
||||
random
|
||||
|
||||
if flag(network-uri)
|
||||
build-depends: network-uri>=2.6, network>=2.6
|
||||
else
|
||||
build-depends: network>=2.3 && <2.6
|
||||
|
||||
ghc-options: -fwarn-unused-imports
|
||||
if os(windows)
|
||||
ghc-options: -optl-mwindows
|
||||
else
|
||||
build-depends: unix
|
||||
|
||||
if flag(c-runtime)
|
||||
cpp-options: -DC_RUNTIME
|
||||
|
||||
executable pgf-http
|
||||
main-is: pgf-http.hs
|
||||
Hs-source-dirs: exec
|
||||
ghc-options: -threaded
|
||||
if impl(ghc>=7.0)
|
||||
ghc-options: -rtsopts
|
||||
|
||||
if flag(http)
|
||||
buildable: True
|
||||
build-depends: base >=4.2 && <5, gf-server, filepath, directory, cgi
|
||||
else
|
||||
buildable: False
|
||||
|
||||
executable pgf-service
|
||||
main-is: pgf-fcgi.hs
|
||||
Hs-source-dirs: exec
|
||||
ghc-options: -threaded -fwarn-unused-imports
|
||||
if impl(ghc>=7.0)
|
||||
ghc-options: -rtsopts
|
||||
|
||||
if flag(fastcgi)
|
||||
build-depends: fastcgi >= 3001.0.2.2
|
||||
-- Install it in Ubuntu with: apt-get install libghc-fastcgi-dev
|
||||
else
|
||||
Buildable: False
|
||||
|
||||
build-depends: base >=4.2 && <5, gf-server
|
||||
|
||||
if os(windows)
|
||||
ghc-options: -optl-mwindows
|
||||
else
|
||||
build-depends: unix
|
||||
|
||||
executable content-service
|
||||
if flag(content)
|
||||
build-depends: base >=4.2 && <5, old-locale,
|
||||
fastcgi >= 3001.0.2.2,
|
||||
-- In Ubuntu: apt-get install libghc-fastcgi-dev
|
||||
hsql-mysql, hsql
|
||||
-- In Ubuntu: apt-get install libghc-hsql-mysql-dev
|
||||
buildable: True
|
||||
else
|
||||
buildable: False
|
||||
|
||||
main-is: ContentService.hs
|
||||
Hs-source-dirs: exec
|
||||
@@ -1,4 +1,4 @@
|
||||
# Run with (with -D for no-daemon)
|
||||
# Run with (with -D for no-daemon)
|
||||
# /usr/sbin/lighttpd -f lighttpd.conf -D
|
||||
#
|
||||
|
||||
@@ -10,8 +10,9 @@ server.modules = (
|
||||
"mod_cgi"
|
||||
)
|
||||
|
||||
var.basedir = var.CWD
|
||||
var.basedir = var.CWD
|
||||
|
||||
# John: no longer valid after removing `src/ui` 2018-11-15
|
||||
server.document-root = basedir + "/../ui/gwt/www"
|
||||
|
||||
server.errorlog = basedir + "/error.log"
|
||||
@@ -96,4 +97,3 @@ static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
|
||||
|
||||
## bind to port (default: 80)
|
||||
server.port = 41296
|
||||
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
-- |
|
||||
-- Maintainer : AR
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/05/16 17:07:18 $
|
||||
-- > CVS $Author: aarne $
|
||||
-- > CVS $Revision: 1.11 $
|
||||
--
|
||||
-- chop an HTML file into separate files, each linked to the next and previous.
|
||||
-- the names of the files are n-file, with n = 01,02,...
|
||||
-- the chopping is performed at each separator, here defined as @\<!-- NEW --\>@
|
||||
--
|
||||
-- AR 7\/1\/2002 for the Vinnova meeting in Linköping.
|
||||
-- Added table of contents generation in file 00, 16/4/2005
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
module Main (main) where
|
||||
|
||||
import System.Environment(getArgs)
|
||||
import Data.Char
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
file:_ <- getArgs
|
||||
htmls file
|
||||
|
||||
htmls :: FilePath -> IO ()
|
||||
htmls file = do
|
||||
s <- readFile file
|
||||
let ss = allPages file s
|
||||
lg = length ss
|
||||
putStrLn $ show lg ++ " slides"
|
||||
mapM_ (uncurry writeFile . mkFile file lg) ss
|
||||
|
||||
allPages :: FilePath -> String -> [(Int,String)]
|
||||
allPages file s = addIndex $ zip [1..] $ map unlines $ chop lss where
|
||||
chop ls = case span isNoSep ls of
|
||||
(s,_:ss) -> s : chop ss
|
||||
_ -> [ls]
|
||||
isNoSep = (/= separator)
|
||||
addIndex = ((0,mkIndex file lss) :)
|
||||
lss = lines s
|
||||
|
||||
mkFile :: FilePath -> Int -> (Int,String) -> (FilePath,String)
|
||||
mkFile base mx (number,content) =
|
||||
(fileName base number,
|
||||
unlines [
|
||||
begHTML,
|
||||
"<font size=1>",
|
||||
pageNum mx number,
|
||||
link base mx number,
|
||||
"</font>",
|
||||
"<p>",
|
||||
content,
|
||||
endHTML
|
||||
]
|
||||
)
|
||||
|
||||
begHTML, endHTML, separator :: String
|
||||
begHTML = "<html><body bgcolor=\"#FFFFFF\" text=\"#000000\">"
|
||||
endHTML = "</body></html>"
|
||||
separator = "<!-- NEW -->"
|
||||
|
||||
link :: FilePath -> Int -> Int -> String
|
||||
link file mx n =
|
||||
(if n >= mx-1 then "" else (" <a href=\"" ++ file' ++ "\">Next</a>")) ++
|
||||
(if n == 1 then "" else (" <a href=\"" ++ file_ ++ "\">Previous</a>")) ++
|
||||
(" <a href=\"" ++ file0 ++ "\">Contents</a>") ++
|
||||
(" <a href=\"" ++ file ++ "\">Fulltext</a>") ++
|
||||
(" <a href=\"" ++ file1 ++ "\">First</a>") ++
|
||||
(" <a href=\"" ++ file2 ++ "\">Last</a>")
|
||||
where
|
||||
file_ = fileName file (n - 1)
|
||||
file' = fileName file (n + 1)
|
||||
file0 = fileName file 0
|
||||
file1 = fileName file 1
|
||||
file2 = fileName file (mx - 1)
|
||||
|
||||
fileName :: FilePath -> Int -> FilePath
|
||||
fileName file n = (if n < 10 then ('0':) else id) $ show n ++ "-" ++ file
|
||||
|
||||
pageNum mx num = "<p align=right>" ++ show num ++"/" ++ show (mx-1) ++ "</p>"
|
||||
|
||||
mkIndex file = unlines . mkInd 1 where
|
||||
mkInd n ss = case ss of
|
||||
s : rest | (s==separator) -> mkInd (n+1) rest
|
||||
s : rest -> case getHeading s of
|
||||
Just (i,t) -> mkLine n i t : mkInd n rest
|
||||
_ -> mkInd n rest
|
||||
_ -> []
|
||||
getHeading s = case dropWhile isSpace s of
|
||||
'<':h:i:_:t | isDigit i -> return (i,take (length t - 5) t) -- drop final </hi>
|
||||
_ -> Nothing
|
||||
mkLine _ '1' t = t ++ " : Table of Contents<p>" -- heading of whole document
|
||||
mkLine n i t = stars i ++ link n t ++ "<br>"
|
||||
stars i = case i of
|
||||
'3' -> "<li> "
|
||||
'4' -> "<li>* "
|
||||
_ -> ""
|
||||
link n t = "<a href=\"" ++ fileName file n ++ "\">" ++ t ++ "</a>"
|
||||
@@ -6,7 +6,3 @@ cabal-version: >= 1.8
|
||||
Executable gfdoc
|
||||
main-is: GFDoc.hs
|
||||
build-depends: base, directory>=1.2, time>=1.5, process
|
||||
|
||||
Executable htmls
|
||||
main-is: Htmls.hs
|
||||
build-depends: base
|
||||
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="gen"/>
|
||||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||
<classpathentry kind="output" path="bin/classes"/>
|
||||
</classpath>
|
||||
@@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>GFTranslator</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>com.android.ide.eclipse.adt.ApkBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -1,63 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="org.grammaticalframework.ui.android"
|
||||
android:versionCode="15"
|
||||
android:versionName="1.2.2"
|
||||
android:installLocation="auto" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="11"
|
||||
android:targetSdkVersion="18" />
|
||||
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
android:icon="@drawable/ic_app"
|
||||
android:label="@string/app_name"
|
||||
android:theme="@style/AppTheme" android:name="GFTranslator">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:label="@string/app_name" >
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="AlternativesActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data android:scheme="gf-translator"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="HelpActivity"></activity>
|
||||
<activity android:name="SemanticGraphActivity"
|
||||
android:launchMode="singleTop">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.SEARCH" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.app.searchable"
|
||||
android:resource="@xml/searchable"/>
|
||||
<meta-data android:name="android.app.default_searchable"
|
||||
android:value=".SearchableActivity"/>
|
||||
</activity>
|
||||
|
||||
<activity android:name="se.chalmers.phrasebook.gui.activities.NavigationActivity"></activity>
|
||||
|
||||
<service android:name="TranslatorInputMethodService"
|
||||
android:permission="android.permission.BIND_INPUT_METHOD">
|
||||
<intent-filter>
|
||||
<action android:name="android.view.InputMethod" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="android.view.im" android:resource="@xml/method" />
|
||||
</service>
|
||||
<provider android:name=".LexiconSuggestionProvider"
|
||||
android:authorities="org.grammaticalframework.ui.android.LexiconSuggestionProvider">
|
||||
<path-permission android:pathPrefix="/search_suggest_query"
|
||||
android:readPermission="android.permission.GLOBAL_SEARCH"/>
|
||||
</provider>
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -1,27 +0,0 @@
|
||||
BSD LICENSE
|
||||
|
||||
Copyright (c) 1998, Grammatical Framework
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of the <organization> nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
= Overview =
|
||||
|
||||
This directory contains a sample Android app tht uses
|
||||
the Android speech recognition and TTS APIs along with
|
||||
JNI bindings to the C PGF runtime to implement a simple
|
||||
speech translation app.
|
||||
|
||||
|
||||
= Requirements =
|
||||
|
||||
1. Android SDK: http://developer.android.com/sdk/
|
||||
installed in $ANDROID_SDK_LOCATION
|
||||
|
||||
2. Android NDK: http://developer.android.com/tools/sdk/ndk/
|
||||
installed in $ANDROID_NDK_LOCATION
|
||||
|
||||
= Building =
|
||||
|
||||
Set up Android project:
|
||||
|
||||
# Creates local.properties, not to be checked in
|
||||
$ $ANDROID_SDK_LOCATION/tools/android update project -p .
|
||||
|
||||
Build libs/libjpgf.jar:
|
||||
|
||||
$ (cd ../../runtime/java && javac org/grammaticalframework/*/*.java && jar -cf ../../ui/android/libs/jpgf.jar org/grammaticalframework/*/*.class)
|
||||
|
||||
Build JNI code:
|
||||
|
||||
$ cd jni
|
||||
$ $ANDROID_NDK_LOCATION/ndk-build
|
||||
|
||||
Build the semantic database code:
|
||||
|
||||
$ runghc glosses.hs
|
||||
|
||||
Build APK:
|
||||
|
||||
$ ant debug
|
||||
|
||||
|
||||
Install on your device:
|
||||
|
||||
$ ant debug install
|
||||
|
||||
or:
|
||||
|
||||
$ adb install -r bin/MainActivity-debug.apk
|
||||
|
||||
|
||||
= Changing the grammar =
|
||||
|
||||
1. Replace assets/ResourceDemo.pgf
|
||||
|
||||
2. Edit Translator.java to point to the new file and include its metadata
|
||||
|
||||
|
||||
= Developing in Eclipse =
|
||||
|
||||
1. Install Android ADT
|
||||
|
||||
2. Eclipse > File > Import > Existing Projects into Workspace > Next
|
||||
|
||||
3. Select root directory...
|
||||
|
||||
4. Select GF/src/ui/android
|
||||
|
||||
5. Finish
|
||||
@@ -1,2 +0,0 @@
|
||||
key.store=/home/krasimir/dg/src/keys/dg_keystore
|
||||
key.alias=dg
|
||||
@@ -1,157 +0,0 @@
|
||||
<html>
|
||||
<body>
|
||||
</p>
|
||||
<b>GF Offline Translator</b>:
|
||||
text and speech translation for 16 languages with
|
||||
quality control. Version 19 April 2017 (beta).
|
||||
</p>
|
||||
<p>
|
||||
<b>Speech input</b>: Tap microphone icon and talk while it is red.
|
||||
<br>
|
||||
<b>Text input</b>: Select "keyboard" from menu, tap keyboard icon.
|
||||
<br>
|
||||
<b>Correction</b>: Tap input text and edit.
|
||||
<br>
|
||||
<b>Alternatives</b>: Tap output text.
|
||||
<br>
|
||||
<b>Grammar info</b>: Tap any of the alternatives.
|
||||
<br>
|
||||
<b>Confidence</b>: colour of output text
|
||||
<ul>
|
||||
<li><span style="background-color:palegreen">Green</span>: semantic, probably correct (but has alternatives)</li>
|
||||
<li><span style="background-color:yellow">Yellow</span>: syntactic, often incorrect (has alternatives)</li>
|
||||
<li><span style="background-color:pink">Light red</span>: chunk-based, probably incorrect (has alternatives)</li>
|
||||
<li><span style="background-color:red">Dark red</span>: word-based, often very bad</li>
|
||||
</ul>
|
||||
<br>
|
||||
<b>Topics</b> (new, select from menu): Words grouped by semantic categories, with WordNet glosses.
|
||||
<br>
|
||||
<b>Phrasebook</b> (new, select from menu): Conceptual authoring with the green translations.
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2>More details</h2>
|
||||
<p>
|
||||
GF Offline Translator is based on grammar and semantics. It is compact in size
|
||||
and gives control on quality. Its technology is inspired by compilers, which are
|
||||
programs that translate computer languages.
|
||||
Most other translators for human language are based on
|
||||
statistics and have less control of quality and are much bigger, so that
|
||||
they require either an internet connection or a huge storage on your phone.
|
||||
</p>
|
||||
The app indicates translation confidence with colours:
|
||||
<ul>
|
||||
<li><b>Green</b>:
|
||||
semantic translation, should be correct.
|
||||
But not necessarily the only correct one.
|
||||
You can tap the output to see alternatives.
|
||||
</li>
|
||||
<li><b>Yellow</b>:
|
||||
syntactic translation, should be grammatically correct.
|
||||
But can be very strange in its interpretation and choice of words.
|
||||
</li>
|
||||
<li><b>Light red</b>:
|
||||
chunk translation, probably incorrect.
|
||||
Builds the translation from small pieces.
|
||||
</li>
|
||||
<li><b>Dark red</b>:
|
||||
word-by-word translation, almost certainly incorrect.
|
||||
Builds the translation word by word.
|
||||
</li>
|
||||
</ul>
|
||||
The green translations come from a tourist phrasebook, which allows
|
||||
you to translate things like "hello" and "how far is the airport from
|
||||
the hotel".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You can translate both speech and text, as selected in the menu in the
|
||||
upper right corner. Both kinds of input can be edited with the
|
||||
keyboard by first tapping at the input field. This is often needed
|
||||
because of <b>speech recognition errors</b>. Changing words
|
||||
from <b>upper to lower case</b> may also be needed.
|
||||
At the moment, <b>Japanese</b> and <b>Thai</b> input must be separated
|
||||
to words, whereas Chinese works without spaces.
|
||||
</p>
|
||||
<p>
|
||||
Translation works between any of the 16 supported languages, which means 240
|
||||
language pairs in the current version. But different languages are on different levels of development.
|
||||
The following table gives a rough idea of what to expect:
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<center>
|
||||
<table rules=all border=yes>
|
||||
<tr> <th></th> <th>coverage</th> <th>quality</th> <th>speed</th> <th>speech</th> </tr>
|
||||
<tr> <th>Bulgarian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=palegreen></td> <td bgcolor=yellow>in only</td></tr>
|
||||
<tr> <th>Catalan</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow></td></tr>
|
||||
<tr> <th>Chinese</th> <td bgcolor=pink></td> <td bgcolor=pink></td> <td bgcolor=palegreen></td> <td bgcolor=yellow></td> </tr>
|
||||
<tr> <th>Dutch</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> </tr>
|
||||
<tr> <th>English</th> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> <td bgcolor=palegreen></td> </tr>
|
||||
<tr> <th>Estonian</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=red></td></tr>
|
||||
<tr> <th>Finnish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=yellow></td></tr>
|
||||
<tr> <th>French</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||
<tr> <th>German</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||
<tr> <th>Hindi</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> </tr>
|
||||
<tr> <th>Italian</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||
<tr> <th>Japanese*</th><td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=yellow></td> <td bgcolor=palegreen></td></tr>
|
||||
<tr> <th>Russian</th> <td bgcolor=pink></td> <td bgcolor=red></td> <td bgcolor=yellow></td> <td bgcolor=yellow></td> </tr>
|
||||
<tr> <th>Spanish</th> <td bgcolor=pink></td> <td bgcolor=yellow></td><td bgcolor=pink></td> <td bgcolor=palegreen></td></tr>
|
||||
<tr> <th>Swedish</th> <td bgcolor=yellow></td> <td bgcolor=yellow></td> <td bgcolor=palegreen></td> <td bgcolor=yellow></td></tr>
|
||||
<tr> <th>Thai*</th> <td bgcolor=pink></td> <td bgcolor=pink></td><td bgcolor=yellow></td> <td bgcolor=palegreen></td></tr>
|
||||
</table>
|
||||
</center>
|
||||
* For translation from Japanese and Thai you need to separate each word with a space
|
||||
</p>
|
||||
<p>
|
||||
The speech input and output use Google's voice services. Their status
|
||||
can hence change without notice. You can make it more stable by
|
||||
installing third-party speech tools, such as SVOX, which provides
|
||||
output for most of the listed languages.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
When you tap on a translation you get a screen with <b>alternative translations</b>.
|
||||
Tapping on each of the alternatives
|
||||
gives you <b>grammatical information</b>:
|
||||
an inflection table, if it is a single word,
|
||||
and a syntax tree otherwise.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The app also provides an <b>input method</b> which you can use as
|
||||
an alternative keyboard which allows you to do translation from
|
||||
other applications, for instance while you are entering SMS or e-mail.
|
||||
To activate it go to Settings > Language & input.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The translation works <b>completely off-line</b>, without
|
||||
internet connection, when doing text-based translation.
|
||||
Even speech works off-line in some languages,
|
||||
but being on-line may give you better
|
||||
speech input and output and more languages.
|
||||
</p>
|
||||
<p>
|
||||
You can also install third-party off-line speech engines, such as
|
||||
<a href="https://play.google.com/store/apps/developer?id=SVOX+Mobile+Voices&hl=en">SVOX</a>.
|
||||
Consult the voice/language settings on your phone to find the optimal
|
||||
speech engines, and restart the app after changing the settings.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The GF Offline Translator is powered by
|
||||
<a href="http://www.grammaticalframework.org/">GF</a>, Grammatical Framework.
|
||||
It is open-source software,
|
||||
built by support from the GF community and from <a href="http://www.digitalgrammars.com/">Digital Grammars</a>.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<i>Digital Grammars is a company that can tailor this app to you needs and provide good
|
||||
translation for the kind of vocabulary you need. Just tell us what you want to see
|
||||
in the green area!</i>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,92 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project name="MainActivity" default="help">
|
||||
|
||||
<!-- The local.properties file is created and updated by the 'android' tool.
|
||||
It contains the path to the SDK. It should *NOT* be checked into
|
||||
Version Control Systems. -->
|
||||
<property file="local.properties" />
|
||||
|
||||
<!-- The ant.properties file can be created by you. It is only edited by the
|
||||
'android' tool to add properties to it.
|
||||
This is the place to change some Ant specific build properties.
|
||||
Here are some properties you may want to change/update:
|
||||
|
||||
source.dir
|
||||
The name of the source directory. Default is 'src'.
|
||||
out.dir
|
||||
The name of the output directory. Default is 'bin'.
|
||||
|
||||
For other overridable properties, look at the beginning of the rules
|
||||
files in the SDK, at tools/ant/build.xml
|
||||
|
||||
Properties related to the SDK location or the project target should
|
||||
be updated using the 'android' tool with the 'update' action.
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems.
|
||||
|
||||
-->
|
||||
<property file="ant.properties" />
|
||||
|
||||
<!-- if sdk.dir was not set from one of the property file, then
|
||||
get it from the ANDROID_HOME env var.
|
||||
This must be done before we load project.properties since
|
||||
the proguard config can use sdk.dir -->
|
||||
<property environment="env" />
|
||||
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
|
||||
<isset property="env.ANDROID_HOME" />
|
||||
</condition>
|
||||
|
||||
<!-- The project.properties file is created and updated by the 'android'
|
||||
tool, as well as ADT.
|
||||
|
||||
This contains project specific properties such as project target, and library
|
||||
dependencies. Lower level build properties are stored in ant.properties
|
||||
(or in .classpath for Eclipse projects).
|
||||
|
||||
This file is an integral part of the build system for your
|
||||
application and should be checked into Version Control Systems. -->
|
||||
<loadproperties srcFile="project.properties" />
|
||||
|
||||
<!-- quick check on sdk.dir -->
|
||||
<fail
|
||||
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through the ANDROID_HOME environment variable."
|
||||
unless="sdk.dir"
|
||||
/>
|
||||
|
||||
<!--
|
||||
Import per project custom build rules if present at the root of the project.
|
||||
This is the place to put custom intermediary targets such as:
|
||||
-pre-build
|
||||
-pre-compile
|
||||
-post-compile (This is typically used for code obfuscation.
|
||||
Compiled code location: ${out.classes.absolute.dir}
|
||||
If this is not done in place, override ${out.dex.input.absolute.dir})
|
||||
-post-package
|
||||
-post-build
|
||||
-pre-clean
|
||||
-->
|
||||
<import file="custom_rules.xml" optional="true" />
|
||||
|
||||
<!-- Import the actual build file.
|
||||
|
||||
To customize existing targets, there are two options:
|
||||
- Customize only one target:
|
||||
- copy/paste the target into this file, *before* the
|
||||
<import> task.
|
||||
- customize it to your needs.
|
||||
- Customize the whole content of build.xml
|
||||
- copy/paste the content of the rules files (minus the top node)
|
||||
into this file, replacing the <import> task.
|
||||
- customize to your needs.
|
||||
|
||||
***********************
|
||||
****** IMPORTANT ******
|
||||
***********************
|
||||
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
|
||||
in order to avoid having your file be overridden by tools such as "android update project"
|
||||
-->
|
||||
<!-- version-tag: 1 -->
|
||||
<import file="/Users/aarne/Library/Android/apache-ant-1.9.4/fetch.xml" />
|
||||
|
||||
</project>
|
||||
@@ -1,60 +0,0 @@
|
||||
digraph {
|
||||
rankdir=LR ;
|
||||
node [shape = record] ;
|
||||
bgcolor = "#FFFFFF00" ;
|
||||
|
||||
struct0[label = "<n0>твоят | <n1>телефон | <n2>може | <n3>да | <n4>превежда"] ;
|
||||
struct0:n0:e -> struct1:n0:w ;
|
||||
struct0:n1:e -> struct1:n1:w ;
|
||||
struct0:n2:e -> struct1:n2:w ;
|
||||
struct0:n4:e -> struct1:n3:w ;
|
||||
struct1[label = "<n0>el teu | <n1>telèfon | <n2>sap | <n3>traduir"] ;
|
||||
struct1:n0:e -> struct2:n0:w ;
|
||||
struct1:n1:e -> struct2:n2:w ;
|
||||
struct1:n2:e -> struct2:n3:w ;
|
||||
struct1:n3:e -> struct2:n4:w ;
|
||||
struct2[label = "<n0>你 | <n1>的 | <n2>电 话 | <n3>会 | <n4>翻 译"] ;
|
||||
struct2:n0:e -> struct3:n0:w ;
|
||||
struct2:n2:e -> struct3:n1:w ;
|
||||
struct2:n3:e -> struct3:n2:w ;
|
||||
struct2:n4:e -> struct3:n3:w ;
|
||||
struct3[label = "<n0>je | <n1>telefoon | <n2>kan | <n3>vertalen"] ;
|
||||
struct3:n0:e -> struct4:n0:w ;
|
||||
struct3:n1:e -> struct4:n1:w ;
|
||||
struct3:n2:e -> struct4:n2:w ;
|
||||
struct3:n3:e -> struct4:n3:w ;
|
||||
struct4[label = "<n0>your | <n1>phone | <n2>can | <n3>translate"] ;
|
||||
struct4:n1:e -> struct5:n1:w ;
|
||||
struct4:n2:e -> struct5:n2:w ;
|
||||
struct4:n3:e -> struct5:n3:w ;
|
||||
struct5[label = "<n1>puhelimesi | <n2>osaa | <n3>kääntää"] ;
|
||||
struct5:n1:e -> struct6:n1:w ;
|
||||
struct5:n2:e -> struct6:n2:w ;
|
||||
struct5:n3:e -> struct6:n3:w ;
|
||||
struct6[label = "<n0>ton | <n1>téléphone | <n2>sait | <n3>traduire"] ;
|
||||
struct6:n0:e -> struct7:n0:w ;
|
||||
struct6:n1:e -> struct7:n1:w ;
|
||||
struct6:n2:e -> struct7:n2:w ;
|
||||
struct6:n3:e -> struct7:n3:w ;
|
||||
struct7[label = "<n0>dein | <n1>Telefon | <n2>kann | <n3>übersetzen"] ;
|
||||
struct7:n0:e -> struct8:n0:w ;
|
||||
struct7:n1:e -> struct8:n1:w ;
|
||||
struct7:n2:e -> struct8:n3:w ;
|
||||
struct7:n3:e -> struct8:n2:w ;
|
||||
struct8[label = "<n0>तुम्हारा | <n1>फोन | <n2>अनुवाद कर | <n3>सकता | <n4>है"] ;
|
||||
struct8:n0:e -> struct9:n1:w ;
|
||||
struct8:n1:e -> struct9:n2:w ;
|
||||
struct8:n2:e -> struct9:n4:w ;
|
||||
struct8:n3:e -> struct9:n3:w ;
|
||||
struct9[label = "<n0>il | <n1>tuo | <n2>telefono | <n3>sa | <n4>tradurre"] ;
|
||||
struct9:n1:e -> struct10:n0:w ;
|
||||
struct9:n2:e -> struct10:n1:w ;
|
||||
struct9:n3:e -> struct10:n2:w ;
|
||||
struct9:n4:e -> struct10:n3:w ;
|
||||
struct10[label = "<n0>tu | <n1>teléfono | <n2>sabe | <n3>traducir"] ;
|
||||
struct10:n0:e -> struct11:n0:w ;
|
||||
struct10:n1:e -> struct11:n1:w ;
|
||||
struct10:n2:e -> struct11:n2:w ;
|
||||
struct10:n3:e -> struct11:n3:w ;
|
||||
struct11[label = "<n0>din | <n1>telefon | <n2>kan | <n3>översätta"] ;
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<?xml-stylesheet type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata"?>
|
||||
|
||||
<svg width="1024" height="500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<filter id="A"><feGaussianBlur stdDeviation="2"/></filter>
|
||||
<defs>
|
||||
<linearGradient id="grad1" x1="0%" y1="0%" x2="0%" y2="100%">
|
||||
<stop offset="0%" style="stop-color:#a8d8ff;stop-opacity:1" />
|
||||
<stop offset="100%" style="stop-color:#f6f6f6;stop-opacity:1" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<rect width="1024" height="500" style="fill:url(#grad1)"/>
|
||||
<path filter="url(#A)"
|
||||
d="M120,270 v-51 h59 m-59,0 v-53 h114 a110.5,105 0 1,1 -24,-66"
|
||||
fill="none" stroke="black" stroke-width="4" opacity="0.25"
|
||||
stroke-linejoin="round" stroke-linecap="round"/>
|
||||
<path d="M120,270 v-51 h59 m-59,0 v-53 h114 a110.5,105 0 1,1 -24,-66"
|
||||
fill="none" stroke="red" stroke-width="4"
|
||||
stroke-linejoin="round" stroke-linecap="round"/>
|
||||
<text x="310" y="120" font-size="70" font-family="Inconsolata">Offline Translation</text>
|
||||
<text x="600" y="170" font-size="35" font-family="Inconsolata">with</text>
|
||||
<text x="270" y="240" font-size="70" font-family="Inconsolata" fill="black" opacity="0.25" filter="url(#A)">Grammatical Framework</text>
|
||||
<text x="270" y="240" font-size="70" font-family="Inconsolata" fill="#06c">Grammatical Framework</text>
|
||||
<image x="0" y="270" width="1024" height="200"
|
||||
xlink:href="gf-translator-alignment.png" />
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
@@ -1,46 +0,0 @@
|
||||
import SG
|
||||
import PGF2
|
||||
import Data.Char
|
||||
import Data.List
|
||||
|
||||
main = do
|
||||
db <- openSG "assets/semantics.db"
|
||||
inTransaction db $ do
|
||||
ls <- fmap lines $ readFile "../../../lib/src/translator/Dictionary.gf"
|
||||
let glosses = [x | Just (fn,gloss) <- map gloss ls, x <- glossTriples fn gloss]
|
||||
topics <- fmap (map toTriple . lines) $ readFile "topics.txt"
|
||||
sequence_ [insertTriple db s p o | (s,p,o) <- glosses++topics]
|
||||
closeSG db
|
||||
|
||||
toTriple l =
|
||||
case readTriple l of
|
||||
Just t -> t
|
||||
Nothing -> error ("topics.txt: "++l)
|
||||
|
||||
gloss l =
|
||||
case words l of
|
||||
("fun":fn:_) -> case dropWhile (/='\t') l of
|
||||
'\t':l -> Just (fn,l)
|
||||
_ -> Nothing
|
||||
_ -> Nothing
|
||||
|
||||
glossTriples fn s =
|
||||
(if null gs then [] else [(fn_e,gloss,mkStr (merge gs))])++
|
||||
(if null es then [] else [(fn_e,example,mkStr (merge (map (init . tail) es)))])
|
||||
where
|
||||
fn_e = mkApp fn []
|
||||
gloss = mkApp "gloss" []
|
||||
example = mkApp "example" []
|
||||
(es,gs) = partition isExample (splitGloss s)
|
||||
|
||||
splitGloss s =
|
||||
let (xs,s') = break (==';') s
|
||||
in trim xs : case s' of
|
||||
';':s -> splitGloss s
|
||||
_ -> []
|
||||
where
|
||||
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
|
||||
|
||||
merge = intercalate "; "
|
||||
|
||||
isExample s = not (null s) && head s == '"' && last s == '"'
|
||||
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<?xml-stylesheet type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata"?>
|
||||
|
||||
<svg width="250" height="250" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
||||
<desc>Digital Grammar Logo</desc>
|
||||
|
||||
<path d="M205,200 a110,110 0 1,1 0,-150 M125,15 v110 h80 M165,95 v60 M205,95 v60" fill="none" stroke="red" stroke-width="14" stroke-linejoin="round" stroke-linecap="round"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 529 B |
@@ -1,28 +0,0 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
|
||||
jni_c_files := jpgf.c jsg.c jni_utils.c
|
||||
sg_c_files := sg.c sqlite3Btree.c
|
||||
pgf_c_files := data.c expr.c graphviz.c linearizer.c literals.c parser.c parseval.c pgf.c printer.c reader.c \
|
||||
reasoner.c evaluator.c jit.c typechecker.c lookup.c aligner.c writer.c
|
||||
gu_c_files := assert.c choice.c exn.c fun.c in.c map.c out.c utf8.c \
|
||||
bits.c defs.c enum.c file.c hash.c mem.c prime.c seq.c string.c ucs.c variant.c
|
||||
|
||||
LOCAL_MODULE := jpgf
|
||||
LOCAL_SRC_FILES := $(addprefix ../../../runtime/java/, $(jni_c_files)) \
|
||||
$(addprefix ../../../runtime/c/sg/, $(sg_c_files)) \
|
||||
$(addprefix ../../../runtime/c/pgf/, $(pgf_c_files)) \
|
||||
$(addprefix ../../../runtime/c/gu/, $(gu_c_files))
|
||||
LOCAL_C_INCLUDES := ../../../runtime/c
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
$(realpath ../obj/local/armeabi/objs/jpgf/__/__/__/runtime/c/pgf/jit.o): lightning
|
||||
$(realpath ../obj/local/armeabi/objs-debug/jpgf/__/__/__/runtime/c/pgf/jit.o): lightning
|
||||
|
||||
lightning:
|
||||
ln -s -f arm/asm.h ../../../runtime/c/pgf/lightning/asm.h
|
||||
ln -s -f arm/core.h ../../../runtime/c/pgf/lightning/core.h
|
||||
ln -s -f arm/fp.h ../../../runtime/c/pgf/lightning/fp.h
|
||||
ln -s -f arm/funcs.h ../../../runtime/c/pgf/lightning/funcs.h
|
||||
@@ -1,3 +0,0 @@
|
||||
APP_PLATFORM := android-8
|
||||
APP_CFLAGS := -std=gnu99
|
||||
APP_OPTIM := release
|
||||
@@ -1,20 +0,0 @@
|
||||
# To enable ProGuard in your project, edit project.properties
|
||||
# to define the proguard.config property as described in that file.
|
||||
#
|
||||
# Add project specific ProGuard rules here.
|
||||
# By default, the flags in this file are appended to flags specified
|
||||
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||
# You can edit the include path and order by changing the ProGuard
|
||||
# include property in project.properties.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# Add any project specific keep options here:
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
@@ -1,14 +0,0 @@
|
||||
# This file is automatically generated by Android Tools.
|
||||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||
#
|
||||
# This file must be checked in Version Control Systems.
|
||||
#
|
||||
# To customize properties used by the Ant build system edit
|
||||
# "ant.properties", and override values to adapt the script to your
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-21
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 436 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 695 B |
|
Before Width: | Height: | Size: 665 B |
|
Before Width: | Height: | Size: 390 B |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 885 B |