File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 55 */
66#include " pinyinime.h"
77#include " libime/core/userlanguagemodel.h"
8+ #include " libime/pinyin/pinyincorrectionprofile.h"
9+ #include " libime/pinyin/pinyinencoder.h"
810#include " pinyindecoder.h"
911
1012namespace libime {
@@ -25,6 +27,7 @@ class PinyinIMEPrivate : fcitx::QPtrHolder<PinyinIME> {
2527 std::unique_ptr<UserLanguageModel> model_;
2628 std::unique_ptr<PinyinDecoder> decoder_;
2729 std::shared_ptr<const ShuangpinProfile> spProfile_;
30+ std::shared_ptr<const PinyinCorrectionProfile> correctionProfile_;
2831 size_t nbest_ = 1 ;
2932 size_t beamSize_ = Decoder::beamSizeDefault;
3033 size_t frameSize_ = Decoder::frameSizeDefault;
@@ -174,4 +177,20 @@ std::shared_ptr<const ShuangpinProfile> PinyinIME::shuangpinProfile() const {
174177 FCITX_D ();
175178 return d->spProfile_ ;
176179}
180+
181+ void PinyinIME::setCorrectionProfile (
182+ std::shared_ptr<const PinyinCorrectionProfile> profile) {
183+ FCITX_D ();
184+ if (d->correctionProfile_ != profile) {
185+ d->correctionProfile_ = std::move (profile);
186+ emit<PinyinIME::optionChanged>();
187+ }
188+ }
189+
190+ std::shared_ptr<const PinyinCorrectionProfile>
191+ PinyinIME::correctionProfile () const {
192+ FCITX_D ();
193+ return d->correctionProfile_ ;
194+ }
195+
177196} // namespace libime
Original file line number Diff line number Diff line change 99#include " libimepinyin_export.h"
1010#include < fcitx-utils/connectableobject.h>
1111#include < fcitx-utils/macros.h>
12+ #include < libime/pinyin/pinyincorrectionprofile.h>
1213#include < libime/pinyin/pinyinencoder.h>
1314#include < limits>
1415#include < memory>
@@ -46,6 +47,10 @@ class LIBIMEPINYIN_EXPORT PinyinIME : public fcitx::ConnectableObject {
4647 void setPreeditMode (PinyinPreeditMode mode);
4748 PinyinPreeditMode preeditMode () const ;
4849
50+ void setCorrectionProfile (
51+ std::shared_ptr<const PinyinCorrectionProfile> profile);
52+ std::shared_ptr<const PinyinCorrectionProfile> correctionProfile () const ;
53+
4954 float maxDistance () const ;
5055 float minPath () const ;
5156
You can’t perform that action at this time.
0 commit comments