summaryrefslogtreecommitdiff
path: root/src/server
AgeCommit message (Collapse)Author
2015-04-17gf -server: include grammar modification time in the info returned by /version hallgren
2015-04-17PGF web service: add command c-linearizeAll to obtain all variantshallgren
Implemented by calling the recently added function PGF2.linearizeAll.
2015-03-24PGF Service: add an option to return syntax trees in JSON formathallgren
The parse/translate/c-parse/c-translate commands now recognize the option jsontree=true to augment the returned JSON structure with a field called "jsontree" next to the field "tree", or "jsontrees" next to "trees", containing the the returned syntax tree in JSON format (the same format returned by the abstrjson command, similar to the format returned in the "brackets" field).
2015-03-19PGF service: add commands c-abstrtree and c-parsetreehallgren
These are the C runtime variants of the absttree and parsetree commands. They work in the same way, but support fewer rendering options.
2015-02-25PGFService: make the restriction on parallelism more effectivehallgren
Restrict the entire request handler instead of just the call to the C parser.
2015-02-24PGFService.hs: text lexer: slightly smarter decapitalization of the first ↵hallgren
word of a sentence Keep the first letter in upper case if it is followed by more upper case letters. (Also remove some left over debugging output.)
2015-02-20PGF Service: limit the number of parallel calls to the C run-time parse ↵hallgren
function to 4 by default The limit can be changed with the -j flag
2015-02-16Changes for compatibility with ghc-7.10-rc2hallgren
2 modules: Name clashes caused by Applicative-Monad change in Prelude 2 modules: Ambiguities caused by Foldable/Traversable in Prelude 2 modules: Backwards incompatible changes in time-1.5 for defaultTimeLocale 9 modules: {-# LANGUAGE FlexibleContexts #-} (because GHC checks inferred types now, in addition to explicitly given type signatures) Also silenced warnings about tab characters in source files.
2015-01-21PGF2 & PGFService: enable callbacks for named entities and chunks in the ↵hallgren
c-parse & c-translate web requests
2015-01-20PGF2 & PGFService: work in progress on callbacks for nerc & chunkshallgren
2014-09-03gf.cabal, gf-server.cabal: add version bounds on network & httpd-shedhallgren
* httpd-shed-0.4 does not specify an upper bound on network, but it fails to build against network>=2.6. This is fixed in httpd-shed-0.4.0.2. * With network-2.6, the Network.URI modules is moved to a separate package, so for the time being GF requires network>=2.3 && <2.6. This is compatible with the four most recent versions of the Haskell Platform.
2014-09-02src/server: refactoring to isolate dependencies on the cgi/fastcgi packageshallgren
* Introducing the module CGI, re-exporting a subset of the cgi package. It might complete replace the cgi package in the future. * Introducing the module CGIUtils, containing functions from FastCGIUtils that have nothing to do with fastcgi. Some low level hackery with unsafePerformIO and global variables was left in FastCGIUtils, but it is actually not used, neither for gf -server nor exec/pgf-fcgi.hs.
2014-07-21PGF service: expire PGFs from the cache when they have been unused for 24 hourshallgren
...to keep memory use down on the server.
2014-07-15src/server/gf-server.cabal: update dependencieshallgren
2014-07-15PGF Web Service: include entire completion in full modejohn.j.camilleri
When using full=yes in the web service 'complete' command, you now get an additional field 'seq' with the longest possible completion. So, given: lin f1 = ss "the" ; f2 = ss ("the red house" | "the real deal") ; and trying to complete on input "th", you get: [ { "from": "TestCnc", "brackets": { "cat": "_", "fid": 0, "index": 0, "fun": "_", "children": [] }, "text": "th", "completions": [ { "token": "the", "funs": [ { "fun": "f1", "hyps": [], "cat": "C", "seq": "the" }, { "fun": "f2", "hyps": [], "cat": "C", "seq": "the red house" }, { "fun": "f2", "hyps": [], "cat": "C", "seq": "the real deal" } ] } ] } ]
2014-07-11PGF web service: Return additional completion info with 'full' flagjohn
BETA! The 'complete' command now has a new flag 'full' which when set returns additional info about completions. Without 'full' flag (default): [ { "from": "PhrasebookEng", "brackets": { "cat": "_", "fid": 0, "index": 0, "fun": "_", "children": [ { "token": "the" } ] }, "text": "su", "completions": [ "supermarket", "suspect" ] } ] With full=true or full=yes: [ { "from": "PhrasebookEng", "brackets": { "cat": "_", "fid": 0, "index": 0, "fun": "_", "children": [ { "token": "the" } ] }, "text": "su", "completions": [ { "token": "supermarket", "funs": [ { "fid": 421, "fun": "Supermarket", "hyps": [], "cat": "PlaceKind" } ] }, { "token": "suspect", "funs": [ { "fid": 445, "fun": "Suspect", "hyps": [], "cat": "Property" } ] } ] } ]
2014-06-20PGF Service: return error code 404 (not found) instead of 500 (internal ↵hallgren
server error) for missing grammars
2014-06-20PGF Service, command=grammar: include the last modified time of the grammar ↵hallgren
in the output
2014-05-12gf -server: include list of loaded PGFs in version infohallgren
2014-05-08PGF web api, command c-wordforword: re-enable parsing of individual wordshallgren
The space leak in the Haskell binding to the C parser has been fixed.
2014-04-29PGF web api, command c-wordforword: don't repeat parsing/morpho analysis for ↵hallgren
each target language Also omit attemts to parse individual words for now, to avoid space leaks in the Haskell binding to the C parser.
2014-04-28Spring cleaninghallgren
Nothing major...
2014-04-16PGF web API: adding the command c-wordforwordhallgren
It has the same parameters and result format as c-translate, but it does the translation word for word. (To be used as a last resort).
2014-04-15PGF web API: add commands lookupmorpho and c-lookupmorphohallgren
2014-04-10PGF web service: disable caching of parse resultshallgren
Caching parse results uses a lot of memory, even if they expire after 2 minutes, so it won't scale up to many simultaneous users. But some excessive memory use seems to be caused by space leaks in (the Haskell binding to) the C run-time system, and these should be fixed. For example, flushing the PGF cache does not release the memory allocated by the C run-time system when loading a PGF file.
2014-04-09PGF web service: add unlexers and enable client side cachinghallgren
Most PGF web API commands that produce linearizations now accept an unlexer parameter. Possible values are "text", "code" and "mixed". The web service now include Date and Last-Modified headers in the HTTP, responses. This means that browsers can treat responses as static content and cache them, so it becomes less critical to cache parse results in the server. Also did some cleanup in PGFService.hs, e.g. removed a couple of functions that can now be imported from PGF.Lexing instead.
2014-04-09PGF Service: a bit more clever lexer=texthallgren
Only change the first word to lowercase if the original input is not found in the grammar's morphology. This allows parsing of sentenses starting with "I" in English, nouns in German and proper names in other languages, but it can make the wrong choice for multi-words.
2014-04-08Fix build problem in PGFService.hs when configured without c-runtimehallgren
2014-04-08PGF web service: add lexer supporthallgren
The PGF web API commands parse, translate, translategroup, c-parse and c-translate now support a lexer parameter. Possible values are "text", "code" and "mixed". This is used in the Wide Coverage Demo App to save one server roundtrip.
2014-04-04PGFService.hs: adapt to changes in the Haskell binding to the C run-time systemhallgren
Parse errors used to cause crashes, but they are now handled and reported.
2014-03-19gf -server: add a command to manually flush the PGF cachehallgren
This can be used if the cloud service seems slow, but it would probably be better to automatically expire unused PGFs from the cache after some time.
2014-03-12Fix typo in PGFService: "incomlete"john.j.camilleri
2014-02-11Work on web api & apps based on the C run-time systemhallgren
+ PGFService.hs: add command c-grammar, include probability in parse results + js/gftranslation.js: add start position and limit parameters, return more info to applications + Simple Translator: show two wide coverage translations + Wide coverage demo: show parse tree and probability (intended as grammar debugging aids)
2014-02-10Fix broken C runtime support in gf.cabal and PGFService.hshallgren
Also add PGF service command c-flush to explicitly flush cached parse results from memory.
2014-01-31gf-server.cabal: flag to include C run-time support in the FastCGI PGF servicehallgren
2014-01-27PGFService.hs: fix a type ambiguity when compiling without C run-time supporthallgren
2014-01-27PGFService.hs: add a cache for C run-time parse result and a start offset ↵hallgren
parameter Cached parse results are discarded when they have been unused for 10 minutes.
2014-01-20Optionally include C run-time supporthallgren
If the C run-time library is compiled and installed on your system, you can now do 'cabal configure -fc-runtime' to get the following extras: + The haskell binding to the C run-time library will be included in the PGF library (so you can import it in Haskell applications). Documentation on the new modules will be included when you run 'cabal haddock'. + The new command 'pgf-shell', implemented on top of haskell binding to the C run-time system. + Three new commands in the web API: c-parse, c-linearize and c-translate. Their interfaces are similar to the corresponding commands without the "c-" prefix, but they should be considered preliminary.
2013-12-17src/server/gf-server.cabal: compile it as a common library + executableshallgren
2013-10-30linref is now used by the linearizer. The visible change is that the 'l' ↵kr.angelov
command in the shell now can linearize discontinuous phrases
2013-10-24Functions merge trees into tries in the GF Shell and the PGF web servicehallgren
* In the shell, the new command tt (to_trie) merges a list of trees into a trie and prints it in a readable way, where unique subtrees are marked with a "*" and alternative subtrees are marked with numbers. * In the PGF web service, adding the parameter trie=yes to the parse and translate commands augments the JSON output with a trie. Example to try in the shell: Phrasebook> p -lang=Eng "your son waits for you" | tt
2013-07-29Cloud & PGF service: use Content-Type application/json for JSON outputhallgren
This is in accordance with RFC 4627. http://tools.ietf.org/html/rfc4627 Use application/javascript for JSONP output.
2013-07-25Allow cross origin requests to GF cloud & PGF serviceshallgren
By adding a header Access-Control-Allow-Origin: * to the HTTP responses, web browsers are informed that it is OK to call the services from web pages hosted on other sites. This is apparently supported in most modern browsers, so it should no longer be necessary to resort to JSONP. See https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS
2013-07-15gf-server.cabal: same changes as in gf.cabal for ghc-7.6 compatibilityhallgren
2013-06-13Fix UTF-8 decoding problem in gf -serverhallgren
The package network-2.4.1.1 thoughlessly introduced a backward incompatible change to the function Network.URI.unEscapeString, see https://github.com/haskell/network/commit/f2168b1f8978b4ad9c504e545755f0795ac869ce This also affects the function Network.Shed.Httpd.queryToArguments, which is used in GFServer.hs. To remain compatible with older and newer versions of the network package, we need to stay clear of queryToArguments and unEscapeString. A replacement function has been added to server/URLEncoding.hs.
2013-04-24PGF service: apply the token binding operator &+ to all linearizationshallgren
The &+ operator is now consistently eliminated from the output of commmands that produce linearizations. Before, only the commands translate and translategroup did this.
2013-03-28PGF web API: command=abstrtree not supports the nocat and nofun optionshallgren
2013-03-27PGF web API: add comand linearizeTablehallgren
The new command linearizeTable outputs linearizations as tables containing all variants and forms, labelled by parameters
2013-03-26PGF service: support all parse tree visualziation options in the web APIhallgren
The new options are * noleaves, nofun, nocat (booleans, false by default) * nodefont, leaffont, nodecolor, leafcolor, nodeedgestyle, leafedgestyle (strings, empty by default)
2013-03-13PGF web API: add 'to' parameter to the 'alignment' commandhallgren
Word alignment diagrams can now be restricted to a subset of the languages supported by the grammar.