Aktualizovat u4/word_count.py
This commit is contained in:
parent
30624828a4
commit
c57e5420b8
@ -5,7 +5,4 @@ from collections import Counter
|
|||||||
def word_count(text):
|
def word_count(text):
|
||||||
pattern = r"\w+(?:'\w+)?"
|
pattern = r"\w+(?:'\w+)?"
|
||||||
words = re.findall(pattern, text.lower())
|
words = re.findall(pattern, text.lower())
|
||||||
|
|
||||||
return dict(Counter(words))
|
return dict(Counter(words))
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user