Skip to content

Clone of MiguelSDC's modified version of SCFG parser

License

Notifications You must be signed in to change notification settings

dbdq/sartparser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(This is a full clone of Miguel SDC's repo for backup purpose only.)

SARTParser is an open source library which can parse Stochastic Context Free Grammars.

It was originally created by Yuri Ivanov in 1997 and it was recently cleaned up by Miguel Sarabia (with some help from KyuHwa Lee).

Related bibliography:

Installation instructions

SARTParser depends only on Eigen (> 3.0.0) and requires CMake (> 2.8.3). Doxygen (> 1.8.6) is needed to generate the documentation. For the python bindings Boost.Python and the devel files for Python should be available as well.

On ubuntu, you can install these dependencies with:

sudo apt-get install libeigen3-dev cmake doxygen libboost-python-dev python-dev

If you're reading this you probably already have the source code, but otherwise you can download it from here. Alternatively, if you have mercurial installed you may clone the project:

hg clone https://bitbucket.org/miguelsdc/sartparser SARTParser

Compilation follows the normal template of CMake projects; that is:

cd SARTParser
mkdir build
cmake ../ -DCMAKE_BUILD_TYPE=Release
make
make install

If you want to install the Python bindings in your system, issue:

make install_python

Optionally, to generate the documentation execute:

make doc

Q&A:

Q: Can I browse the documentation online?

A: Sure thing, just follow this link.


Q: Is there a tutorial to get me started?

A: Yup, online and under the root of the project (TUTORIAL.md).


Q: Is this thing fast?

A: Reasonably so. The library is written in C++, and has been profiled and sped-up several times. However, stochastic grammars have an exponential parsing complexity, so if you give it a very complex grammar or too many inputs it will eventually grind your computer to a halt.

To get a feeling for it, you may want to run a few of the examples.


Q: What can you tell me about multi-threading?

A: The library does not use threads internally and the different classes are not thread-safe. If using in a multithreaded environment you should ensure single-access before calling any non-const methods.

However, the library does not have static instances and there is nothing to stop you from running several different parsers concurrently.


Q: Why does the code look so insconsistent?

A: Some parts of the code go back to 1997 (that is, before C++ was an ISO standard!). And there have been different authors with different coding styles. Patches are always welcome though.


Q: Is there any support for Python3?

A: The actual bindings are bilingual (courtesy of Boost.Python). However, in order to keep the CMake files sane, only the version of Boost.Python supports by default will be used. In most machines that will be Python2. But in some it will be Python3. CMake will tell you for which version it's compiling the bindings.


Q: But I want to use Python <X.Y>?!

A: Your best bet is to compile your own Boost.Python which defaults to the correct version of Python. Alternatively, you may want to hack src/python/CMakeLists.txt to make it bow to your wishes.

About

Clone of MiguelSDC's modified version of SCFG parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published