google-translate

JSONDecodeError using Google Translate API with Python3

冷暖自知 提交于 2019-12-28 04:20:07
问题 I've searched thoroughly on Stack Overflow but couldn't find an answer to this problem. I'm trying to use the Google Translate API (googletrans 2.2.0) for Python (3.6.2) and am trying to translate a set of non-English documents into English. I am letting Google Translate do the language detection. Here is my code: ## newcorpus is a corpus I have created consisting of non-english documents fileids = newcorpus.fileids for f in fileids: p = newcorpus.raw(f) p = str(p[:15000]) translated_text =

Resources for programs teaching natural languages

笑着哭i 提交于 2019-12-25 18:28:23
问题 What API's and data sets are available for use in programs to teach natural languages e.g. to aid in learning to read/write/listen/speak a 2nd language? These could be web or traditional API's to dictionaries, translation services, associations of words / concepts to images, sounds e.g. spoken words or phrases, movies, or sets of flashcard decks. Also of interest are websites that could be spidered to obtain local data sets for offline use. As a start, I note that that the Google translate

Google Translate: TranslateElement is not a function

纵然是瞬间 提交于 2019-12-25 14:26:13
问题 i was trying adding Google translate dropdown to a website. For the sake of simplicity, i added all the code in the same place of the page. I have added this code (slightly beautified): <div id="google_translate_element"></div> <script type="text/javascript"> function googleTranslateElementInit() { new google.translate.TranslateElement( { pageLanguage: 'it', includedLanguages: 'de,en,es,fr,it', gaTrack: true, gaId: 'UA-XXXXXXXX-X' }, 'google_translate_element' ); } </script> <script type=

Unable to set google api credentials

放肆的年华 提交于 2019-12-25 08:56:47
问题 I am trying to use the google translation api in my application by following these instructions, but having some trouble setting up the authorisation. I created the service account, got the json file, and set it in with set GOOGLE_APPLICATION_CREDENTIALS="C:\Users\Bassie\Documents\.credentials\google-translation-api\My Project-d885ebbbe907.json" After running that command I don't see any output, and I don't see a system environment variable called GOOGLE_APPLICATION_CREDENTIALS (is that where

Google Translate API v2 - skip words and special character

醉酒当歌 提交于 2019-12-25 05:04:18
问题 I'm trying to use the Google API V2 with PHP I need to exclude some words so I'm wrapping them into <span class"notranslate">WORD</span> The problem is that my text contains some special chars so I'm using urlencode($input) The issue is that urlencode breaks the exclude word functionality ... What I'm doing wrong ? Example $url = "https://www.googleapis.com/language/translate/v2"; $params = array( 'key' => $helper->getConfigValue('google_api'), 'source' => $from, 'target' => $to, // NOTE for

grab/copy/convert to variable: google translated text (write to other page) client side

人盡茶涼 提交于 2019-12-24 10:38:55
问题 Primarily need to understand how to manipulate the displayed translated text, using javascript, in order to convert it to usable text. I'm creating a 3 box translation system: source text-->translated text-->source language This will allow English to be entered. The French translation (next to it). The French translated back into English (next to it). This would be the ultimate google translator as the writer could check his French translation by reading it in English (as he types it!!);

python text translation to speech

不羁岁月 提交于 2019-12-24 08:19:04
问题 I am working on testing text translation (from English to other language) and translation to audio code using python. I am using google translate api for translation and win32 for audio. While testing i found that google supports https://gist.github.com/jseabold/1473363 these languages. The translation part of code seem to be working fine for many options but audio part only works with a few languages (english , spanish , italian etc works). as you can see in example below I can see text is

how to translate language of a control using google api

泄露秘密 提交于 2019-12-24 07:29:50
问题 I download the GoogleTranslateAPI.dll file and added the reference of it to my project. Now i took a textbox and wrote 'John' in it and took a label and want to be written 'John' in it but in 'French' language. So i wrote in the button_click event.... private void button1_Click(object sender, EventArgs e) { string TT = Txt1.Text; Label1.Text=Google.API.Translate.Translator.Translate(TT, Google.API.Translate.Language.English,Google.API.Translate.Language.French); } This gives an error saying

Angular 6: Error: Can't resolve './package' after installing google-translate-api

↘锁芯ラ 提交于 2019-12-24 05:48:18
问题 I've just installed google-translate-api via npm with npm install --save google-translate-api . I didn't get any error message, but when I tried to run npm start it showed the following errors: ERROR in ./node_modules/got/index.js Module not found: Error: Can't resolve './package' in '/home/zolastro/Documents/Work/GenEnginePMV/genengine/GenEngine/node_modules/got' ERROR in ./node_modules/osenv/osenv.js Module not found: Error: Can't resolve 'child_process' in '/home/zolastro/Documents/Work

Google translate not translating in IE when website opened from vba

别等时光非礼了梦想. 提交于 2019-12-24 05:32:31
问题 Google translate is not translating text (Japanese to English). The function always returns "" when the website is opened and the text is input using the following code: Function OutlookGetTransItem(IE As Object, URL As String, trans_text As String) As String Dim t As Date If trans_text = "" Then OutlookGetTransItem = trans_text: Exit Function Const MAX_WAIT_SEC As Long = 5 With IE .Visible = True .navigate URL While .Busy Or .ReadyState < 4: DoEvents: Wend .Document.querySelector("#source")