void lggHunSpell_Wrapper::setNewDictionary(std::string newDict)
{

	llinfos << "Setting new base dictionary long name is-> " << newDict.c_str() << llendl;

	currentBaseDic = newDict;
	
	//expecting a full name comming in
	newDict = fullName2DictName(newDict);

	if (myHunspell)
	{
		delete myHunspell;
	}

	std::string dicaffpath = getCorrectPath(newDict+".aff");
	std::string dicdicpath = getCorrectPath(newDict+".dic");
	
	llinfos << "Setting new base dictionary -> " << dicaffpath.c_str() << llendl;

	myHunspell = new Hunspell(dicaffpath.c_str(), dicdicpath.c_str());
	llinfos << "Adding custom dictionary " << llendl;
	createCustomDic();
	addDictionary("custom");
	std::vector<std::string> toInstall = getInstalledDicts();
	for (int i = 0; i < (int)toInstall.size(); i++)
	{
		addDictionary(toInstall[i]);
	}
}
void lggHunSpell_Wrapper::addDictionary(std::string additionalDictionary)
{
	if(!myHunspell)return;
	if(additionalDictionary=="")return;
	//expecting a full name here
	std::string dicpath=getCorrectPath(fullName2DictName(additionalDictionary)+".dic");
	if(gDirUtilp->fileExists(dicpath))
	{
		llinfos << "Adding additional dictionary -> " << dicpath.c_str() << llendl;
		myHunspell->add_dic(dicpath.c_str());
	}
}