Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def updater_2(tword, counter):
- for i in range(len(tword)):
- cword = copy(tword)
- for v in vocab:
- cword = cword[:i] + v + cword[i+1:]
- if cword in new_words:
- counter[cword] += 1
- return counter
- for i in range(len(tword)+1):
- cword = copy(tword)
- for v in vocab:
- cword = cword[:i] + v + cword[i:]
- if cword in new_words:
- counter[cword] += 1
- return counter
- return counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement