6 #ifndef _FCITX_LIBIME_PINYIN_PREDICTION_H_ 7 #define _FCITX_LIBIME_PINYIN_PREDICTION_H_ 12 #include <string_view> 15 #include <fcitx-utils/macros.h> 16 #include <libime/core/languagemodel.h> 17 #include <libime/core/prediction.h> 18 #include <libime/pinyin/libimepinyin_export.h> 19 #include <libime/pinyin/pinyindictionary.h> 20 #include "libime/core/historybigram.h" 24 class PinyinPredictionPrivate;
26 enum class PinyinPredictionSource { Model, Dictionary };
45 std::vector<std::pair<std::string, PinyinPredictionSource>>
46 predict(
const State &state,
const std::vector<std::string> &sentence,
47 std::string_view lastEncodedPinyin,
size_t maxSize = 0);
54 std::vector<std::pair<std::string, PinyinPredictionSource>>
55 predict(
const State &state,
56 const std::vector<libime::HistoryBigram::WordWithCode> &sentence,
62 std::vector<std::string>
63 predict(
const std::vector<std::string> &sentence = {},
size_t maxSize = 0);
66 std::unique_ptr<PinyinPredictionPrivate> d_ptr;
72 #endif // _LIBIM_LIBIME_CORE_PREDICTION_H_ PinyinDictionary is a set of dictionaries for Pinyin.
This is a prediction class that allows to predict against both model and pinyin dictionary.