first20hours / google-10000-english

This repo contains a list of the 10,000 most common English words in order of frequency, as determined by n-gram frequency analysis of the Google's Trillion Word Corpus.
Other
3.88k stars 1.93k forks source link

How do you get it to work? #27

Open jw4wellness opened 4 years ago

shyok0 commented 4 years ago

I reckon, import it as a list and use it to your preference. If that's what you are looking for, then,

Update: Obivously, best way to read a huge list more often is through a Trie. It can be useful if you need the word list to do spell check, auto completion, generate a random dictionary list and much more.

# Strip words from txt file
raw_list = open('file_path/name', "r").splitlines()

'''
raw_list = 'Wooden\nsome\nword\nthis\nis\na\nword\nalmost\ngutter\ngrim\nburn\ntime\nvictory\ngame\nappend'
raw_list = raw_list.splitlines()
'''

dict_list = []
for line in raw_list:
  dict_list.append(line)

# print(dict_list)