|
I think now we also have translated dictionary / synonyms list for single words Amazing, this is even better!!
http://translate.google.com/translate_a/t?client=p&sl=auto&tl=en&hl=en&sc=2&ie=UTF-8&oe=UTF-8&ssel=0&tsel=0&q=Resumo%0d
{
"sentences":
[
{"trans":"Abstract","orig":"Resumo","translit":"","src_translit":""}
],
"dict":
[
{"pos":"noun","terms":
[
"summary","abstract","resume","brief","digest","synopsis","epitome","excerpt","abridgment","extract","abridgement","compendium","precis","syllabus","condensation","docket","playbill"
],
"entry":
[
{"word":"summary","reverse_translation":["resumo","sumário","síntese","epítome"],"score" .38553435},
{"word":"abstract","reverse_translation":["resumo","abstrato","sumário","abstração","extrato"],"synset_id":[56872],"score" .29101658},
{"word":"resume","reverse_translation":["resumo","sumário","comprimido","pastilha"],"score" .020115795},
{"word":"brief","reverse_translation":["resumo","sumário","depoimento","causa"],"score" .011642128},
{"word":"digest","reverse_translation":["resumo","sumário","compilação","digesto","resenha","condensação"],"score" .0029899459},
{"word":"synopsis","reverse_translation":["sinopse","resumo","sumário","epítome"],"synset_id":[56872],"score" .0015755907},
{"word":"epitome","reverse_translation":["epítome","resumo"],"score" .00060744432},
{"word":"excerpt","reverse_translation":["excerto","extrato","resumo"],"synset_id":[55304],"score" .00050358905},
{"word":"abridgment","reverse_translation":["resumo","abreviação","diminuição","simplificação"],"synset_id":[58120],"score" .00050358905},
{"word":"extract","reverse_translation":["extrato","resumo","essência"],"synset_id":[55304],"score" .00036843363},
{"word":"abridgement","reverse_translation":["simplificação","resumo","abreviação","diminuição"],"synset_id":[58120],"score" .00017133754},
{"word":"compendium","reverse_translation":["compêndio","resumo","sumário"],"score":9.0288544e-05},
{"word":"precis","reverse_translation":["resumo","sumário","epítome"],"synset_id":[56872],"score":8.4818232e-05},
{"word":"syllabus","reverse_translation":["programa de estudos","sumário","resumo","sílabo"],"score":8.2208651e-05},
{"word":"condensation","reverse_translation":["condensação","resumo","abreviação"],"synset_id":[58120],"score":6.2054343e-05},
{"word":"docket","reverse_translation":["súmula","resumo","sumário","recibo","rótulo","etiqueta"],"score":5.2255e-05},
{"word":"playbill","reverse_translation":["cartaz","anúncio","sílabo","programa de estudos","resumo","sumário"],"score":2.9023204e-06}
],
"base_form":"resumo","pos_enum":1}
],
"src":"pt","server_time":10}
modified 8-Mar-14 2:31am.
|
|
|
|
|
After get response from the stream use this to collect the translation it seams to work reasonably
Have a nice weekend!
...
Stream stream = resp.GetResponseStream();
StreamReader streamReader = new StreamReader(stream);
string m_strContent = streamReader.ReadToEnd();
m_strContent = ExtractString(m_strContent, @"{""sentences"":[", "]");
string[] entrys = Regex.Split(m_strContent, @"{""trans"":""");
m_strContent = "";
foreach (string entr in entrys)
{
if (entr != "")
{
try
{
m_strContent += entr.Substring(0, entr.IndexOf
(@""",""orig"":"""));
}
catch
{
}
}
}
...
public static string ExtractString(string strText, string strx1, string strx2)
{
if (strText == "") return "";
int i = strText.IndexOf(strx1);
if (i == -1) return "";
i += strx1.Length;
int w = strText.IndexOf(strx2, i);
if (w == -1) return "";
return strText.Substring(i, w - i);
}
|
|
|
|
|
Hi Ravi,
Article is very nice especially for Beginners and Experienced Professionals. I have downloaded today and have set up Google Translator in my computer. I am trying to translate some sentences from English to French, I entered text in English sounds as "Everybody are fine" and have choosen French as target language and clicked "Translate" Button. Immediately, I have been alerted a pop up says that "Index and length must refer to a location within the string" Parameter name:length".
The below code pops up the above alert sentence which is under ParseContent Method of Translator Class
this.Translation = strTranslation.Substring (startClean, endClean - startClean + 1).Replace ("\"", "");
Could you please help me how can I translate the sentences without receiveing the above pop - up, since I have a project requirement which we have to work with Google Translator?
Thanks
Sunil
+91 9502982802
|
|
|
|
|
Hi Ravi,
Very nice article for beginners and experienced professionals. I have set up Google Translator which I downloaded from the article in my system . When I enter the text in English language which sounds as "Something sounds better than normal" under the Textbox and I choosen the target language as French and click "Translate" Button, Immediately I get the alert message says that "Index and Length must refer to a location within the string. Parameter name:length".
The below code pops up the message which is under the method parseContent() in Translator Class
this.Translation = strTranslation.Substring (startClean, endClean - startClean + 1).Replace ("\"", "");
Could you please help me how can I come out of this message? I have a project requirement with Google Translator
Thanks
Sunil
+919502982802
|
|
|
|