File size: 1,166 Bytes
f8c0ae2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# main.py

from basic_search import search_products
from combi_system import combi_system
from category_based import cat_recc
from unique_product_mapping import product_to_category, goal_format
from load_data import items


def main():
    # Prompt user for input
    selected_item = input("Enter the name of the product: ").strip().lower()

    # Check if the product exists in the database
    if selected_item not in product_to_category:
        print(f"Product '{selected_item}' not found in the database.")
        return

    # Basic Search Results
    print("\nBasic Search Results:")
    search_results = search_products(selected_item, items)
    if search_results:
        print("Found the following matching items:")
        for result in search_results:
            print(f"- {result}")
    else:
        print("No matching items found.")

    print("\n" + "-"*50 + "\n")

    # Combined Recommendations
    print("Items Bought With It:")
    combi_system(selected_item)

    print("\n" + "-"*50 + "\n")

    # Category-Based Recommendations
    print("Category-Based Recommendations:")
    cat_recc(selected_item)


if __name__ == "__main__":
    main()