Skip to content

Commit

Permalink
Only apply correction on full shuangpin
Browse files Browse the repository at this point in the history
  • Loading branch information
wengxt committed Jan 29, 2025
1 parent 4b13642 commit 58414fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libime/pinyin/shuangpinprofile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,10 @@ class ShuangpinProfilePrivate {
if (correctionProfile != nullptr) {
const auto &correctionMap = correctionProfile->correctionMap();
for (const auto &[input, pys] : spTable_) {
// Only apply correction on full shuangpin.
if (input.size() < 2) {
continue;
}
for (size_t i = 0; i < input.size(); i++) {
auto chr = input[i];
auto swap = correctionMap.find(chr);
Expand Down

0 comments on commit 58414fc

Please sign in to comment.