dwyl / english-words

:memo: A text file containing 479k English words for all your dictionary/word-based projects e.g: auto-completion / autosuggestion
The Unlicense
10.54k stars 1.84k forks source link

Unnecessary key, value pairs in words_dictionary.json #106

Open TheStraying11 opened 3 years ago

TheStraying11 commented 3 years ago

I feel a PR would be overkill for this, and i've honestly forgotten how to, but setting all the words to 1 in the json file is just wasting space, a bare list is perfectly valid json. since you seem to use python a fair bit

import json
import requests

current_json = "https://raw.githubusercontent.com/dwyl/english-words/master/words_dictionary.json"

with open("words_dictionary.json", "w") as f:
    json.dump(
        list(requests.get(current_json).json()),
        f,
        indent=4
    )

would do it for you quite nicely