Difference between revisions of "User:Kiara"

From Apertium
Jump to navigation Jump to search
Line 29: Line 29:
| Generate a suggestion on target wiki-page using a testing token.
| Generate a suggestion on target wiki-page using a testing token.
|
|
*'''context''': a sentence
*'''context''': sentence
*'''word''': word that will be sugested
*'''word''': word that will be sugested
*'''newWord''': a suggestion
*'''newWord''': suggestion
*'''langpair''': language pair to use for translation
*'''langpair''': language pair to use for translation
*'''g-recaptcha-response''': testing token generated when running apy
*'''g-recaptcha-response''': testing token generated when running apy (note that only testing token can be used with curl)
|Returns the status. If "Success", the suggestion is posted on the target wiki-page.
|Returns the status. If "Success", the suggestion is posted on the target wiki-page.
Note that the correct wiki-page url is required (wiki_util.py)
Note that the correct wiki-page url is required (wiki_util.py)
Line 40: Line 40:
For production usage of Google reCaptcha the registration is required (https://developers.google.com/recaptcha/).
For production usage of Google reCaptcha the registration is required (https://developers.google.com/recaptcha/).


Note that correct keys are required when starting apy and html-tools.
Note that correct keys are required when starting apy and in the html-tools config file.
<pre>
<pre>
curl --data 'context=otro+mundo&word=*mundo&newWord=MUNDO&langpair=esp|eng&g-recaptcha-response=testingToken' http://localhost:2737/suggest
curl --data 'context=otro+mundo&word=*mundo&newWord=MUNDO&langpair=esp|eng&g-recaptcha-response=testingToken' http://localhost:2737/suggest
Line 47: Line 47:
|-
|-
|}
|}
* {{suggest|esp|eng|otro mundo|*mundohgg|MUNDO}}
* {{suggest|esp|eng|otro mundo|*mundohgg|MUNDO}}
* {{suggest|esp|eng|otro mundo|*mundohgg|MUNDO}}
* {{suggest|spa|eng|World *tggg your and Miguel|*tggg|12345678}}
* {{suggest|spa|eng|your and Miguel *jogar|*jogar|tttgrhyrj}}
* {{suggest|spa|eng|World *tggg your and Miguel|*tggg|utytryjh}}
* {{suggest|spa|eng|World *tggg your and Miguel|*tggg|mnbvcx}}
* {{suggest|spa|eng|*jo world hombreu|hombreu|khlkjhk}}

Revision as of 18:35, 13 June 2016

Kiara's page


Suggestion task:

Notes

1. How to work with APY from the command line: http://wiki.apertium.org/wiki/APY#Usage

2. How to launch Suggestions from the command line https://github.com/goavki/apertium-html-tools/pull/35



use ./servlet.py /usr/local/share/apertium/ --wiki-username=WikiUsername --wiki-password=WikiPassword -rs=YourRecaptchaSecret to run apy in google reCaptcha mode


URL Function Parameters Output
/suggest Generate a suggestion on target wiki-page using a testing token.
  • context: sentence
  • word: word that will be sugested
  • newWord: suggestion
  • langpair: language pair to use for translation
  • g-recaptcha-response: testing token generated when running apy (note that only testing token can be used with curl)
Returns the status. If "Success", the suggestion is posted on the target wiki-page.

Note that the correct wiki-page url is required (wiki_util.py)


For production usage of Google reCaptcha the registration is required (https://developers.google.com/recaptcha/).

Note that correct keys are required when starting apy and in the html-tools config file.

curl --data 'context=otro+mundo&word=*mundo&newWord=MUNDO&langpair=esp|eng&g-recaptcha-response=testingToken' http://localhost:2737/suggest
{"responseStatus": 200, "responseData": {"status": "Success"}, "responseDetails": null}