u4_repair_2_1
This commit is contained in:
parent
3b0f7c6e68
commit
3da6c7bdb6
@ -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)
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user