Skip to content

Commit efc862b

Browse files
committed
Add shuangpin GB/T 34947-2017
fcitx/fcitx5-chinese-addons#258
1 parent e13df76 commit efc862b

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

src/libime/pinyin/shuangpindata.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,26 @@ static const SP_C SPMap_C_XIAOHE[] = {
9595
static const SP_S SPMap_S_XIAOHE[] = {
9696
{"ch", 'i'}, {"sh", 'u'}, {"zh", 'v'}, {"\0", '\0'}};
9797

98+
static const SP_C SPMap_C_GB[] = {
99+
{.strQP = "ai", .cJP = 'k'}, {.strQP = "an", .cJP = 'f'},
100+
{.strQP = "ang", .cJP = 'g'}, {.strQP = "ao", .cJP = 'c'},
101+
{.strQP = "ei", .cJP = 'b'}, {.strQP = "en", .cJP = 'r'},
102+
{.strQP = "eng", .cJP = 'h'}, {.strQP = "er", .cJP = 'l'},
103+
{.strQP = "ia", .cJP = 'q'}, {.strQP = "ian", .cJP = 'd'},
104+
{.strQP = "iang", .cJP = 'n'}, {.strQP = "iao", .cJP = 'm'},
105+
{.strQP = "ie", .cJP = 't'}, {.strQP = "in", .cJP = 'l'},
106+
{.strQP = "ing", .cJP = 'j'}, {.strQP = "iong", .cJP = 's'},
107+
{.strQP = "iu", .cJP = 'y'}, {.strQP = "ong", .cJP = 's'},
108+
{.strQP = "ou", .cJP = 'p'}, {.strQP = "ua", .cJP = 'q'},
109+
{.strQP = "uai", .cJP = 'y'}, {.strQP = "uan", .cJP = 'w'},
110+
{.strQP = "uang", .cJP = 'n'}, {.strQP = "ue", .cJP = 'x'},
111+
{.strQP = "ui", .cJP = 'v'}, {.strQP = "un", .cJP = 'z'},
112+
{.strQP = "uo", .cJP = 'o'}, {.strQP = "ve", .cJP = 'x'},
113+
{.strQP = "v", .cJP = 'v'}, {.strQP = "\0", .cJP = '\0'}};
114+
115+
static const SP_S SPMap_S_GB[] = {{.strQP = "ch", .cJP = 'i'},
116+
{.strQP = "sh", .cJP = 'u'},
117+
{.strQP = "zh", .cJP = 'v'},
118+
{.strQP = "\0", .cJP = '\0'}};
119+
98120
#endif

src/libime/pinyin/shuangpinprofile.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,11 @@ ShuangpinProfile::ShuangpinProfile(
398398
c = SPMap_C_XIAOHE;
399399
s = SPMap_S_XIAOHE;
400400
break;
401+
case ShuangpinBuiltinProfile::GB:
402+
d->zeroS_ = "a";
403+
c = SPMap_C_GB;
404+
s = SPMap_S_GB;
405+
break;
401406
default:
402407
throw std::invalid_argument("Invalid profile");
403408
}

src/libime/pinyin/shuangpinprofile.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ enum class ShuangpinBuiltinProfile {
2626
Zhongwenzhixing,
2727
PinyinJiajia,
2828
Xiaohe,
29+
GB,
2930
};
3031

3132
class ShuangpinProfilePrivate;

0 commit comments

Comments
 (0)