| Age | Commit message (Collapse) | Author |
|
internal module in the runtime. These are not really part of the core runtime.
|
|
Haskell runtime
|
|
|
|
The previous patch introduced an indentation problem in the code that is used
when compiling without C run-time support.
|
|
CncLabels are read from a file in the same directory as the PGF file and
with the same name as the concrete syntax + extension .labels,
e.g. ResourceDemo.pgf would use labels from
ResouceDemo.labels (abslabels)
ResouceDemoEng.labels (clclabels)
|
|
words; TODO: dissolve clustered multiwords bound with +
|
|
These prevented GF from being built with C run-time support (-fc-runtime).
|
|
The function listCaches returns an empty list instead of the contents
of the cached C run-time system PGFs when compiled without C-run-time support
This gave rise to an ambiguity in GF.Server.
|
|
+ The PGF service now reads and caches dependency label configuration files.
+ The grammar info returned by command=grammar has a new boolean field
'hasDependencyLabels' to indicate if dependency labels were found for
the grammar. Also, command=deptree will now fail if no labels are present.
+ The minibar only shows word dependency trees if labels are present.
+ Also changed the type of getDepLabels from [String] -> Labels to
String -> Labels, since all uses were in the form "getDepLabels . lines".
|
|
|
|
Also added the function outputText in CGIUtils.
|
|
|
|
This is the web interface to PGF.graphvizDependencyTree.
Accepted parameters: format=<output_format>, to=<lang>, tree=<tree>.
Accepted output formats: latex, conll, malt_tab, malt_input, png, gif, svg, gv
Also, label information is taken from <path>.labels if present, where
<path>.pgf is the path to the PGF file.
|
|
the callbacks. It is just as easy to save the sentence in a closure and by doing that we save the repeated round about from C to Haskell strings
|
|
|
|
Also fixed some warnings and tightened some imports
|
|
By adding unlexer=none (or unlexer=id) in requests that output linearizations
(e.g. command=linearize, command=translate), you can leave &+ uninterpreted
instead of gluing the adjacent tokens. This means that the output is left in
a format that can be parsed in a subsequent request.
To implement this consistently, the function linearizeAndBind was replaced
with the function linearizedAndUnlex (but there are a couple of requests
that do not call this function...)
Note that this applies to the Haskell run-time requests only. The C run-time
request (c-linearize, c-translate) always applies the &+ token and the
c-parse request can parse input containing glued tokens.
|
|
|
|
Implemented by calling the recently added function PGF2.linearizeAll.
|
|
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).
|
|
These are the C runtime variants of the absttree and parsetree commands. They
work in the same way, but support fewer rendering options.
|
|
Restrict the entire request handler instead of just the call to the C parser.
|
|
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.)
|
|
function to 4 by default
The limit can be changed with the -j flag
|
|
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.
|
|
c-parse & c-translate web requests
|
|
|
|
* 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.
|
|
* 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.
|
|
...to keep memory use down on the server.
|
|
|
|
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"
}
]
}
]
}
]
|
|
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"
}
]
}
]
}
]
|
|
server error) for missing grammars
|
|
in the output
|
|
|
|
The space leak in the Haskell binding to the C parser has been fixed.
|
|
each target language
Also omit attemts to parse individual words for now, to avoid space leaks in
the Haskell binding to the C parser.
|
|
Nothing major...
|
|
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).
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
Parse errors used to cause crashes, but they are now handled and reported.
|
|
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.
|
|
|
|
+ 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)
|