I have this json file:
{"certa": 1, "vez": 7, "quando": 13, "tinha": 6, "seis": 7, "anos": 6, "vi": 4, "num": 4, "livro": 3, "sobre": 6, "a": 47, "floresta": 1, "virgem": 1, "hist\u00e3\u00b3rias": 1, "vividas": 1, "uma": 31, "imponente": 1, "gravura": 1, ... }
The above file data is saved as follows:
with open(nameFileJson + '.json', 'w') as arq:
json.dump(data, arq)
Where the file name is given for the variable nameFileJson
and data
is a string with the text that will be processed to count the number of words to be added to the json file. That is, we will have a dictionary of words and frequencies. This part does it right.
I read the json file like this:
with open(nomeFile + '.json') as json_data:
dicContadores = json.load(json_data)
json_data.close()
return dicContadores
I need words to continue to be accentuated. How do I resolve this?