import shadowtube.preprocess as prep
import shadowtube.recommend as rec

raw_history = prep.parse_database("./short.db")

# print(raw_history[0]["title"] + ": " + str(prep.relevancy(raw_history[0], raw_history)))
# print(
#    raw_history[28]["title"] + ": " + str(prep.relevancy(raw_history[28], raw_history))
# )

# for i in range(0, 10):
#    print(prep.get_similarity(raw_history[i], raw_history))

history = prep.sort_history(raw_history)
print(len(history))

# print(recommend(history))

recommendations = rec.recommend(history, verbose=False)

print(recommendations)