Reinvent The Wheel

Round is nice, but we can do better!

Link-Grammar Parser

Link-Grammar Parser Demo

Link-Grammar Parser Demo

Last Updated: 30th January 2011
Current Link-Grammar Parser version supported: 4.7.2 (From the official SVN repository)

What is the Link-Grammar Parser?

The easiest way to describe it is to simply quote the original Link-Grammar Parser project’s website:

The Link Grammar Parser is a syntactic parser of English (and other languages as well), based on link grammar, an original theory of English syntax. Given a sentence, the system assigns to it a syntactic structure, which consists of a set of labelled links connecting pairs of words. The parser also produces a “constituent” (Penn tree-bank style phrase tree) representation of a sentence (showing noun phrases, verb phrases, etc.). The RelEx extension provides dependency-parse output.

What kind of functionality does this wrapper provide?

In a nut-shell, all of it! Every single method exposed by the Link-Grammar Parser’s API has been painstakingly translated into a Pascal source unit, along with many of the C-defined Structures.

The development plan for this little project involves the construction of a TLinkGrammar component to make integration of the Link-Grammar Parser as simple as it physically can be. Once this component is ready, the translated Structures (defined in the unit as Records) will be removed as they will no longer be of any use.

Download Link-Grammar Parser for Delphi now!

The package contains the following files:

  • \Bin\Link-Grammar.dllThe actual Link-Grammar Parser DLL (Current version 4.7.2)
  • \Bin\regex2.dllThe GnuWin32 Regular Expression binary (compiled from its C sources)
  • \Bin\[de, en, it] - Folders containing the current Dictionaries (you can get others from the SVN repository)
  • \Demos\1 – Test App\MainForm.dfmThe included demo’s form
  • \Demos\1 – Test App\MainForm.pas - The included demo’s source
  • \Demos\1 – Test App\TestApp.[cfg, dof, dpr, dproj]The various files which compose the demo project itself
  • \Demos\1 – Test App\TestApp.exeA working build of my simple LGP for Delphi demo.
  • \Lib\LinkGrammar.pas - The Link-Grammar Parser Wrapper for Delphi (the reason you’re reading this)

LGP for Delphi < Download it here (1.03MB). WARNING: THIS ZIP FILE IS OUTDATED! USE THE SVN REPOSITORY INSTEAD!

SVN Repository

URL: http://svn.lakraven.com:81/svn/OpenSource/Link-Grammar/
Username and Password: anon

Note: You might need the Microsoft Visual C++ 2008 Redistributable Package because Link-Grammar.dll was built in MSVC++ 2008.

Disclaimer: All files have been scanned with Kaspersky Internet Security 2011 (100% up-to-date) and are confirmed absolutely clean (makes sense given that I built all the binaries myself), however… I (Simon J Stuart) may not be held accountable for any losses or damages (be they physical, emotional, financial or chronological in nature) caused as a result or during the use of any of the files (including but not limited to: compiled binaries, sources, media) downloaded from this website. You download all files at your own risk. I (Simon J Stuart) do not warranty or guarantee (implicitly or otherwise) that any of the sources and/or files will be suitable for any purpose, and cannot be held liable should the sources/files not meet any of your expectations/requirements.

Useful Links:

Acknowledgements:

  • Dr. Richard D. Cooper - for introducing me to the Link-Grammar Parser in the first place
  • Linas Vepstas – for keeping the project alive and being so patient when the “big push” was made to simplify building LGP on the Windows (MSVC++) platform
  • Borislav Iordanov – for being absolutely instrumental in getting LGP to build properly on the Windows (MSVC++) platform
  • Daniel Sleator – I’m informed is the gentleman who started it all

8 Comments

  1. Wow, how long has this dll been available? I was looking for something like this :)

  2. Hi, I’m looking for a wrapper so I can use the API in Microsoft VB/Access….. is this possible or available?

    • It is, of course, possible to produce a VB/VBA wrapper for the LGP, however I long ago left the Basic language, back in the days of DOS, and haven’t looked back. This means that I’m not the right guy to ask to produce such a thing.
      If you have a rudimentary understanding of DLL Linking in Basic, you should be able to produce a wrapper simply enough! All of the functions exported by the DLL have their prototypes shown clearly in my Pascal wrapper unit, along with the parameter and return types. It may be easier to use my Pascal source as a reference than translating the function headers from their original C source (not to mention the exploratory work required to find the exported function prototypes in the original C source).

      I also suggest posting your request on the official LGP mailing group, as somebody there may already have produced a VB/VBA wrapper for the LGP. The link to the mailing group is in this post above.

  3. you should credit Daniel Sleator who originally did this work.

  4. This looks like pretty interesting stuff. I have downloaded it, and find it a little beyond my skill set.

    If I could ask two quick questions…

    1). Where do I find more info?
    2). I am needing a subset of this functionality. In your demo, how would I get a list of tokens and their usage? For example (word 1 = Noun, Word 2 = Verb, etc).

    Awesome work. Thanks for making this available.

Leave a Reply

Required fields are marked *.

*


*