Update menu.py
Browse files
menu.py
CHANGED
@@ -141,11 +141,15 @@ def menu():
|
|
141 |
|
142 |
# Clean the add-on names by removing any price information
|
143 |
cleaned_addons = [re.sub(r"\s?\(\$\d+(\.\d{2})?\)", "", addon) for addon in addons]
|
144 |
-
|
145 |
-
# Count occurrences for add-ons and instructions
|
146 |
for addon in cleaned_addons:
|
147 |
-
|
148 |
-
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
for instruction in instructions:
|
151 |
if instruction:
|
|
|
141 |
|
142 |
# Clean the add-on names by removing any price information
|
143 |
cleaned_addons = [re.sub(r"\s?\(\$\d+(\.\d{2})?\)", "", addon) for addon in addons]
|
144 |
+
# Split add-ons by semicolon and process separately
|
|
|
145 |
for addon in cleaned_addons:
|
146 |
+
# If the add-on contains a semicolon, split it into multiple add-ons
|
147 |
+
individual_addons = addon.split(';') # Split add-ons separated by semicolons
|
148 |
+
for individual_addon in individual_addons:
|
149 |
+
individual_addon = individual_addon.strip() # Remove extra spaces
|
150 |
+
if individual_addon:
|
151 |
+
addon_counts[individual_addon] = addon_counts.get(individual_addon, 0) + 1
|
152 |
+
|
153 |
|
154 |
for instruction in instructions:
|
155 |
if instruction:
|