/* * SPDX-FileCopyrightText: 2017-2017 CSSlayer * * SPDX-License-Identifier: LGPL-2.1-or-later * */ #ifndef _PINYINHELPER_STROKE_H_ #define _PINYINHELPER_STROKE_H_ #include #include #include #include #include #include namespace fcitx { class Stroke { public: Stroke(); void loadAsync(); bool load(); std::vector> lookup(std::string_view input, int limit); std::string prettyString(const std::string &input) const; std::string reverseLookup(const std::string &hanzi) const; private: libime::DATrie dict_; libime::DATrie revserseDict_; bool loaded_ = false; bool loadResult_ = false; std::future, libime::DATrie>> loadFuture_; }; } // namespace fcitx #endif // _PINYINHELPER_STROKE_H_