Skip to content

Commit 35a5b86

Browse files
committed
add default encoding for counting words as UTF-8
1 parent b660a04 commit 35a5b86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

autocorrect/word_count.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def get_words(filename, lang, encd):
1414
yield from re.findall(word_regex, line)
1515

1616

17-
def count_words(src_filename, lang, encd=None, out_filename="word_count.json"):
17+
def count_words(src_filename, lang, encd="utf-8", out_filename="word_count.json"):
1818
words = get_words(src_filename, lang, encd)
1919
counts = Counter(words)
2020
# make output file human readable

0 commit comments

Comments
 (0)