Skip to content

Instantly share code, notes, and snippets.

@amankharwal

amankharwal/next word.py Secret

Created Jan 19, 2021
Embed
What would you like to do?
with open('dataset.txt', 'r') as dataset:
for line in dataset:
words = line.strip().split(' ')
for i in range(len(words) - 1):
update_lexicon(words[i], words[i+1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment