Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bozsahin/ccglab
Combinatory Categorial Grammar (CCG): Full set CCG, and probabilistic CCG
https://github.com/bozsahin/ccglab
Last synced: 3 months ago
JSON representation
Combinatory Categorial Grammar (CCG): Full set CCG, and probabilistic CCG
- Host: GitHub
- URL: https://github.com/bozsahin/ccglab
- Owner: bozsahin
- License: other
- Created: 2016-12-07T13:16:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-29T15:32:55.000Z (over 1 year ago)
- Last Synced: 2024-01-22T19:21:35.593Z (10 months ago)
- Language: Common Lisp
- Homepage:
- Size: 4.22 MB
- Stars: 26
- Watchers: 9
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-nlg - CCG Lab - All combinators, common grammar format, parsing to logical form, parameter estimation for probabilistic CCG. (Grammar)
README
# ccglab
Combinatory Categorial Grammar (CCG): CCG and probabilistic CCG, with full set of combinators and their powers.
CCGlab
isCommon Lisp
code with somebash
scripts for install and run-time tokenization.
CCGlab
needs a linux, a native one or one in macosphere or windowsphere.INSTALL FOR LINUXSPHERE AND MACOSPHERE
Depending on your package manager, which is assumed to be either
dnf, yum, apt-get, pacman, brew
(in this pecking order if all are present in your system),
it will fetchsbcl
andrlwrap
(if not already present in your system). All linuxsphere (rolling and nonrolling distros, MACOS, Windows's WSL linux distros) have standard packages for these tools.You can then run the
ccglab
script from anywhere after install.Latest release is shown by
(which-ccglab).
Announced git releases may be slightly behind the latest,
which is always this copy. Just clone this repo rather than download the release if you want the latest.INSTALL FOR WINDOWS
You need a linux system for CCGlab. Once you get that, follow the instructions for Linuxsphere for CCGlab install.
There are three options for windows (I recommend the first one):
- For windows 10 onwards: Follow these directions. No partitions, no virtualbox, no hassles. You now have linux as a W10 app with ccglab in it.
- For windows earlier than W10: install a virtual box such as Oracle's: https://www.virtualbox.org/.
Then follow one of the advices below for linuxes for ccglab install, depending on your virtual machine.
I recommend setting up an Ubuntu or Mint virtualbox if you have no prior linux experience.
If you use CCGLAB from a virtualbox, save your machine state rather than power off the virtual machine.
You won't have to do all of the above over and over.- For any windows: put a linux partition in your machine, and follow the instructions below
depending on your linux. This one is for experienced users. This option is becoming easier too.MANUAL INSTALL
If you're tired of weird defaults of linux installers, try the safe and longer way:
somewhere in your machine, and set and
export
the following bash variables:
-
CCGLAB_HOME
to where theccglab
repo is -
LALR_HOME
to where you saved lalrparser.lisp -
CCGLAB_LISP
to full path of your ANSI Common Lisp binary -
RLWRAP
to path ofrlwrap
if you have it, otherwise nil, i.e.RLWRAP=
-
PATH=:.:$CCGLAB_HOME/bin:$PATH
to overrride earlier installs of ccglab. - Then open a new
bash
terminal and runccglab
Here is my local setup in ~/.bashrc
file (create one if you don't have it):
export CCGLAB_HOME=$HOME/mysrc/myrepos/ccglab
export LALR_HOME=$HOME/mysrc/lisp
export CCGLAB_LISP=/usr/local/bin/sbcl
export RLWRAP=rlwrap
export PATH=:.:$CCGLAB_HOME/bin:$PATH
And here is my ~/.bash_profile
file (create one if you don't have it---bash may or may not use both):
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
The installer fetches the relevant sources (lalrparser, sbcl, rlwrap) and does the manual install automatically, and saves it in the files .bash_profile, .bashrc
at your home.
Also have a look at the companion repo called ccglab-database, which contains grammars and models developed in CCGlab
COMMON LISPs FOR CCGLAB
SBCL and CCL Common Lisps are usable out of the box for CCGlab. The install
script sets up SBCL for CCGlab if you haven't got one already. If you have an ANSI Common Lisp, it can work with it too.
GCL and CLisp are ANSI but the first one does not come with CLOS, and CLisp has weird locks on standard package files to turn them on. This is unfortunate because some CCGlab macros
for the Lisp reader needs methods, therefore not usable in GCL/Clisp out of the box.
I added Allegro CL support for CCGlab (for calling bash scripts etc.), but somewhat reluctantly. Its free versions are so cryptic about heap control
you will avoid it, and spend most of your time garbage-collecting rather than doing useful work. Not worth it, folks.
Design and development of CCGlab continues to be in SBCL, then occasionally checked with CCL. SBCL developers, you are my heros.
THE WRAPPER
You will appreciate the peace and comfort of the command-recaller rlwrap
when you use a command-line tool like CCGlab. I am personally eternally grateful to its developers.
THE CCG WRAPPER
Steedman-notation for CCG is probably not SLR-parsable. I remember getting reduce-reduce conflicts in SLR which I didn't know
how to eliminate without changing the notation. Thanks to Mark Johnson for the LALR parser, which is sufficient for CCG lexical entry and rule recognition.
enjoy.
--Cem Bozsahin