aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/app.py b/app.py
index 9992628..eb6d9c3 100644
--- a/app.py
+++ b/app.py
@@ -12,22 +12,10 @@ app = Flask(__name__)
with open("./data/beer_info_small.json") as beers_json:
beer = json.loads(beers_json.read())
-valid_names = set()
-# beer_ids = {}
-for long_id, val in beer.items():
- valid_names.add(val[0])
-
-print(valid_names)
with open('./data/name_list.json') as f:
name_list = json.load(f)
-orig_terms = list([x for x in name_list.keys() if x.split(' — ')[1] in valid_names])
-
-search_words = [''.join(f for f in x.lower() if f not in string.punctuation) for x in orig_terms]
-
-orig_term_map = dict(zip(search_words, orig_terms))
-
beers_for_random = [b for b in beer if beer[b][3] > 75]
@@ -37,6 +25,18 @@ with open('./data/brewery_names.json') as f:
# for id, name in brewery_names.items():
# brewery_ids[name] = id
+valid_names = set()
+# # beer_ids = {}
+for beer_id, vals in beer.items():
+ valid_names.add(brewery_names[beer_id.split('-')[0]] + ' — ' + vals[0])
+
+orig_terms = list([x for x in name_list.keys() if x in valid_names])
+
+search_words = [''.join(f for f in x.lower() if f not in string.punctuation) for x in orig_terms]
+
+orig_term_map = dict(zip(search_words, orig_terms))
+
+
ATTRS = ['Barnyardy',