Update u4/word_count.py
This commit is contained in:
parent
74bbeb731b
commit
ee6aa451fe
@ -2,7 +2,7 @@ import re
|
|||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
def count_words(text: str) -> dict[str, int]:
|
def count_words(text: str) -> dict[str, int]:
|
||||||
text = text.lower
|
text = text.lower()
|
||||||
|
|
||||||
words = re.findall(r"[a-z0-9áäčďéíľňóôŕšťúýž]+(?:'[a-z0-9áäčďéíľňóôŕšťúýž]+)?", text)
|
words = re.findall(r"[a-z0-9áäčďéíľňóôŕšťúýž]+(?:'[a-z0-9áäčďéíľňóôŕšťúýž]+)?", text)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user