skip to navigation
skip to content

Not Logged In

pylinkgrammar 0.2.13

Python bindings for Link Grammar system

Latest Version: 0.2.14

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 .
 
File Type Py Version Uploaded on Size
pylinkgrammar-0.2.13.tar.gz (md5) Source 2012-10-11 13KB
  • Downloads (All Versions):
  • 87 downloads in the last day
  • 372 downloads in the last week
  • 2431 downloads in the last month