]> git.xn--bdkaa.com Git - where-are-you.py.git/commitdiff
Wiki optimization wip
authorzharkovstas <zharkovstas@skbkontur.ru>
Sat, 18 May 2019 22:14:44 +0000 (03:14 +0500)
committerzharkovstas <zharkovstas@skbkontur.ru>
Sat, 18 May 2019 22:14:57 +0000 (03:14 +0500)
wiki_parser.py [new file with mode: 0644]

diff --git a/wiki_parser.py b/wiki_parser.py
new file mode 100644 (file)
index 0000000..020c3ee
--- /dev/null
@@ -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))