mirror of
https://github.com/task-17-lct/backend.git
synced 2024-11-24 08:33:44 +03:00
34 lines
983 B
Python
34 lines
983 B
Python
import pickle
|
|
|
|
attraction_mapping = None
|
|
cinema_mapping = None
|
|
plays_mapping = None
|
|
excursion_mapping = None
|
|
concert_mapping = None
|
|
|
|
|
|
def build_dict(list_mapping):
|
|
mapping = {}
|
|
for idx, elem in enumerate(list_mapping):
|
|
mapping.update({elem: idx})
|
|
return mapping
|
|
|
|
|
|
with open('passfinder/recomendations/service/mapping/attractions.pickle', 'rb') as file:
|
|
attraction_mapping = build_dict(pickle.load(file))
|
|
|
|
|
|
with open('passfinder/recomendations/service/mapping/kino.pickle', 'rb') as file:
|
|
cinema_mapping = build_dict(pickle.load(file))
|
|
|
|
|
|
with open('passfinder/recomendations/service/mapping/spektakli.pickle', 'rb') as file:
|
|
plays_mapping = build_dict(pickle.load(file))
|
|
|
|
|
|
with open('passfinder/recomendations/service/mapping/excursii.pickle', 'rb') as file:
|
|
excursion_mapping = build_dict(pickle.load(file))
|
|
|
|
|
|
with open('passfinder/recomendations/service/mapping/concerts.pickle', 'rb') as file:
|
|
concert_mapping = build_dict(pickle.load(file)) |