* Make generate_specials pretty-print the specials.json file

This commit is contained in:
Matthew Honnibal 2015-10-09 19:23:47 +11:00
parent 1842a53e73
commit 1490feda29
1 changed files with 3 additions and 3 deletions

View File

@ -1,3 +1,4 @@
# -#- coding: utf-8 -*-
import json import json
contractions = {"n't", "'nt", "not", "'ve", "'d", "'ll", "'s", "'m", "'ma", "'re"} contractions = {"n't", "'nt", "not", "'ve", "'d", "'ll", "'s", "'m", "'ma", "'re"}
@ -132,7 +133,6 @@ hardcoded_specials = {
"Mt.": [{"F": "Mt.", "L": "Mount"}], "Mt.": [{"F": "Mt.", "L": "Mount"}],
"''": [{"F": "''"}], "''": [{"F": "''"}],
"Corp.": [{"F": "Corp."}], "Corp.": [{"F": "Corp."}],
"Inc.": [{"F": "Inc."}], "Inc.": [{"F": "Inc."}],
"Co.": [{"F": "Co."}], "Co.": [{"F": "Co."}],
@ -412,6 +412,6 @@ def generate_specials():
if __name__ == "__main__": if __name__ == "__main__":
specials = generate_specials() specials = generate_specials()
with open("specials.json", "w") as f: with open("specials.json", "w") as file_:
json.dump(specials, f) file_.write(json.dumps(specials, indent=2))