From 6e3321d7126742e16e21289e5fac03192c793075 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 3 Dec 2012 09:09:08 +0000 Subject: [PATCH] added INSTALL file and updated README file for the C runtime --- src/runtime/c/INSTALL | 24 +++++++++++++++++++++++ src/runtime/c/README | 45 ++++++++++++++++++++----------------------- 2 files changed, 45 insertions(+), 24 deletions(-) create mode 100644 src/runtime/c/INSTALL diff --git a/src/runtime/c/INSTALL b/src/runtime/c/INSTALL new file mode 100644 index 000000000..a11d2dbe7 --- /dev/null +++ b/src/runtime/c/INSTALL @@ -0,0 +1,24 @@ +The compilation steps are: + +$ autoreconf -i +$ ./configure +$ make +$ make install + +If you want to use the statistical ranking in the parser then you +have to compile your grammar with the option '-probs=grammar.probs', +where grammar.probs must contain a tab separated file with +the probabilities for all functions in the abstract syntax. +In order to enable the named entity recongizer for the ParseEngAbs +grammar you also have to add the option '-literal=Symb' while compiling. + +Note For Mac OSX users +---------------------- + +You have to comment out the following line in config.h: + + #define HAVE_STATEMENT_EXPRESSIONS 1 + +This has to be done AFTER you have called './configure', but before you call 'make'! + +(Tested on Mac OSX 10.8 Mountain Lion with XCode installed) diff --git a/src/runtime/c/README b/src/runtime/c/README index 61f4113be..8d7b108de 100644 --- a/src/runtime/c/README +++ b/src/runtime/c/README @@ -7,7 +7,10 @@ This release is not yet ready for production use: essential functionality is still missing, the API is still likely to change, and the documentation is incomplete. This release is primarily meant for developers who are interested in using libpgf, and who wish to -contribute to its design. +contribute to its design. An essential feature which distinguishes +libpgf from the reference Haskell implementation is that +the parser is able to use statistical disambiguation models +while parsing and that it can be robust for ungrammatical sentences. PREREQUISITES @@ -41,31 +44,18 @@ interesting special configuration options. Pkg-config configuration files for the library are also provided. - -Note For Mac OSX users ----------------------- - -You have to comment out the following line in config.h: - - #define HAVE_STATEMENT_EXPRESSIONS 1 - -This has to be done AFTER you have called './configure', but before you call 'make'! - -(Tested on Mac OSX 10.8 Mountain Lion with XCode installed) - - STATUS ------ -Currently only very basic PGF functionality is supported, enough to -translate sentences of the Phrasebook grammar in the GF distribution. -Among missing features are: +Currently only very basic PGF functionality is supported. The focus +is on the experimental statistical parser and many other features +which are not essential in this aspect are still missing: -- querying a parser for tokens expected next -- literals and custom categories - higher-order abstract syntax variables - type checking and inference +- dependent types - generation of random syntax trees +- linearization of incomplete trees Most of these will eventually get added. @@ -79,6 +69,11 @@ purposes and for demonstrating how to use the library. The pgf2yaml program simply reads a PGF file from the standard input and dumps it to the standard output in YAML format. +The pgf-print program reads a PGF file from the standard input and +dumps it to the standard output in the same format that the Haskell +implementation provides when the option -output-format=pgf_pretty +is passed to the compiler. + The pgf-translate program translates sentences of one language in a PGF grammar into another. It is invoked: @@ -89,9 +84,11 @@ are to be translated, and FROM_LANG and TO_LANG are names of concrete grammars within the PGF file. The program prompts for a line containing a full sentence of the -specified category in the source language, and displays the syntax trees -and destination language linearizations of all possible parses of that -sentence. +specified category in the source language, and displays the +best syntax tree according to the statistical model. +If linearization in the target language is possible then +it is displayed. If you want the next best tree then +just press enter again without typing anything else in the command line. LIBGU @@ -127,5 +124,5 @@ GF mailing list at or . For questions and comments that are related to the core libgu library, -but not to PGF, please write directly to the author at -. +but not to PGF, please write directly to the authors at + or .