Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added json format words and Python example program #22

Merged
merged 2 commits into from
Oct 18, 2017

Conversation

arsho
Copy link
Contributor

@arsho arsho commented Aug 17, 2017

Created a JSON file called words_dictionary.json that contains all words from words_alpha.txt and they are assigned to 1.

It creates the following opportunities:

  1. It helps the programmer to easily load the file as dictionary.
  2. Dictionary search is faster than list / array search.
  3. Dictionary can be reused without reloading.

Also created read_english_dictionary.py to demonstrate the example usage of words_dictionary.json.

def load_words():
try:
filename = os.path.dirname(sys.argv[0])+"\\"+"words_dictionary.json"
with open(filename,"r") as enlish_dictionary:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: enlish_dictionary

Copy link
Member

@nelsonic nelsonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arsho great addition! thanks! 👍

@nelsonic nelsonic merged commit 6756290 into dwyl:master Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants