This commit is contained in:
Martin Škovran 2026-10-06 12:44:50 +02:00
parent 37e465da2d
commit 6dad46914b
2 changed files with 4 additions and 5 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*.test.py

View File

@ -6,10 +6,10 @@ def count_words(sentance: str) -> dict:
SPECIAL_CHAR = oct(7)
delims = [":", "?", "!", "\n", "\t", ",", ".", "_", '&', '@', '$', '%', '^', '&']
del_chars = ['"']
delims = ":?!\n\t,._&@$^&*()%"
del_chars = '"'
forbidden = delims + del_chars + [" ", "'", ""]
forbidden = list(delims) + list(del_chars) + [" ", "'", ""]
for i, ch in enumerate(sent_list):
if(ch in delims):
@ -28,5 +28,3 @@ def count_words(sentance: str) -> dict:
words[w.replace(SPECIAL_CHAR, "'")] += 1
return dict(words)
print(count_words("""seriál: seriálik ako Dunaj: Panelák!!&@$%^&"""))