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 5
5
*/
6
6
#include " pinyinime.h"
7
7
#include " libime/core/userlanguagemodel.h"
8
+ #include " libime/pinyin/pinyincorrectionprofile.h"
9
+ #include " libime/pinyin/pinyinencoder.h"
8
10
#include " pinyindecoder.h"
9
11
10
12
namespace libime {
@@ -25,6 +27,7 @@ class PinyinIMEPrivate : fcitx::QPtrHolder<PinyinIME> {
25
27
std::unique_ptr<UserLanguageModel> model_;
26
28
std::unique_ptr<PinyinDecoder> decoder_;
27
29
std::shared_ptr<const ShuangpinProfile> spProfile_;
30
+ std::shared_ptr<const PinyinCorrectionProfile> correctionProfile_;
28
31
size_t nbest_ = 1 ;
29
32
size_t beamSize_ = Decoder::beamSizeDefault;
30
33
size_t frameSize_ = Decoder::frameSizeDefault;
@@ -174,4 +177,20 @@ std::shared_ptr<const ShuangpinProfile> PinyinIME::shuangpinProfile() const {
174
177
FCITX_D ();
175
178
return d->spProfile_ ;
176
179
}
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
+
177
196
} // namespace libime
Original file line number Diff line number Diff line change 9
9
#include " libimepinyin_export.h"
10
10
#include < fcitx-utils/connectableobject.h>
11
11
#include < fcitx-utils/macros.h>
12
+ #include < libime/pinyin/pinyincorrectionprofile.h>
12
13
#include < libime/pinyin/pinyinencoder.h>
13
14
#include < limits>
14
15
#include < memory>
@@ -46,6 +47,10 @@ class LIBIMEPINYIN_EXPORT PinyinIME : public fcitx::ConnectableObject {
46
47
void setPreeditMode (PinyinPreeditMode mode);
47
48
PinyinPreeditMode preeditMode () const ;
48
49
50
+ void setCorrectionProfile (
51
+ std::shared_ptr<const PinyinCorrectionProfile> profile);
52
+ std::shared_ptr<const PinyinCorrectionProfile> correctionProfile () const ;
53
+
49
54
float maxDistance () const ;
50
55
float minPath () const ;
51
56
You can’t perform that action at this time.
0 commit comments