core_plugin.cpp 1.34 KB
//*****************************************************************
/*
	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;
}