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''': limit period-based stats to last N requests
*'''context''': a sentence
*'''word''': limit period-based stats to last N requests
*'''word''': word that will be sugested
*'''newWord''': limit period-based stats to last N requests
*'''newWord''': a suggestion
*'''langpair''': limit period-based stats to last N requests
*'''langpair''': language pair to use for translation
*'''g-recaptcha-response''': limit period-based stats to last N requests
*'''g-recaptcha-response''': testing token generated when running apy
| Note that period-based stats are limited to 3600 seconds by default (see -T argument to servlet.py)
| Note that period-based stats are limited to 3600 seconds by default (see -T argument to servlet.py)
<pre>
<pre>

Revision as of 08:18, 12 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: a sentence
  • word: word that will be sugested
  • newWord: a suggestion
  • langpair: language pair to use for translation
  • g-recaptcha-response: testing token generated when running apy
Note that period-based stats are limited to 3600 seconds by default (see -T argument to servlet.py)
curl --data 'context=otro+mundo&word=*mundo&newWord=MUNDO&langpair=esp|eng&g-recaptcha-response=testingToken' http://localhost:2737/suggest
{
  "holdingPipes": 0,
  "periodStats": {
    "totTimeSpent": 10.760803,
    "ageFirstRequest": 19.609394,
    "totChars": 2718,
    "requests": 8,
    "charsPerSec": 252.58
  },
  "runningPipes": {
    "eng-spa": 1
  },
  "useCount": {
    "eng-spa": 8
  },
  "uptime": 26
}