summaryrefslogtreecommitdiff
path: root/src/server/PGFService.hs
AgeCommit message (Collapse)Author
2012-11-22PGFService.hs: fix type error caused by change to PGF.graphvizParseTreehallgren
Note that some of the graphviz functions have backwards incompatible changes that might also affect other clients of the PGF run-time library. Also added graphvizDefaults and export it together with GraphvizOptions from the PGF run-time library.
2012-11-17PGF service: command=browse&format=json returns info on all cats and funshallgren
The browse command used to have a required parameter id=... and it returned info on the given identifier only. Now, if format=json, the id=... parameter can be omitted to get info on all identifiers at the same time. The returned JSON structure in this case is {cats:{...},funs:{...}} where the inner objects contain one field per category and function, respectively, in the same format as when you request info on one category or function.
2012-09-30PGF service & minibar: put a limit on the number of parse treeshallgren
+ In the PGF web service API, the commands parse, translate and translategroup now accept a limit parameter. It limits the number of parse trees returned. If no limit is given, the behaviour is backwards compatible, i.e. no limit is applied. + In minibar, the limit is now set to 25 by default. This change is based on a suggestion by Kaarel Kaljurand.
2012-04-02PGFService.hs: add web API function "abstrjson"hallgren
Abstract syntax trees are represented as strings in the web API. To make them easier to manipulate in JavaScript, the new function converts them to JSON. To support structural editing, the nodes are numbered in the same way as in the bracketed string created when linearizing an abstract syntax tree. Example: "Pred (That Fish) Fresh" is converted to {fun:"Pred",fid:3, children:[{fun:"That",fid:1, children:[{fun:"Fish",fid:0}]}, {fun:"Fresh",fid:2}]}
2012-03-18PGF run-time library: function names in BracketedString (experimental)hallgren
+ Make room for function names in the BracketedString data structure. + Fill in function names when linearizing an abstract syntax tree to a BracketedString. + Fill in wildCId when it is not obvious what the function is. + Function bracketedLinearize: for compatibility with the other linearization functions, return Leaf "" instead of error "cannot linearize". + Export flattenBracketedString from module PGF. + PGFServce: make function names available in the JSON representation of BracketedString.
2012-03-16PGFService.hs: command=browse can now produce output in JSON format.hallgren
To get JSON output, add the parameter format=json. The JSON structure contains the output from the function PGF.browse. The default is format=html for backwards compatibility.
2012-03-08PGFService.hs: add output format option to the commands abstrtree, parsetree ↵hallgren
and alignment Supported output formats: gv, png, svg.
2012-02-29PGFService.hs bug fix: pattern match failure in doParsehallgren
doParse was missing a branch for PGF.ParseIncomplete. Also introduced the operator .= to simply the code that builds JSON objects.
2011-10-18pgf service: include the start category in grammar infohallgren
2011-08-24pgf-service: apply the OpenMath LaTeX function only when linearizing to ahallgren
concrete language whose name ends with LaTeX. This change also avoids duplicating output and, in addition to the linearize command, applies the transfer also when using the linearizeAll command.
2011-08-23pgf-service: add Jordis transfer function for OpenMath LaTeX outputhallgren
2011-08-22pgf service: external service hook: always format the output as a JSON stringhallgren
2011-08-22pgf service: added a hook for external serviceshallgren
This is really reinventing CGI, people should learn how to write CGI scripts instead... TODO: better handling of temporary files
2011-06-21gf-server: make pgf-service work the Apache mod_fastcgihallgren
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
2011-03-07the user can now upload their own grammars in the editorkrasimir
2010-11-26Split pgf-server into pgf-fcgi and pgf-http.hallgren
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.
2010-11-25pgf-server: more useful JSON output from lineraizeAllhallgren
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"}]
2010-11-24linearizeAll in PGFServiceaarne
2010-11-09Make PGFService.hs compile againhallgren
+ 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.
2010-10-13the PGF service now can do both random and exhaustive generation. these ↵krasimir
functions now return both the generated tree and its linearization
2010-10-02refactor the API for random generation again. Now PGF contains probabilities ↵krasimir
in the abstract syntax
2010-09-30update PGFService to work after the extensions in the random generation APIkrasimir
2010-09-02Bug fix: add missing error handler for statically served files in pgf-server ↵hallgren
HTTP mode
2010-09-01Standalone HTTP version of pgf-serverhallgren
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.)
2010-08-09native representation for HOAS in PMCFG and incremental type checking of the ↵krasimir
parse forest
2010-08-24more advanced complete function in the PGFServicekrasimir
2010-07-31bugfix in the PGF browserkrasimir
2010-07-31the PGF service now generates samples of the syntax in the browsing informationkrasimir
2010-07-31fix: PGFService should type-check the trees that comes from the userkrasimir
2010-07-13detailed information for the type errors from PGFServicekrasimir
2010-07-08FridgeApp and TranslateApp now show the type errorskrasimir
2010-07-07fix PGFService after the change in the parser APIkrasimir
2010-05-28disambiguation in Phrasebook: show Eng instead of AST if DisambL is missing; ↵aarne
show all alternative disambiguations for each alternative translation
2010-04-30for backward compatibility we have the old parse function again. the old ↵krasimir
functionality is exposed by parse_
2010-04-30fix PGFService after the change in the APIkrasimir
2010-04-22now the PGF service communicates with Graphviz using UTF8 for the input and ↵krasimir
binary for the output
2010-04-04in PGFService disambiguation, show tree if there's no disamb grammaraarne
2010-03-30simplified the treatment of politeness in Phrasebookaarne
2010-03-30disambiguation in Phrasebook grammars, PGF server, and the GUIaarne
2010-03-28catching initial bind symbol in PGFServeraarne
2010-03-26text-like unlexer for phrasebook web serviceaarne
2010-03-26fixes for webdemos, including bug in StructuralItaaarne
2010-03-22www api command translategroup, which uses groupResultsaarne
2010-03-04Quick fix to adapt to new version of the PGF library.hallgren
2009-11-29TranslateApp now have browser for abstract syntaxkrasimir
2009-11-26function doListGrammars in PGFService is obsoletekrasimir
2009-11-26the default function of the PGFService should return list of functions as ↵krasimir
well as list of categories
2009-11-26change PGF.categories to return list of identifiers instead of typeskrasimir
2009-10-24added tree visualizations in TranslateAppkrasimir
2009-10-15make the GF server to compile after that changes in the PGF runtimekrasimir