Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. def updater_2(tword, counter):
  2. for i in range(len(tword)):
  3. cword = copy(tword)
  4. for v in vocab:
  5. cword = cword[:i] + v + cword[i+1:]
  6. if cword in new_words:
  7. counter[cword] += 1
  8. return counter
  9. for i in range(len(tword)+1):
  10. cword = copy(tword)
  11. for v in vocab:
  12. cword = cword[:i] + v + cword[i:]
  13. if cword in new_words:
  14. counter[cword] += 1
  15. return counter
  16. return counter
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement