core_plugin.cpp
1.34 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
//*****************************************************************
/*
VLibras: Automatic contents translator from Portuguese to LIBRAS
Copyright (c) 2015 Gustavo Sobral, Erickson Silva, Leonardo Araújo
VLibras-Core group at LAViD, Federal University of Paraiba
*/
//*****************************************************************
/**
* \file corePlugin.cpp
* \author Gustavo Sobral, Leonardo Araújo
* \date Janeiro 2015
*/
#include "core_plugin.h"
int coreInitialize()
{
// Initialize the translater (python) enviroment
//tradutor = new PyTradutor();
printf("[INFO]: CorePlugin initialized\n");
return 1;
}
const char* coreExecute()
{
printf("[INFO]: CorePlugin running\n");
// Gets the content on Pasteboard and pass it as argument for the translater
//std::string pasteboardContent = Pasteboard::getGeneralContent();
printf("[WAR]: *** XSel not found!\n");
char* str = new char[10];
strcpy(str, "teste da biblioteca do sistema");
std::string traducao = tradutor->convertStringToGlosa((const char*) str);
// Puts the translater return in lowercase and convert it as char pointer to be returned
//std::transform(traducao.begin(), traducao.end(), traducao.begin(), ::tolower);
return traducao.c_str();
}
int coreFinalize()
{
// Finalize the translater
if (tradutor)
delete tradutor;
printf("[INFO]: CorePlugin finalized\n");
return 1;
}