18#include <QWriteLocker>
29 extern template class LIMA_FSAACCESS_EXPORT FsaAccessReader16<class boost::adjacency_list<struct boost::vecS,struct boost::vecS,struct boost::bidirectionalS,struct boost::property<enum vertex_count_t,class std::vector<int,class std::allocator<int> >,
struct boost::property<enum
boost::vertex_name_t,uint64_t,struct boost::property<enum vertex_text_t,class QString,struct boost::no_property> > >,struct boost::no_property,struct boost::no_property,struct boost::listS> >;
32namespace LinguisticProcessing
37#define FSAACCESSRESSOURCE_CLASSID "FsaAccess"
41FsaAccessResource::FsaAccessResource(QObject* parent)
69 if (! keyFile.isEmpty())
71 auto fsaAccess = std::make_shared<FsaAccess::FsaAccessSpare16>();
72 QWriteLocker locker(&m_lock);
73 LINFO <<
"FsaAccessResource::init read keyFile" << keyFile;
74 fsaAccess->read(keyFile.toStdString());
87 QTextStream qts(&errorString);
88 qts <<
"no param 'keyFile' in FsaAccessResource group for language "
89 << (int) manager->getInitializationParameters().language;
96 QTextStream qts(&errorString);
99 <<
" not found for language "
100 << (int) manager->getInitializationParameters().language
111void FsaAccessResource::accessFileChanged (
const QString & path )
117 if (QFileInfo::exists(path))
119 LINFO <<
"FsaAccessResource::accessFileChanged reload" << path;
120 auto fsaAccess = std::make_shared<FsaAccess::FsaAccessSpare16>();
121 QWriteLocker locker(&m_lock);
122 fsaAccess->read(path.toUtf8().constData());
129 LINFO <<
"FsaAccessResource::accessFileChanged deleted, ignoring" << path;
#define FSAACCESSRESSOURCE_CLASSID
#define LIMA_FSAACCESS_EXPORT
#define ANALYSISDICTLOGINIT
Defines a Factory to create Object of type Base.
Use this exception to signal the used of a wrongly initialized LIMA dictionary.
std::string & getParamsValueAtKey(const std::string &key)
return a message when a 'param' was not found
Use this exception to signal an error in one of the configuration files.
void resourceFileChanged(const QString &path)
Signal triggered whenever one of the registered files changes on disk.
QString getResourceFileName(const QString ¶mName)
void accessFileReloaded(std::shared_ptr< Common::AbstractAccessByString > fsaAccess)
virtual ~FsaAccessResource()
virtual std::shared_ptr< Common::AbstractAccessByString > getAccessByString() const override
std::shared_ptr< Common::AbstractAccessByString > m_fsaAccess
virtual void init(Common::XMLConfigurationFiles::GroupConfigurationStructure &unitConfiguration, Manager *manager) override
initialize with parameters from configuration file.
static const MediaticData & single()
const singleton accessor
SimpleFactory< AbstractResource, FsaAccessResource > fsaAccessResourceFactory(FSAACCESSRESSOURCE_CLASSID)
launch exception related to the configuration file parsing