Description
LinkGrammar is a sentence parsing system developed at Carnegie Mellon University by John Lafferty, Daniel Sleator, Davy Temperley and others
LinkGrammar is written in C. This package contains a Pythonic interface to the C library.
Sourcecode is hosted on BitBucket: https://www.bitbucket.org/metametrics/pylinkgrammar/
Install
You’ll need to build and install linkgrammar before running setup.py. Verified to work with linkgrammar 4.7.6 and above.
On Ubuntu systems you install the dependencies like so:
sudo apt-add-repository ppa:python-pylinkgrammar/getsome sudo apt-get install liblink-grammar4
Then to install pylinkgrammar:
pip install pylinkgrammar
How to use
Parsing simple sentences:
>>> from pylinkgrammar.linkgrammar import Parser
>>> p = Parser()
>>> linkages = p.parse_sent("This is a simple sentence.")
>>> len(linkages)
2
>>> print linkages[0].diagram
+-------------------Xp------------------+
| +--------Ost-------+ |
| | +-------Ds------+ |
+---Wd---+-Ss*b+ | +----A----+ |
| | | | | | |
LEFT-WALL this.p is.v a simple.a sentence.n .
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pylinkgrammar-0.2.14.tar.gz
(14.3 kB
view details)
File details
Details for the file pylinkgrammar-0.2.14.tar.gz.
File metadata
- Download URL: pylinkgrammar-0.2.14.tar.gz
- Upload date:
- Size: 14.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8db0e9bbc036b7fa4cfac0771fa92d1eeff2f5696804a47820e348f6e860a08
|
|
| MD5 |
975c341d274698773a2b26d8cc886478
|
|
| BLAKE2b-256 |
306decf22d016279bda0887f48993646a63c5219085f25fd0c8d88a7358486bd
|