This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The original code produces \ufeff in the result | |
# when I used it to count word frequency in Nias language texts. | |
# The improvement is found on https://stackoverflow.com/questions/17912307/u-ufeff-in-python-string | |
# | |
# The change is text = open('declaration.txt', mode='r', encoding='utf-8-sig').read() | |
import csv | |
import string | |
# Notes: For Nias texts be careful with "string.punctuation" below |