diff --git a/src/libime/pinyin/shuangpindata.h b/src/libime/pinyin/shuangpindata.h index e2ae177..e6ab170 100644 --- a/src/libime/pinyin/shuangpindata.h +++ b/src/libime/pinyin/shuangpindata.h @@ -95,4 +95,26 @@ static const SP_C SPMap_C_XIAOHE[] = { static const SP_S SPMap_S_XIAOHE[] = { {"ch", 'i'}, {"sh", 'u'}, {"zh", 'v'}, {"\0", '\0'}}; +static const SP_C SPMap_C_GB[] = { + {.strQP = "ai", .cJP = 'k'}, {.strQP = "an", .cJP = 'f'}, + {.strQP = "ang", .cJP = 'g'}, {.strQP = "ao", .cJP = 'c'}, + {.strQP = "ei", .cJP = 'b'}, {.strQP = "en", .cJP = 'r'}, + {.strQP = "eng", .cJP = 'h'}, {.strQP = "er", .cJP = 'l'}, + {.strQP = "ia", .cJP = 'q'}, {.strQP = "ian", .cJP = 'd'}, + {.strQP = "iang", .cJP = 'n'}, {.strQP = "iao", .cJP = 'm'}, + {.strQP = "ie", .cJP = 't'}, {.strQP = "in", .cJP = 'l'}, + {.strQP = "ing", .cJP = 'j'}, {.strQP = "iong", .cJP = 's'}, + {.strQP = "iu", .cJP = 'y'}, {.strQP = "ong", .cJP = 's'}, + {.strQP = "ou", .cJP = 'p'}, {.strQP = "ua", .cJP = 'q'}, + {.strQP = "uai", .cJP = 'y'}, {.strQP = "uan", .cJP = 'w'}, + {.strQP = "uang", .cJP = 'n'}, {.strQP = "ue", .cJP = 'x'}, + {.strQP = "ui", .cJP = 'v'}, {.strQP = "un", .cJP = 'z'}, + {.strQP = "uo", .cJP = 'o'}, {.strQP = "ve", .cJP = 'x'}, + {.strQP = "v", .cJP = 'v'}, {.strQP = "\0", .cJP = '\0'}}; + +static const SP_S SPMap_S_GB[] = {{.strQP = "ch", .cJP = 'i'}, + {.strQP = "sh", .cJP = 'u'}, + {.strQP = "zh", .cJP = 'v'}, + {.strQP = "\0", .cJP = '\0'}}; + #endif diff --git a/src/libime/pinyin/shuangpinprofile.cpp b/src/libime/pinyin/shuangpinprofile.cpp index e35042b..31228f6 100644 --- a/src/libime/pinyin/shuangpinprofile.cpp +++ b/src/libime/pinyin/shuangpinprofile.cpp @@ -398,6 +398,11 @@ ShuangpinProfile::ShuangpinProfile( c = SPMap_C_XIAOHE; s = SPMap_S_XIAOHE; break; + case ShuangpinBuiltinProfile::GB: + d->zeroS_ = "a"; + c = SPMap_C_GB; + s = SPMap_S_GB; + break; default: throw std::invalid_argument("Invalid profile"); } diff --git a/src/libime/pinyin/shuangpinprofile.h b/src/libime/pinyin/shuangpinprofile.h index 9269d6b..73e4c3d 100644 --- a/src/libime/pinyin/shuangpinprofile.h +++ b/src/libime/pinyin/shuangpinprofile.h @@ -26,6 +26,7 @@ enum class ShuangpinBuiltinProfile { Zhongwenzhixing, PinyinJiajia, Xiaohe, + GB, }; class ShuangpinProfilePrivate;