happy bday!

This commit is contained in:
Joey Eamigh
2024-05-26 22:45:45 -04:00
commit be3a13eee1
34 changed files with 233005 additions and 0 deletions

17
clean.ts Normal file
View File

@@ -0,0 +1,17 @@
import dictionary from './en_eo_dict.json' assert { type: 'json' };
const wordRegex = /^[a-z]+$/;
const cleanDict = dictionary
.filter(({ word }) => wordRegex.test(word))
.filter(({ translation }) => wordRegex.test(translation))
.filter((e) => e.snc_index === null)
.reduce((acc, cur) => {
const wordExists = acc.some((item) => item.word === cur.word);
const translationExists = acc.some((item) => item.translation === cur.translation);
if (wordExists || translationExists) return acc;
return [...acc, cur];
}, [] as typeof dictionary)
.map(({ word, translation }) => ({ word, translation }));
await Bun.write('en_eo_dict_clean.json', JSON.stringify(cleanDict, null, 2));