How I generated this file :
- I imported file from https://infolingu.univ-mlv.fr/DonneesLinguistiques/Dictionnaires/telechargement.html
- I parsed it, extracted words, removed duplicates (through a
Set
) and generated a JSON file format :
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')