Difference between revisions of "User:Mono/GSoC 2017"

From Apertium
Jump to navigation Jump to search
Line 1: Line 1:
  +
 
== Webpage Translation mode ==
 
== Webpage Translation mode ==
   
Line 5: Line 6:
 
=== Code ===
 
=== Code ===
   
==== APy ====
+
==== Backend ====
   
 
* https://github.com/goavki/apertium-apy/commit/1f0642858ad82c6666c1b92bea1f5f65bf150c41
 
* https://github.com/goavki/apertium-apy/commit/1f0642858ad82c6666c1b92bea1f5f65bf150c41
   
==== Html-tools ====
+
==== Frontend ====
   
 
*
 
*
Line 15: Line 16:
 
=== Documentation ===
 
=== Documentation ===
   
==== APy ====
+
==== Backend ====
   
 
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 37: Line 38:
 
|}
 
|}
   
==== Html-tools ====
+
==== Frontend ====
   
 
ENABLED_MODES: an array of the enabled interfaces, a non-empty subset of ['translation', 'analyzation', 'generation', 'sandbox', 'lookup']
 
ENABLED_MODES: an array of the enabled interfaces, a non-empty subset of ['translation', 'analyzation', 'generation', 'sandbox', 'lookup']
Line 45: Line 46:
 
=== Future Work ===
 
=== Future Work ===
   
1. The screenshot of the current state of interface can be found [http://www.example.com here].
+
1. The backend for this mode is merged in [https://github.com/goavki/apertium-apy/commit/1f0642858ad82c6666c1b92bea1f5f65bf150c41 this commit]. The screenshot of the current state of interface can be found [http://www.example.com here]. <br/>
2. The interface is pretty much functional. However, one of the tasks that would be involved in the future work is making use of a form handler while submitting the URL links for translation.
+
2. The interface is pretty much functional. However, a future task is to make use of a form handler while submitting the URL links for translation. The related issues are in [https://github.com/goavki/apertium-html-tools/pull/202#issuecomment-324234047 this comment].
  +
  +
  +
== SpellChecker mode ==
  +
  +
Checks for the spelling of input text for a given language and suggests alternatives if the spelling is wrong.
  +
  +
=== Code ===
  +
  +
==== Backend ====
  +
  +
  +
==== Frontend ====
  +
  +
  +
  +
=== Documentation ===
  +
  +
==== Backend ====
  +
  +
{| class="wikitable" border="1"
  +
|-
  +
! URL
  +
! Function
  +
! Parameters
  +
! Output
  +
|-
  +
| '''/speller'''
  +
| Performs spellchecking on a given text for a given language
  +
|
  +
*'''lang''': language to perform spellchecking for
  +
*'''q''': text to perform spellchecking on
  +
|Returns the spellchecking results
  +
<pre>
  +
curl -Ss 'curl -Ss 'http://localhost:3025/speller?lang=hin&q=माय' | ascii2uni -a U -q
  +
  +
[{"sugg": [["काय", "1.000000"], ["चाय", "1.000000"], ["राय", "1.000000"], ["हाय", "1.000000"], ["साय", "1.000000"], ["मा", "1.000000"], ["वाय", "1.000000"], ["दाय", "1.000000"], ["गाय", "1.000000"], ["जाय", "1.000000"]], "known": false, "token": "माय"}]
  +
  +
</pre>
  +
|-
  +
|}
  +
  +
==== Frontend ====
  +
  +
ENABLED_MODES: an array of the enabled interfaces, a non-empty subset of ['translation', 'analyzation', 'generation', 'sandbox', 'lookup', 'speller']
  +
  +
* <code>speller</code> turns on spell checking mode.
  +
  +
=== Future Work ===
  +
  +
1. The screenshot of the current state of interface can be found [http://www.example.com here]. <br/>
  +
2. Improving the logic of mapping the suggestions returned from the backend for the tokens appropriately to the corresponding text on the frontend.

Revision as of 14:51, 27 August 2017

Webpage Translation mode

An interface that lets the user to input a URL, choose a source and a destination language and translate the webpage.

Code

Backend

Frontend

Documentation

Backend

URL Function Parameters Output
/translatePage Translates a webpage
  • langpair: language pair to use for translation
  • url: url of webpage that has to be translated
Returns the translated webpage
curl -Ss 'http://localhost:2737/translatePage?langpair=eng|spa&url=http://facebook.com'

output

Frontend

ENABLED_MODES: an array of the enabled interfaces, a non-empty subset of ['translation', 'analyzation', 'generation', 'sandbox', 'lookup']

  • translation lookup turns on webpage translation mode.

Future Work

1. The backend for this mode is merged in this commit. The screenshot of the current state of interface can be found here.
2. The interface is pretty much functional. However, a future task is to make use of a form handler while submitting the URL links for translation. The related issues are in this comment.


SpellChecker mode

Checks for the spelling of input text for a given language and suggests alternatives if the spelling is wrong.

Code

Backend

Frontend

Documentation

Backend

URL Function Parameters Output
/speller Performs spellchecking on a given text for a given language
  • lang: language to perform spellchecking for
  • q: text to perform spellchecking on
Returns the spellchecking results
curl -Ss 'curl -Ss 'http://localhost:3025/speller?lang=hin&q=माय' | ascii2uni -a U -q

[{"sugg": [["काय", "1.000000"], ["चाय", "1.000000"], ["राय", "1.000000"], ["हाय", "1.000000"], ["साय", "1.000000"], ["मा", "1.000000"], ["वाय", "1.000000"], ["दाय", "1.000000"], ["गाय", "1.000000"], ["जाय", "1.000000"]], "known": false, "token": "माय"}]

Frontend

ENABLED_MODES: an array of the enabled interfaces, a non-empty subset of ['translation', 'analyzation', 'generation', 'sandbox', 'lookup', 'speller']

  • speller turns on spell checking mode.

Future Work

1. The screenshot of the current state of interface can be found here.
2. Improving the logic of mapping the suggestions returned from the backend for the tokens appropriately to the corresponding text on the frontend.