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.
+ The current type checker for concrete syntax is in
GF.Compile.TypeCheck.RConcrete, but GF.Compile.TypeCheck.Concrete was
still imported in GFI.
+ Fixed a bug that allowed Ints n as a subtype of Ints m, regardless of
m and n. It now requires n<=m. Note: the type checker still allows Int
as a subtype of Ints m, regardless of m.
+ Fixed a potential efficiency problem with large record types, by reducing
the number of recursive calls from |R|*|S| to |R| when checking if R<=S.
+ Fixed a misleading comment: "alpha g t u" checks that u is a subtype of t,
the other way around. Similarly, "checkIfEqLType gr g t u trm" checks that
u is a subtype of t, not the other way around, and not that t is equal to u.
The layout now resembles a certain other online translation service.
The translation is started automatically after text is entered, no need to
press the Translate button.
This bug was introduced sometime between 2013-08-21 and 2013-11-01 and caused
the function convertTerm in GF.Compile.GeneratePMCFG to encounter a EPatt where
it expected Strs. I fixed it by applying the function getPatts (from the old
partial evaluator) to the pattern.
+ Adapt language selection menus to the languages supported by the grammar.
+ Add translation quality colors to the links to alternative translations.
+ Also added more country codes in langcode.js (needed for speech synthesis
voice selection).
The background color of the translation changes to pale green, yellow or red
according to the quality.
Two types of quality indications are supported:
+ From the grammar: linearizations starting with "+" or "*" are assumed to
be of high or low quality, respectively.
+ From the parse tree: if the root function is "?", then the translation is
assumed to be of low quality.
If no quality indications are detected, medium quality is assumed.
In support.js, the functions http_get_json, ajax_http_get_json
and ajax_http_post_json now calls the supplied error callback if the server
returns invalid JSON (e.g. because of a crash).
The function gftranslate.translate in gftranslate.js returns
a JSON value containing an error message (since it doesn't have an error
callback).
This should result in fewer situations where "nothing happens" and the user
doesn't know if it is beacuse the server is slow, or if there was an error.