Skip to content

Instantly share code, notes, and snippets.

@fcamblor
Last active July 26, 2021 12:37
Show Gist options
  • Save fcamblor/917f73c2d7b3b0d14980d2a3d0ab0438 to your computer and use it in GitHub Desktop.
Save fcamblor/917f73c2d7b3b0d14980d2a3d0ab0438 to your computer and use it in GitHub Desktop.
dict-fr.json

How I generated this file :

const fcontent = fs.readFileSync('./dela-fr-public.dic', 'utf16le')
const words = [...new Set(fcontent.split('\n').flatMap(line => line.split('.')[0].split(",").filter(v => !!v)))];
const singleWords = words.filter(w => w.indexOf(" ") === -1);
fs.writeFileSync("./words.json", JSON.stringify(words), 'utf16le')
fs.writeFileSync("./single-words.json", JSON.stringify(singleWords), 'utf16le')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment