mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 14:02:21 +00:00
fd86829824
Less duplication, less confusion ...
47 lines
701 B
C++
47 lines
701 B
C++
#pragma once
|
|
|
|
#include "config.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
|