| Age | Commit message (Collapse) | Author |
|
pgf-service now appears to works with Apache mod_fastcgi (under Mac OS X) in
addition to lighttpd.
One difference appears to be that while lighttpd passes the name of the PGF
file in the SCRIPT_FILENAME variable, Apache passes it in PATH_TRANSLATED.
But perhaps this depends on exactly how the fastcgi service is configured.
The following is what I added to the Apache configuration file to test this:
<Directory /Library/WebServer/Documents/fcgi-bin>
SetHandler fastcgi-script
Options +ExecCGI
</Directory>
Action pgf-service /fcgi-bin/pgf-service
AddHandler pgf-service .pgf
|
|
|
|
* Use cabal install -ffastcgi to compile the fastcgi server.
* Use cabal install -fcontent to compile the content service (off by default,
currently broken)
* Use both flag to compile both.
|
|
|
|
|
|
|
|
content-server is not going to be built
|
|
informative
|
|
|
|
content-service depends on hsql-mysql, which depends on a C library, so like
fastcgi, only compile it if you ask for it explicitly with -ffastcgi.
|
|
If you want the fastcgi server, use cabal install -ffastcgi.
This is to avoid problems when you only want to compile pgf-http and the
fastcgi library fails to install, which it usually does, since it depends on
a C library which is not installed automatically with cabal.
|
|
The Content-Type used to be text/json, but this caused warning messages in
some web browers.
|
|
|
|
Along with the changes to Setup.hs it should now be enough to do
cabal install
pgf-http
open http://localhost:41296/
to run the PGF service locally and play with some example grammars in minibar.
|
|
The document root is now part of the arguments passed to runHTTP.
|
|
Together with the changes to pgf-http, this should make it much easier to run
the PGF service and minibar locally.
|
|
The dependency on the fastcgi package made pgf-server difficult to compile, so
it is now split into
- pgf-fgci (main module in pgf-fcgi.hs), which is built only if fastcgi is
already installed or if you turn on the fastcgi flag (e.g. by doing
'cabal install -f fastcgi').
- pgf-http (main module in pgf-http.hs) which is always built (and hopefully
has no problematic dependencies.)
The modules FastCGIUtils and PGFService no longer depend on fastcgi.
|
|
Example:
Request: http://www.grammaticalframework.org:41296/grammars/Quiz.pgf?command=linearizeAll&tree=Run+YouPl
Response: [{"to":"QuizEng","texts":["you run"]},
{"to":"QuizSwe","texts":["ni l??per","ni springer"]}]
Compared to the old command linearize:
Request: http://www.grammaticalframework.org:41296/grammars/Quiz.pgf?command=linearize&tree=Run+YouPl'
Response: [{"to":"QuizEng","text":"you run"},
{"to":"QuizSwe","text":"ni l??per"}]
|
|
|
|
+ PGFService.hs: add Nothing arguments in calls to PGF.parse_ and
PGF.getPArseOutput
+ gf-server.cabal: mark content-server as not buildable, since required source
files are missing.
|
|
functions now return both the generated tree and its linearization
|
|
in the types
|
|
in the abstract syntax
|
|
|
|
When pfg-server servers a static file in HTTP mode, it is output as is, so
specifying charset="iso-8859-1" could be wrong.
Note: the a charset can be specified with a meta tag in HTML files,
e.g. for files in UTF-8:
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
|
|
It is needed for the userLanguage field in the grammar info from pgf-server
|
|
prevented the fridge and translate web apps from working
queryToArguments "?&input=bla+bla"
returns [("&input","bla+bla")]
but should return [("input","bla bla")]
|
|
refers to a directory
|
|
HTTP mode
|
|
pgf-server can now act as a standalone HTTP server. To activate this mode,
start it with
pfg-server http
to use the default port number (41296), or give an explicit port number, e.g.,
pgf-server http 8080
The HTTP server serves PGF files in the same way as the old FastCGI interface.
In addition, it also serves static files. The document root for static files
is the www subdirectory of the current directory where pgf-server is started.
In spite of these addition, backwards compatibility is maintaned. The old
FastCGI interface continues to work as before. (It is activated when
pgf-server is started without arguments.)
|
|
parse forest
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
show all alternative disambiguations for each alternative translation
|
|
functionality is exposed by parse_
|
|
|
|
|
|
binary for the output
|
|
|
|
|