Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- from collections import Counter
- fileName = '%Имя_файла_с_сабами_идёт_здесь%'
- fileInput = open(fileName, 'r')
- allWords = []
- for line in fileInput.readlines():
- allWords += re.findall('\w+', re.sub('[\d+,:\->\.\n\?"]', '', line))
- wordCounts = Counter(allWords)
- print(wordCounts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement