mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-14 02:12:21 +00:00
47 lines
706 B
C++
47 lines
706 B
C++
#pragma once
|
|
|
|
#include "config_core.h"
|
|
|
|
#if USE_NLP
|
|
|
|
#include <base/types.h>
|
|
#include <Poco/Util/Application.h>
|
|
|
|
#include <mutex>
|
|
#include <unordered_map>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
class ILemmatizer
|
|
{
|
|
public:
|
|
using TokenPtr = std::shared_ptr<char []>;
|
|
|
|
virtual TokenPtr lemmatize(const char * token) = 0;
|
|
|
|
virtual ~ILemmatizer() = default;
|
|
};
|
|
|
|
|
|
class Lemmatizers
|
|
{
|
|
public:
|
|
using LemmPtr = std::shared_ptr<ILemmatizer>;
|
|
|
|
private:
|
|
std::mutex mutex;
|
|
std::unordered_map<String, LemmPtr> lemmatizers;
|
|
std::unordered_map<String, String> paths;
|
|
|
|
public:
|
|
explicit Lemmatizers(const Poco::Util::AbstractConfiguration & config);
|
|
|
|
LemmPtr getLemmatizer(const String & name);
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|