#pragma once
#include "config.h"
#if USE_NLP
#include
#include
#include
#include
#include
#include
#include
namespace DB
{
class ISynonymsExtension
{
public:
using Synset = std::vector;
virtual const Synset * getSynonyms(std::string_view token) const = 0;
virtual ~ISynonymsExtension() = default;
};
class SynonymsExtensions
{
public:
using ExtPtr = std::shared_ptr;
explicit SynonymsExtensions(const Poco::Util::AbstractConfiguration & config);
ExtPtr getExtension(const String & name);
private:
struct Info
{
String path;
String type;
};
using ExtContainer = std::unordered_map;
using InfoContainer = std::unordered_map;
std::mutex mutex;
ExtContainer extensions;
InfoContainer info;
};
}
#endif