Skip to content

Commit 2a3cbec

Browse files
committed
Reverse existing UK --> US dict
All words in the UK dict are now included in the dict for US --> UK.
1 parent f7ab7c4 commit 2a3cbec

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/dict.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const dict:{[key:string]:string} = {
1+
const dictUK:{[key:string]:string} = {
22
aeroplane: "aeroplane||||airplane||||",
33
aeroplanes: "aeroplanes||||airplanes||||",
44
aesthetical: "aesthetic|esthetic|esthetical||esthetic|aesthetic|aesthetical||",
@@ -80,6 +80,7 @@ export const dict:{[key:string]:string} = {
8080
neighbourliness: "neighbourliness||||neighborliness||||",
8181
neighbourly: "neighbourly||||neighborly||||",
8282
nonunionised: "nonunionised||||nonunionized||||",
83+
odour: "odour||||odor||||",
8384
practise: "practise|practice|||practice|practise|||",
8485
practised: "practised|practiced|||practiced|practised|||",
8586
practises: "practises|practices|||practices|practises|||",
@@ -210,4 +211,18 @@ export const dict:{[key:string]:string} = {
210211
vises: "vices||||vises|vices|||"
211212
};
212213

214+
let dictUS:{[key:string]:string} = {};
215+
Object.keys(dictUK).forEach(key => {
216+
const [ uk1, uk2, uk3, uk4, us1, us2, us3, us4, ukus ] = dictUK[key].split('|');
217+
if(us1) dictUS[us1] = dictUK[key];
218+
if(us2) dictUS[us2] = dictUK[key];
219+
if(us3) dictUS[us3] = dictUK[key];
220+
if(us4) dictUS[us4] = dictUK[key];
221+
});
222+
223+
export const dict = {
224+
...dictUK,
225+
...dictUS,
226+
};
227+
213228
export default dict;

0 commit comments

Comments
 (0)