mirror of https://github.com/explosion/spaCy.git
* Make generate_specials pretty-print the specials.json file
This commit is contained in:
parent
1842a53e73
commit
1490feda29
|
@ -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))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue