-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemoExample.cc
More file actions
48 lines (36 loc) · 1.21 KB
/
Copy pathdemoExample.cc
File metadata and controls
48 lines (36 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "BingTranslator.h"
using namespace std;
/**
This is a demo file which shows the translation of text from
English to Spanish.
Enter the client ID and the clientSecret before compiling
this file.
Also export the Java libraries before compiling the files.
Refer README for more details.
Author: Jigar Gada
ContactMe: jigargada90@gmail.com
Last updated: 07/03/2014
*/
int main(int argc, char const *argv[])
{
//text which has to be converted.
string english = "Hello how are you";
//Enter the client ID and the client Secret
string clientID = "*******";
string clientSec = "*******************************";
//Convert from English to Spanish.
//"en" and "es" are the codewords for English and Spanish respectively.
// In order to use your languages, refer the file *list_of_languages.txt*.
string translateFrom = "en";
string translateTo = "es";
//Create an object of Translator.
Translator Tr;
//Call the translateData fucntion.
string spanish = Tr.translateData(english, clientID,clientSec, translateFrom, translateTo);
cout << "English = " << english << endl;
cout << "Spanish = " << spanish << endl;
//Output should be -->
//English = Hello how are you
//Spanish = Hola cómo estás
return 0;
}