Skip to content

Commit

Permalink
feat: 双拼方案增加自然码 #55
Browse files Browse the repository at this point in the history
  • Loading branch information
lazyloong committed Jun 11, 2024
1 parent 94d1413 commit dce0e0d
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"author": "lazyloong",

"minAppVersion": "1.0.0",
"version": "2.25.1"
"version": "2.26.0"
}
28 changes: 28 additions & 0 deletions src/dict/double_pinyin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,34 @@ const DoubleDict = {
n: ["n", "iao"],
m: ["m", "ian"],
},
自然码: {
q: ["q", "iu"],
w: ["w", "ia", "ua"],
e: ["e"],
r: ["r", "uan", "van"],
t: ["t", "ve", "ue"],
y: ["y", "uai", "ing"],
u: ["sh", "u"],
i: ["ch", "i"],
o: ["o", "uo"],
p: ["p", "vn", "un"],
a: ["a"],
s: ["s", "ong", "iong"],
d: ["d", "iang", "uang"],
f: ["f", "en"],
g: ["g", "eng"],
h: ["h", "ang"],
j: ["j", "an"],
k: ["k", "ao"],
l: ["l", "ai"],
z: ["z", "ei"],
x: ["x", "ie"],
c: ["c", "iao"],
v: ["zh", "ui", "v"],
b: ["b", "ou"],
n: ["n", "in"],
m: ["m", "ian"],
},
};

export default DoubleDict;
16 changes: 10 additions & 6 deletions src/settingTab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,18 @@ export default class SettingTab extends PluginSettingTab {
}
);
});
const doublePinyinOptions = Object.keys(DoubleDict).reduce(
(acc, cur) => {
acc[cur] = cur;
return acc;
},
{
全拼: "全拼",
}
);
new Setting(this.containerEl).setName("双拼方案").addDropdown((cb) =>
cb
.addOptions({
全拼: "全拼",
智能ABC: "智能ABC",
小鹤双拼: "小鹤双拼",
微软双拼: "微软双拼",
})
.addOptions(doublePinyinOptions)
.setValue(this.plugin.settings.global.doublePinyin)
.onChange(async (value: keyof typeof DoubleDict | "全拼") => {
if (this.plugin.settings.global.doublePinyin == value) return;
Expand Down

0 comments on commit dce0e0d

Please sign in to comment.