Hi Xavi,
This is how my JSON call looks like (the translation is done properly but
the * persists in the unknown words). Actually, the value for the
parameters come from html elements but this is basically the final outcome:
var api_url="http://apertium.org:8080";
var jatorriHizkuntza="eus";
var helburuHizkuntza="eng";
var testua="Hau proba egiteko testu bat da.";
$.jsonp({
callbackParameter:'callback',
url: api_url + '/translate',
data:{
'langpair': jatorriHizkuntza + '|' + helburuHizkuntza,
'q': testua,
'format': 'text',
'markUnknown': ez,
},
success: function(data)
{
if(data.responseStatus===200)
{
var
helburuTestua=document.getElementById("helburuTestua");
if(helburuTestua.firstChild)
{
helburuTestua.removeChild(helburuTestua.firstChild);
}
var
testuNodoa=document.createTextNode(data.responseData.translatedText);
helburuTestua.appendChild(testuNodoa);
}
else
{
alert("The status of the JSON response is not correct");
}
},
error:function(data)
{
alert("An error has happened while making the
translation.");
}
});
Kind regards,
Manex
2014-04-15 10:31 GMT+01:00 Manex Garaio <[email protected]>:
> Hello again,
>
> I have been working with the JSONP REST API and everything is going fine
> up to now. However, when I translate text in which the translator does not
> recognise some words, a '*' is added with the unknown word. According to
> the documentation, adding 'markUnknown': 'no' to the parameters of the call
> to the translate function should remove the * but it does not seem to work.
> I've also tried setting it to false but it doesn't work neither. Which
> would be the correct way to accomplish the aforementioned functionality?
>
> Thank you very much for your help,
>
> Manex
>
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
Apertium-stuff mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/apertium-stuff