Difference between revisions of "User:Commial/AWI"

From Apertium
Jump to navigation Jump to search
Line 62: Line 62:
 
* Few changes to make the code more readable (repetitive code)
 
* Few changes to make the code more readable (repetitive code)
   
([http://apertium.svn.sourceforge.net/viewvc/apertium?revision=30724&view=revision] Commit 30724) includes :
+
([http://apertium.svn.sourceforge.net/viewvc/apertium?revision=30724&view=revision Commit 30724]) includes :
   
 
* Creation of gramproof.js, which contains javascript functions used by the module Spell checking and Grammar checking
 
* Creation of gramproof.js, which contains javascript functions used by the module Spell checking and Grammar checking
Line 73: Line 73:
 
[[File:Apertium-AWI ModulesInterface 06.16.jpg]]
 
[[File:Apertium-AWI ModulesInterface 06.16.jpg]]
   
([http://apertium.svn.sourceforge.net/viewvc/apertium?view=revision&revision=30738] Commit 30738) includes :
+
([http://apertium.svn.sourceforge.net/viewvc/apertium?view=revision&revision=30738 Commit 30738]) includes :
   
 
* Correction of an error in gramproof.js. The function displaySuggestionsList was defined two time.
 
* Correction of an error in gramproof.js. The function displaySuggestionsList was defined two time.

Revision as of 12:48, 17 June 2011

APERTIUM : Improvements to postedition interface Google Summer Of Code 2011



Jobs already done

Port the code for all recent php versions

I have replace all file_put_contents by fopen, fwrite, fclose, which are supported by older php versions. (Commit 30690)


Current Jobs

Rewrite the PHP & Javascript as separate modules so that it be easy to decide which tools to enable or disable in the interface

The file "modules.php" is designed to manage modules. It includes :

Configuration of modules :

* Module structure : 
* name : Module's name
* description : Short description of the module
* default : Recommanded module
* javascript : an array of javascript dependencies (with path javascript/)
* php : an array of php dependencies (with path includes/)
* button_in : HTML code for the interface, under the input, when the module is activated
* button_out : HTML code for the interface, under the output, when the module is activated

For example : 'SpellGrammarChecking':

'name' => 'Spell and Grammar checking',
'description' => 'Integrate the ability to check both input and output texts for mistakes, with a button “Check for mistakes”.
When pressed, it runs spell checking and grammar checking on the text and underlines mistakes in different colours (red for spelling, blue for grammar).',
'default' => TRUE,
'javascript' => array('textEditor.js', 'main.js'),
'php' => array('gramproof.php', 'strings.php', 'system.php'),
'button_in' => '<input type="submit" name="check_input" value="Check for mistakes" />',
'button_out' => '<input type="submit" name="check_output" value="Check for mistakes" />'

It includes too :

Functions for modules management :

* Check dependencies of a module
* Load PHP dependencies of a module
* Write Interface of a module
* Load/Unload a module
* List of module loaded, list of recommended modules
* Write the list of Javascript libraries needed by loaded modules

How I see the current separations of modules : Apertium-AWI Organisation 06.15.jpg (Concerning PHP files)

The current interface for Load/Unload Modules (in Firefox 4, Ubuntu) : Apertium-AWI ModulesInterface 06.15.jpg

(Commit 30719) includes :

* Creation of module structure
* Creation of the content and form to easily Load/Unload modules
* Cut existing files to make independent modules (the module 'Logs' isn't currently independent)
* Modification of the interface display to allow the Add/Remove of buttons
* Few changes to make the code more readable (repetitive code)

(Commit 30724) includes :

* Creation of gramproof.js, which contains javascript functions used by the module Spell checking and Grammar checking
* Creation of logs.js, which contains javascript functions used by the module Logs
* Some functions in textEditor.js are now in gramproof.js and logs.js
* Functions of nodes.js, paste_event.js, logging_lowlevel.js and logging.js are now in logs.js (gain in number of browser request)
* The module Logs is now independent

How I see the current separations of modules in javascript : Apertium-AWI ModulesInterface 06.16.jpg

(Commit 30738) includes :

* Correction of an error in gramproof.js. The function displaySuggestionsList was defined two time.

Next step : Actually, main.js use try catch method. May he has to be write dynamically.