Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | A binding to use the Link Grammar library from SWI-Prolog |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 4.1.0.3 |
SHA1 sum: | d45c24cafac61f63245318981691f306977d393f |
Author: | Lionel Ains <lains@gmx.net> |
Maintainer: | Lionel Ains <lains@gmx.net> |
Packager: | Lionel Ains <lains@gmx.net> |
Home page: | https://github.com/lains/link_grammar_prolog |
Download URL: | https://github.com/lains/link_grammar_prolog/releases/download/link_grammar_prolog-4.1.0.3/link_grammar_prolog-4.1.0.3.zip |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
4.1.0.1 | 8343bacf2cfd00ff1be0b113a3fe50784f161fe3 | 1 | https://github.com/lains/link_grammar_prolog/releases/download/link_grammar_prolog-4.1.0.1/link_grammar_prolog-4.1.0.1.zip |
4.1.0.2 | 25246cebfdfe03a25719c673ebde6ce854c5bdbe | 3 | https://github.com/lains/link_grammar_prolog/releases/download/link_grammar_prolog-4.1.0.2/link_grammar_prolog-4.1.0.2.zip |
4.1.0.3 | d45c24cafac61f63245318981691f306977d393f | 49 | https://github.com/lains/link_grammar_prolog/releases/download/link_grammar_prolog-4.1.0.3/link_grammar_prolog-4.1.0.3.zip |
This library provides a SWI-Prolog binding to the Link Grammar library
The Link Grammar library is a syntactic parser based on link grammar. Given a sentence, the system assigns to it a syntactic structure, which consists of a set of labeled links connecting pairs of words. The parser also produces a "constituent" representation of a sentence (showing noun phrases, verb phrases, etc.).
You can either download the sources and install the package (library) manually or install the package online from Github. Under Windows, online installation is recommended (see below). Under Linux, recompilation is recommended instead (see BUILD.md).
This is the easiest way to install.
Open the SWI-Prolog command-line interface and type:
?- pack_install('link_grammar_prolog').
If this fails, you can try to install from a Github archive (see below)
First, check the latest release of the package by looking at the release page
Write down the URL of the archive download (not the source code archive, but directly package file named `link_grammar_prolog-*.zip`)
Open the SWI-Prolog command-line interface and type:
?- pack_install('https://github.com/lains/link_grammar_prolog/releases/download/link_grammar_prolog-*/link_grammar_prolog-*.zip').
Note: replace the above line by the correct URL you wrote down at the previous step.
To install from sources, please refer to BUILD.md
Once the compilation succeeds, the library should be installed. You can check this from the Prolog prompt:
?- pack_list_installed.
This should return (among other possible packages), the link-grammar-binding package.
The Link grammar library requires several database files and directories in order to run. This data directory contains:
data
files when compiling from sources
If you recompile the package from source, the data files are downloaded as part of the build process and the data
directory is populated in the pack.
you will find these files/directories in the subdirectory `data/` under the directory where the pack has been installed.
To find out the location of this directory, just type the following on the SWI-Prolog prompt:
?- pack_property('link_grammar_prolog', directory(Pack_dir)),atom_concat(Pack_dir, '/data', Data_dir).
The result will be displayed as Data_dir
data
files when doing an online installationWhen using the online installation, you will have to manually download the data directory directly from the original sources of the Link Grammar library and save it locally before you can use create_dictionary/5 below.
In order to load the library, just do:
?- use_module(library(lgp)).
You can now either move to the data
directory or you will have to use an absolute/relative path to the 4 files provided as argument of create_dictionary/5:
Now, you can create a dictionary and start parsing sentences:
?- lgp:create_dictionary('4.0.dict', '4.0.knowledge', '4.0.constituent-knowledge', '4.0.affix', Dictionary_handle).
For detailed instructions, on how to use the current Link Grammar (v4.1b) please refer to [the documentation embedded inside the sources](patches/4.1b//README.md)
Pack contains 18 files holding a total of 1.1M bytes.