Commit Graph
100 Commits
Author SHA1 Message Date
hallgren 99321ad0d3 gf.cabal: add a maintainer field 2014-06-17 20:55:13 +00:00
hallgren 24975e4935 Some updates to the GF 3.6 download page and release notes 2014-06-17 20:25:58 +00:00
hallgren bfac5faac1 Compute/ConcreteNew.hs: eliminate selections from wildcard tables
This patch also includes some commented out code that was used to search for
the source of code size explosions and an eta expansion bug.
2014-06-17 14:47:55 +00:00
hallgren b78751d50a doc/gf-developers.t2t: quick note on how to compile the C run-time system
Also a few other minor updates.
2014-06-17 14:17:59 +00:00
hallgren 45a719f1c3 build-binary-dist.sh: updated to include the C runtime system in binary tarballs
Also moved it to the bin directory.
Run it with 'bash bin/build-binary-dish.sh'.
2014-06-17 13:56:59 +00:00
hallgren e783712fde Setup.hs: System.Cmd is deprecated, import System.Process instead 2014-06-17 13:27:14 +00:00
hallgren f2d60380c6 gf-cloud-api.html: fix a broken link
Thanks to Dana Dannells.
2014-06-17 08:45:13 +00:00
hallgren bbeca32a43 src/runtime/c/setup.sh: executable version of INSTALL, used from debian/rules 2014-06-16 23:28:12 +00:00
hallgren 7cc07b755b debian/rules: include the C run-time system when building .deb packages 2014-06-16 20:12:44 +00:00
hallgren 767a0768fe Merge Estonian v1.0.0-alpha from Kaarel Kaljurand 2014-06-16 13:58:04 +00:00
hallgren f739841497 PGF library: expose only PGF and PGF.Internal instead of all modules
PGF exports the public, stable API.
PGF.Internal exports additional things needed in the GF compiler & shell,
including the nonstardard version of Data.Binary.
2014-06-12 14:43:18 +00:00
hallgren 577d73abfb New GF home page: trying blue page title and tagline instead of red 2014-06-12 12:29:35 +00:00
hallgren 033e42dbbd new.html: a proposed new look for the GF home page 2014-06-11 13:32:31 +00:00
hallgren 8a5289c921 Updating the release notes and installation instructions for the next release 2014-06-10 22:12:48 +00:00
hallgren bc0249b501 PGF2.hsc: use throwIO instead of throw
From the documentation: the throwIO variant should be used in preference to
throw to raise an exception within the IO monad because it guarantees ordering
with respect to other IO operations, whereas throw does not.

Also removed some unused imports.
2014-06-10 12:42:01 +00:00
hallgren 861a3fa805 Compute/ConcreteNew.hs: adding a Prawitz rewrite
(table { p_i => t_i } ! x).l ==> table { p_i => t_i.l } ! x

This was used in the old partial evaluator and can significantly reduce term
sizes in some cases.
2014-05-16 21:27:20 +00:00
hallgren f78570dabd Fix an eta expansion bug in the grammar compiler
Eta expansion is applied between partial evaluation and PMCFG generation.
The buggy version generated type incorrect terms, but PMCFG generation
apparently worked anyway.
2014-05-16 14:10:07 +00:00
hallgren 104fa03676 Simple Translator: fall back to word-for-word translation if the parser fails
Same as in the Wide Coverage demo app.
2014-05-15 13:58:42 +00:00
hallgren 33af15e803 Haskell binding: free memory pool to avoid space leak when readPGF fails 2014-05-13 14:07:36 +00:00
hallgren 108d546db8 translator/DictionarySwe.gf: add a few nouns and adverbs 2014-05-13 13:32:53 +00:00
hallgren 3c110cbe8d gf -server: include list of loaded PGFs in version info 2014-05-12 13:45:36 +00:00
hallgren 186e3effba examples/phrasebook/Makefile2: add Chinese
Also remove arguments to raise the stack size, GF's built-in default is big
enough now.
2014-05-09 13:07:02 +00:00
hallgren 519f073af3 Wide Coverage Demo Web App: bug fix: swapping source and target works again 2014-05-08 14:18:03 +00:00
hallgren fbe9bb69b1 Wide Coverage Demo Web App: bug fix: restore lost quality indications after switching target languages 2014-05-08 14:05:07 +00:00
hallgren 2a774e946b PGF web api, command c-wordforword: re-enable parsing of individual words
The space leak in the Haskell binding to the C parser has been fixed.
2014-05-08 11:38:41 +00:00
hallgren b7bd866237 Wide Coverage Demo App: show all Phrasebook translations
Also improve behaviour for languages that are missing in Phrasebook (Chinese).
Also update the initial set of languages in the menus to match Translate11.pgf.
2014-05-07 23:42:05 +00:00
hallgren b3d92a1378 pgf-shell.hs: fix compilation problem with GHC 7.4 2014-05-07 17:06:34 +00:00
hallgren 7c88b7935f Two improvements in the pgf-shell example
1. Like pgf-translate, it now shows one result at a time, press Enter to get
   more results.
2. You can load a new grammar with the command 'i <path-to-pgf>'
2014-05-07 16:37:28 +00:00
hallgren b7478a8252 translator/DictionarySwe: add panic_V 2014-05-07 13:01:26 +00:00
hallgren 0fe6a11773 Wide Coverage Web Demo: fix bug introduced in previous patch
Word-for-word translations were shown in the wrong language after switching
traget language.
2014-04-29 19:09:24 +00:00
hallgren 8b4e13ea84 Wide Coverage Demo App: translate to all available target langauges at once
This means that the new translation is available instantly when switching
target languages. It can also reduce space leaks problems in the server
somewhat by avoiding repeated parsing of the source text.
2014-04-29 16:01:57 +00:00
hallgren d37c25990e PGF web api, command c-wordforword: don't repeat parsing/morpho analysis for 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-29 15:51:46 +00:00
hallgren 05c70fdc41 Spring cleaning
Nothing major...
2014-04-28 13:56:20 +00:00
hallgren 7bd028919e Simple Translator: remove extra space before punctuation 2014-04-28 12:07:41 +00:00
hallgren 54a77ee7d9 Simple Translator: remove punctuation before wide coverage translation
This gives better translations with Translate11.pgf and is how the Wide
Coverage Demo App works.
2014-04-24 11:28:15 +00:00
hallgren f7a64de783 Some work on the download page and release notes for the next release of GF
Please add things you think are imporant to mention to the release notes!
2014-04-22 14:45:37 +00:00
hallgren 9135f93e51 gf.cabal: require base>=4.3
This makes it explicit that we no longer support compiling GF with GHC 6.12
(which is 4 years old and comes with base-4.2).
2014-04-22 14:38:33 +00:00
hallgren 1a1ca2f618 gf.cabal: add GF builtin default -K64M. Enable parallel compile with ghc>=7.8
+ Programs compiled with ghc<7.8 have a default built-in 8M stack size limit.
  With ghc>7.0 this built-in default can be changed, so it is now 64M, allowing
  GF to work with larger grammars without manually increasing the stack size.
  (But if GF is compiled with ghc 6.12, the built-in default is still 8M.)

+ Enable ghc>=7.8 support for compiling modules in parallel, to speed up the
  compilation of GF.
2014-04-22 12:43:24 +00:00
hallgren 3fd6dc90f9 Wide Coverage Demo web app: more client side caching
For example, you can now reorder paragraphs by cut & paste, without causing
anything to be sent to the server for re-translation.

Also some color & layout tweaks.
2014-04-17 13:48:00 +00:00
hallgren 0c04bdb4b9 translator/DictionarySwe.gf: fix learn_V
Copied from LexiconSwe.gf.

Also a small fix in lib/src/Makefile.
2014-04-17 13:15:23 +00:00
hallgren d2f48f8156 Wide Coverage Demo App: show a word-for-word translation if all else fails 2014-04-16 15:37:09 +00:00
hallgren 5c79b1d8bd PGF web API: adding the command c-wordforword
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-16 15:24:23 +00:00
hallgren 210f28ca4b PGF web API: add commands lookupmorpho and c-lookupmorpho 2014-04-15 14:50:38 +00:00
hallgren 93d14368b2 gftranslate.js: switch to Translate11.pgf 2014-04-11 20:08:12 +00:00
hallgren 43319eb0b7 Wide Coverage Demo App (gftranslate.js): use a special lexer for Chinese. 2014-04-11 18:39:12 +00:00
hallgren 9f3235c29f Simple Translator: use colors to indicate translation quality 2014-04-11 15:00:15 +00:00
hallgren 77586aa080 Simple Translator: Use PGF API for (un)lexing instead of separate server calls
Also,

  + Get up to 10 (instead of 5) alternative robust translations.
  + Remove duplicates from list of alternative robust translations
  + Add GF Cloud logo to the simple translator page
2014-04-11 12:10:05 +00:00
hallgren 923107506f PGF web service: disable caching of parse results
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-10 15:55:33 +00:00
hallgren 62903443f0 Wide Coverage Demo App: it now works ok without server caching of parse results 2014-04-10 15:50:34 +00:00
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
hallgren 581a0336a5 Wide Coverage Demo App: restore swap button 2014-04-08 11:32:54 +00:00
hallgren 9f3e9d8626 demos/translation.t2t: more space for the demo app 2014-04-07 13:01:00 +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
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 5d36c4734d Fixes for compiling Translate10.pgf 2014-04-04 19:04:16 +00:00
hallgren 3fa7b3e04b 149 new words in DictinarySwe.gf (mostly geographical names) 2014-04-04 19:02:42 +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
hallgren 5d7c894380 translator/DictionarySwe.gf: fix for tasty_A, mkA "god" "gott" 2014-04-01 14:38:16 +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
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
hallgren d46bdda103 Wide coverage demo web app: translation quality feedback with colors
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.
2014-03-27 15:11:02 +00:00
hallgren 94bf87add9 support.js & gftranslate.js: improved handling of server errors
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.
2014-03-27 15:02:27 +00:00
hallgren 6cc8557e6b gf -server: add a command to manually flush the PGF cache
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-19 16:15:05 +00:00
hallgren a229c539e9 Wide coverage demo web app: add speech synthesis
Works in Safari and Chrome.
2014-03-17 15:59:43 +00:00
hallgren 539cb5746b doc/Logos/gf1.svg: variant of the GF logo with a subtle shadow 2014-03-13 14:50:30 +00:00
hallgren 3e804fbe7f GF home page: news item about Digital Grammars 2014-03-13 13:15:43 +00:00
hallgren cb9222a20c support.js: For better error handling, always use AJAX, don't fallback to JSONP
Cross-origin requests are allowed by the PGF service and are supported in
all modern browsers.
See http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
2014-03-12 14:07:35 +00:00
hallgren 6abd0c8eef haskell-bind: comment out superfluous imports 2014-03-12 13:21:47 +00:00
hallgren 69b113324e WebSetup.hs: use the correct --gf-lib-path when building example grammars
The directory should be the same as the one used in Setup.hs when building
the RGL, where a build directory supplied by cabal is used. This is usually
dist/build/rgl, but it could be different, e.g. when using a cabal sandbox.
2014-03-11 13:46:10 +00:00
hallgren 8d9821a977 C run-time: protect from Windows specific #includes with #ifdef __MINGW32__ 2014-03-06 13:42:27 +00:00
hallgren f33dc4c6c3 Fix the fix 2014-03-04 14:35:14 +00:00
hallgren c7cd031a95 Fixes for GHC 7.6 compatibility 2014-03-04 14:28:44 +00:00
hallgren 73221769c2 Three fixes for compatibility with GHC 7.8
Two of the fixes were in the custom version of the binary package. We
should get rid of it at some point, to reduce the maintenance burden.

The third fix was to add new version constraints for happy and alex in
gf.cabal. New versions of them are needed because of the ugly, low-level,
GHC-specific code they produce need to be different for GHC 7.8.

More fixes might be needed for -server mode, but the cgi package is not
compatible with GHC 7.8 at the moment, so it will have to wait.
2014-03-04 14:13:41 +00:00
hallgren 3712b2a2c0 Wide coverage demo web app: add link to Google Translate 2014-02-19 14:17:49 +00:00
hallgren 800bdcaa37 src/www/js/langcode.js: functions for converting language codes
factored out from src/www/translator/translator.js
2014-02-19 14:15:14 +00:00
hallgren b7f57b1394 demos/translation.t2t: the translation app needs more space 2014-02-13 12:02:10 +00:00
hallgren 286c5a035a Wide coverage demo: show up to 10 translations
The translations are loaded one at a time so you don't have to wait for all
10 to see the first one.
2014-02-12 16:08:18 +00:00
hallgren 15bf881e45 Work on web api & apps based on the C run-time system
+ 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-11 16:43:29 +00:00
hallgren d99f3e19d7 GFServer.hs: avoid intertwined log messages from parallel requests 2014-02-11 14:22:12 +00:00
hallgren be31b52e07 Restore compatibility with GHC 7.0 2014-02-10 21:44:34 +00:00