From f1c4b353e395c59505120db3e3e7268238ad64a4 Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 28 Jan 2014 16:51:21 +0000 Subject: [PATCH] Wide coverage translation web demo improvements + Add lexing/unlexing + Add a button to swap input and output + Minor layout adjustments --- demos/translation.t2t | 2 +- src/www/gfse/cloud2.js | 4 ++ src/www/translator/translator.js | 3 -- {demos => src/www}/wc.html | 66 ++++++++++++++++++++++---------- 4 files changed, 50 insertions(+), 25 deletions(-) rename {demos => src/www}/wc.html (51%) diff --git a/demos/translation.t2t b/demos/translation.t2t index 428dd7acc..9ed59b42b 100644 --- a/demos/translation.t2t +++ b/demos/translation.t2t @@ -3,7 +3,7 @@ Powered by multilingual grammars %!style:../css/style.css %!postproc(html):

-%!postproc(html): #GFWCT +%!postproc(html): #GFWCT ==Try it online== diff --git a/src/www/gfse/cloud2.js b/src/www/gfse/cloud2.js index dbb322ed8..318e2739e 100644 --- a/src/www/gfse/cloud2.js +++ b/src/www/gfse/cloud2.js @@ -272,3 +272,7 @@ function check_exp(s,cont) { } gfshell("cc "+s,check); } + +// Lexing/unlexing text +function lextext(txt,cont) { gfshell('ps -lextext "'+txt+'"',cont) } +function unlextext(txt,cont) { gfshell('ps -bind -unlextext "'+txt+'"',cont) } diff --git a/src/www/translator/translator.js b/src/www/translator/translator.js index e124e3523..1c8dbede6 100644 --- a/src/www/translator/translator.js +++ b/src/www/translator/translator.js @@ -1193,9 +1193,6 @@ function save_in_cloud(filename,document,cont) { with_dir(save) } -function unlextext(txt,cont) { gfshell('ps -bind -unlextext "'+txt+'"',cont) } -function lextext(txt,cont) { gfshell('ps -lextext "'+txt+'"',cont) } - // Like lextext, but separate punctuation from the end function lexgfrobust(txt,cont) { function rmpunct(txt) { diff --git a/demos/wc.html b/src/www/wc.html similarity index 51% rename from demos/wc.html rename to src/www/wc.html index 600afda3d..08c7c62e0 100644 --- a/demos/wc.html +++ b/src/www/wc.html @@ -1,21 +1,27 @@ Demo: GF Wide Coverage Translation - + + - -
-

GF -Wide Coverage Translation

-
-
+
-

- +

GF Wide Coverage Translation

+
+ + +
+ +
→ - @@ -40,29 +46,47 @@ Wide Coverage Translation +   
- - + - -
+

+

+Last modified: Tue Jan 28 17:38:32 CET 2014
- - + + + + +