#pragma once #include #include #include #include #include #include #include namespace DB { class ISynonymsExtension { public: using Synset = std::vector; virtual const Synset * getSynonyms(const std::string_view & token) const = 0; virtual ~ISynonymsExtension() = default; }; class SynonymsExtensions { public: using ExtPtr = std::shared_ptr; 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; }; }