|
Thanks! Will test this fix.
/ravi
|
|
|
|
|
Article updated - thank you for the fix!
/ravi
|
|
|
|
|
|
|
Hi Ravi,
This project is working fine in windows application. Would it be possible to make it work with web application? I tried it but response is not coming while downloading the file. Could you please help me on this?
|
|
|
|
|
I don't see why it wouldn't work in a web app. Perhaps you're making too many frequent calls to the service? That could cause Google to block your IP for a period of time.
/ravi
|
|
|
|
|
Hi Ravi,
It's working now. Blocking part was the proxy settings.
Thanks for this valuable article.
|
|
|
|
|
/ravi
|
|
|
|
|
Thanks a lot for the google translation problem!!!!
|
|
|
|
|
You're welcome. Enjoy!
/ravi
|
|
|
|
|
I'm the user Member 11644842 , who has lost his password xD
Thanks to fix the problem.
|
|
|
|
|
My pleasure! Glad you find the class useful!
/ravi
|
|
|
|
|
Nice article. Keep it up Thx.
|
|
|
|
|
|
|
|
try to translate one word from English to French (it can be any languages) - e.g. sparrow
You will receive this:
[[[ , ],[,,, ]],[[ ,[ , , ],[[ ,[ ],,0.45783335, ],[ ,[ ],,0.0033880526, ],[ ,[ ],,0.0024787523, ]], ,1]], ,,,[[ ,1,[[ ,1000,true,false],[ ,0,true,false],[ ,0,true,false],[ ,0,true,false],[ ,0,true,false]],[[0,7]], ,0,1]],0.02046049,,[[ ],,[0.02046049]],,,[[ ,[[[ , ], sparrow noun a small finchlike Old World bird related to the weaverbirds, typically with brown and gray plumage. m_en_us1292816.001 With a beat of her tiny brown wings, the sparrow was on her way. any of a number of birds that resemble true sparrows in size or color. m_en_us1292816.002 sparrow I saw one bird, a tiny \u003cb\u003esparrow\u003c/b\u003e darting through the gnarled pine limbs. m_en_us1292816.001 With a beat of her tiny brown wings, the \u003cb\u003esparrow\u003c/b\u003e was on her way. m_en_us1292816.001 It was a light gray and it had a large black beak, more like a hawk's than a \u003cb\u003esparrow\u003c/b\u003e 's. m_en_us1292816.001 An injured \u003cb\u003esparrow\u003c/b\u003e or a bird dressed for a dining table distresses her as much as war among nations and nuclear experiments do. m_en_us1292816.001 Everything from the modest \u003cb\u003esparrow\u003c/b\u003e to the extravagant scarlet macaw came to perch and settle around her. m_en_us1292816.001 The branches serve as a handy perch for the \u003cb\u003esparrows\u003c/b\u003e and mourning doves that frequent my city bird feeder. m_en_us1292816.001 Crows and \u003cb\u003esparrows\u003c/b\u003e have been known to attack innocent passers-by who happen to stroll near their nests. m_en_us1292816.001 Smaller birds such as pigeons, thrushes, jackdaws, robins and \u003cb\u003esparrows\u003c/b\u003e would also have been seen on a regular basis. m_en_us1292816.001 He fed \u003cb\u003esparrows\u003c/b\u003e and grosbeaks on a seed tray mounted on a pole to be visible from his windows. m_en_us1292816.001 While we don't have tall trees, our neighbors do, and the firs and oaks that surround our property drop acorns and provide homes for jays, woodpeckers, robins and \u003cb\u003esparrows\u003c/b\u003e. m_en_us1292816.001 Growing up, I was fascinated by birds and my mother encouraged this by letting me feed \u003cb\u003esparrows\u003c/b\u003e on the fire-escape outside our window. m_en_us1292816.001 All wild birds (except pigeons, English \u003cb\u003esparrows\u003c/b\u003e and starlings) are protected by federal and state laws, so it's illegal to trap, kill or poison them. m_en_us1292816.001 Game birds, mockingbirds, robins, and \u003cb\u003esparrows\u003c/b\u003e enjoy the juicy, sticky red fruits. m_en_us1292816.001 Some landscapes these days have been reduced to nothing but dandelions and fire ants, knapweed and thistle, where the only remaining wildlife are \u003cb\u003esparrows\u003c/b\u003e, squirrels, and starlings. m_en_us1292816.001 One sparrow box can house up to 36 baby \u003cb\u003esparrows\u003c/b\u003e in a year. m_en_us1292816.001 Stop \u003cb\u003esparrows\u003c/b\u003e and finches from shredding crocus blossoms by placing foil pinwheels - the kind sold for children's Easter baskets - every few feet among the flowers. m_en_us1292816.001 Most folks start with a feeder or two and quickly find themselves engrossed with the resident \u003cb\u003esparrows\u003c/b\u003e, finches, and woodpeckers that eagerly accept the offerings. m_en_us1292816.001 A couple of \u003cb\u003esparrows\u003c/b\u003e who had been peacefully resting on the grey rocks abruptly flew off. m_en_us1292816.001 Budgies, finches, \u003cb\u003esparrows\u003c/b\u003e and canaries are only a few of the more than one hundred kinds of birds people keep in their apartments. m_en_us1292816.001 There is nothing to see except blackbirds and \u003cb\u003esparrows\u003c/b\u003e; nothing to hear except the noise of butterflies' wings. m_en_us1292816.001 sparrow-hawk sparrow hawk
while if your input two same words - sparrow sparrow - you will receive proper answer:
moineau moineau
Mark Doubson
|
|
|
|
|
Thanks. That seems like a lot more information than we'd like to receive.
/ravi
|
|
|
|
|
You can try use
string.Format(",\"{0}\"", Translator.LanguageEnumToIdentifier(sourceLanguage))
instead of
string.Format(",,\"{0}\"", Translator.LanguageEnumToIdentifier(sourceLanguage))
result will be more reasonable:
moineau ,,,, noun passereaux moineau ,,0.45783335, passereaux ,,0.0033880526, pierrot ,,0.0024787523, sparrow
Nothing wrong from Google side - you just need to improve you parser
|
|
|
|
|
Not quite, because I think that affects other cases. Anyway, I have a fix and will be releasing it shortly.
Thanks,
/ravi
|
|
|
|
|
You can fork - two comma pattern for several words case and one comma pattern for single word.
Now nothing can be broken.
|
|
|
|
|
Yep, that's exactly what I did. The article has been updated - please test.
Thanks!
/ravi
|
|
|
|
|
Fix coming shortly... doing some final testing before I update the article.
/ravi
|
|
|
|
|
Fixed in the latest version (6-May-2015).
/ravi
|
|
|
|
|
Sorry, Ravi - again error - you need to change you logic:
else
{
text = text.Substring(0, index);
text = text.Replace("],[", ",");
text = text.Replace("]", string.Empty);
text = text.Replace("[", string.Empty);
text = text.Replace("\",\"", "\"");
string[] phrases = text.Split(new[] { '\"' }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; (i < phrases.Count()); i += 2)
{
translation += phrases[i] + " ";
}
translation = translation.Trim();
translation = translation.Replace(" ?", "?");
translation = translation.Replace(" !", "!");
translation = translation.Replace(" ,", ",");
translation = translation.Replace(" .", ".");
translation = translation.Replace(" ;", ";");
}
Mark Doubson, Montreal, Canada
|
|
|
|
|