1
0
forked from GitHub/gf-core
Commit Graph

3595 Commits

Author SHA1 Message Date
hallgren
37c473a559 Wide Coverage Demo App: new buttons: to switch colors on/off & to try Google Translate 2014-04-09 20:51:31 +00:00
hallgren
739dc3f29d localstorage.js: bug fix
If you stored "false" and tried to retrieve it with a default value, you got
the default value instead of "false".
2014-04-09 20:49:53 +00:00
hallgren
17cf501d4c Wide Coverage Demo App: use PGF service lexing/unlexing
It is now enough to make one server call per translation, and the results can
cached by the browser.
2014-04-09 19:49:45 +00:00
hallgren
43e61a1e3b PGF web service: add unlexers and enable client side caching
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-09 17:51:25 +00:00
hallgren
f2cc1d2c68 Change the type of PGF.Lexing.bindTok to [String] -> [String]
The old type was [String] -> String. This function was only used
in GF.Text.Lexing.stringOp, which now uses (unwords . bindTok) instead,
with no change in behaviour.
2014-04-09 17:39:21 +00:00
hallgren
0d1ad2f0e5 Unlexers: move capitalization of first word from GF.Text.Lexing to PGF.Lexing
The capitalization of the first word was done in GF.Text.Lexing.stringOp,
but is now done in the functions unlexText and unlexMixed in PGF.Lexing.
These functions are only used in stringOp and in PGFService (where the change
is needed), so the subtle change in behaviour should not cause any bugs.
2014-04-09 17:26:23 +00:00
hallgren
1602eab5b6 PGF Service: a bit more clever lexer=text
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-09 14:13:18 +00:00
hallgren
02b57c3f79 Wide Coverage Demo App updates
+ Add Clear button.
+ Use localstorage to remember entered text between visits.
+ Add a link to it on the GF cloud service start page.
2014-04-09 13:59:35 +00:00
hallgren
5d4b849b14 Fix build problem in PGFService.hs when configured without c-runtime 2014-04-08 20:45:54 +00:00
hallgren
0341fd035f PGF web service: add lexer support
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-08 16:10:33 +00:00
hallgren
cf34ee8890 Move basic lexing functions from GF.Text.Lexing to the new module PGF.Lexing
They are thus part of the PGF Run-Time Library, making it possible to add
lexing functionality in PGF service in a natural way.
2014-04-08 14:07:49 +00:00
hallgren
4f2bd4aa5f Wide Coverage Demo App: remove quality markers ("+" or "*") before unlexing
Otherwise the first word won't be capitalized.
2014-04-08 13:46:57 +00:00
kr.angelov
be62b047f4 added preliminary API for custom literals from Java. Not functional yet 2014-04-08 13:54:49 +00:00
kr.angelov
52377b46cf bugfix in the C runtime that shows up with only some grammars 2014-04-08 12:41:41 +00:00
hallgren
581a0336a5 Wide Coverage Demo App: restore swap button 2014-04-08 11:32:54 +00:00
hallgren
620f30d187 Wide Coverage Demo Web App: add segmentation
Click on sentences to choose among alternative translations.
2014-04-07 12:51:13 +00:00
kr.angelov
baef6eee90 Expr and ExprProb are now serializable objects 2014-04-07 12:52:51 +00:00
kr.angelov
e4555d2dce fix in the keyboard 2014-04-07 12:42:02 +00:00
kr.angelov
dc476cce50 added alternative_item.xml 2014-04-07 12:41:23 +00:00
kr.angelov
78e7f0e87d a bit more text in the help 2014-04-07 09:43:20 +00:00
kr.angelov
e8303dc761 show alternative translations on Android 2014-04-07 09:14:14 +00:00
hallgren
72c4527767 Wide coverage demo app: show an error message even if the error string is empty 2014-04-06 23:44:31 +00:00
hallgren
ceb6de1561 Wide coverage demo app: show an error message if linearization fails 2014-04-06 23:13:18 +00:00
hallgren
0721769935 gftranslate.js: use Translate10.pgf 2014-04-06 19:59:04 +00:00
hallgren
0ae79efdbf TypeCheck.RConcrete: contravariance in table types 2014-04-04 16:50:12 +00:00
hallgren
15f0edae32 Removed imports of TypeCheck.Concrete, fixed problems in TypeCheck.RConcrete
+ 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.
2014-04-04 13:51:07 +00:00
hallgren
703f61313c Wide Coverage Translation Web App: redesigned user interface
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.
2014-04-04 12:52:41 +00:00
hallgren
8677d799c8 gftranslate.js: increase length limit from 200 to 500 encoded bytes 2014-04-04 12:39:36 +00:00
hallgren
6f513bce44 Simple Translator: show more alternatives when using GF robust translation
The maximum number of alternatives shown has been increased from 2 to 5
although it can slow down translation.
2014-04-04 12:35:20 +00:00
hallgren
e365329716 Slightly more informative error messages in translation web apps 2014-04-04 12:33:31 +00:00
hallgren
57ebfa4416 PGFService.hs: adapt to changes in the Haskell binding to the C run-time system
Parse errors used to cause crashes, but they are now handled and reported.
2014-04-04 12:28:00 +00:00
kr.angelov
268e7a697f fix the haskell binding to handle parse errors 2014-04-04 11:46:40 +00:00
aarne
1b6f58c592 text in app help 2014-04-04 07:28:55 +00:00
kr.angelov
9f0ee95fd6 now the output from the speech recognizer is editable with the keyboard 2014-04-04 09:04:00 +00:00
kr.angelov
232b4518ed add activity_help.xml 2014-04-04 07:51:05 +00:00
kr.angelov
02c39118a9 add the forgoten HelpActivity.java 2014-04-04 07:48:50 +00:00
kr.angelov
793acdf171 add touch feedback to the two buttons in the app 2014-04-03 20:30:23 +00:00
kr.angelov
184c0ed29f added help view in the android app. The help itself is not very useful right now 2014-04-03 14:22:44 +00:00
kr.angelov
51dbaa0c7e GFTranslator to DGTranslator in a few more places 2014-04-03 14:06:26 +00:00
kr.angelov
95291eec92 remove the old android icon 2014-04-03 14:02:50 +00:00
kr.angelov
6edcfbe9d0 change the project name to DGTranslator 2014-04-03 13:48:08 +00:00
kr.angelov
19f7fd998b a new icon and a new name for the DG Translator 2014-04-03 13:44:14 +00:00
kr.angelov
f4cd152e6f bugfix in the keyboard translation 2014-04-03 06:14:15 +00:00
kr.angelov
d94c7632d4 fix in the keyboard XMLs 2014-04-02 20:05:16 +00:00
kr.angelov
d110df7a1f initial binding to Prolog for the C runtime 2014-04-02 10:03:19 +00:00
aarne
b9b7ed9ccc use chunking before morpho lookup in backup parsing ; show results with unknown linearizations in darkest red 2014-04-01 16:24:35 +00:00
hallgren
d262bb0e48 Bug fix for pattern macros in pre{}
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.
2014-04-01 10:54:41 +00:00
aarne
75b7e6105d Hin and Bul keyboards in app restored 2014-03-31 19:45:41 +00:00
hallgren
713012001c Wide coverage demo web app: green translations from Phrasebook.pgf
The demo web app now show translations from Phrasebook.pgf in green before
translations from Translate8.pgf, which can be yellow or red.
2014-03-31 15:28:14 +00:00
hallgren
75011c8efa Wide coverage demo web app improvements
+ 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).
2014-03-28 14:56:56 +00:00