From 6e401d3b1f61232a231dc7819f7d7c252ce53e4d Mon Sep 17 00:00:00 2001 From: zharkovstas Date: Sun, 19 May 2019 03:14:44 +0500 Subject: [PATCH] Wiki optimization wip --- wiki_parser.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 wiki_parser.py diff --git a/wiki_parser.py b/wiki_parser.py new file mode 100644 index 0000000..020c3ee --- /dev/null +++ b/wiki_parser.py @@ -0,0 +1,15 @@ +import json +from street_predictor import parse_summary + +result = {} + +with open('c:\docs\streets.txt', 'r', encoding='utf-8') as f: + for l in f: + street = l.strip() + print(street) + success, summary = parse_summary(street) + if success: + result[street] = summary + +with open('c:\docs\streets-with-descriptions.txt', 'w+', encoding='utf-8') as f: + f.write(json.dumps(result, indent=4, ensure_ascii=False)) -- 2.50.1