Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # init opens up the files and does a few checks on them
- def init(sample, common):
- try:
- with(common, 'r') as f:
- common_words = f.read()
- common_words = list(common_words)
- f.close()
- # convert list to lowercase
- common_words = [item.lower() for item in common_words]
- temp = []
- for word in common_words:
- word = word.replace('\n', '')
- temp += [word]
- common_words = temp
- except OSError as error:
- print('Cannot open {0:s}'.format(filename))
- raise error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement