u4_repair_2_1

This commit is contained in:
Martin Škovran 2026-10-05 22:35:58 +02:00
parent 3b0f7c6e68
commit 3da6c7bdb6

View File

@ -4,8 +4,8 @@ def count_words(sentance: str) -> dict:
sent_list = list(sentance) sent_list = list(sentance)
words = defaultdict(int) words = defaultdict(int)
delims = [":", "?", "!", "\n", "\t"] delims = [":", "?", "!", "\n", "\t", ",", "."]
del_chars = ['"', ",", "."] del_chars = ['"']
forbidden = delims + del_chars + [" ", "'", ""] forbidden = delims + del_chars + [" ", "'", ""]
@ -26,5 +26,3 @@ def count_words(sentance: str) -> dict:
words[w.replace("^", "'")] += 1 words[w.replace("^", "'")] += 1
return dict(words) return dict(words)