FSA_RECOGNIZER ------------------------------- This distribution contains Python code for an top down parser/recognizer module. INSTALL --------------------- To install untar the tar ball (directions below) and connect to the directory created (named fsa_recognizer.0-1, or whatever the current version is). In linux: % python setup.py install To install in Windows: > C:\Python24\python.exe setup.py install Your version of Python may of course be installed in a different directory and the path to your Python.exe would then differ. RUN ---- >>> from td_parser import * >>> strings = ['John likes Mary', 'The boy likes the girl', 'Eat beans'] >>> demo(strings) The demo function is defined at the bottom of the file and includes a grammar example. DOCUMENTATION ------------------ The source code for the distribution is installed in the site-packages directory of your python distribution. For example in Linux, this is often /usr/local/lib/python2.4/site-packages/td_parser The documentation is in /usr/local/lib/python2.4/site-packages/td_parser/doc Point your browser at: /usr/local/lib/python2.4/site-packages/td_parser/doc/index.html UNTARRING the TAR Ball (*.tar.gz file) ------------------------------------------ 1. Linux. Conect to the directory containing the tar file on your home machine. Then do. % tar xzvf td_parser-0.1.tar.gz This will create a subdirectory of the download directory called td_parser-0.1. Connect to that directory (it should contain a file called setup.py) and follow the directions above for installation. 2. Windows. You should use Python's tar package. USING Python's Tar package (for Windows folks) illustrated with Python 2.3.4 [works with that version or later) You should connect to whatever directory you have placed the tar.gz file in on your home machine. THEN start up python there. C:\Downloads > C:\Python24\python.exe --------------------------------------------- Python 2.3.4 (#1, Oct 26 2004, 16:42:40) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tarfile >>> FileObj = tarfile.open('td_parser-0.1.tar.gz','rb:gz') >>> FileObj >>> for tinfo in FileObj: ... FileObj.extract(tinfo) ... >>> This will create a subdirectory of the download directory called td_parser-0.1. Connect to that directory (it should contain a file called setup.py) and follow the directions above for installation.