File size: 5,079 Bytes
016cbbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
const categoryMap: Record<string, string> = {
  "t-shirt": "shirts",
  "shirt": "shirts",
  "polo shirt": "shirts",
  "blouse": "shirts",
  "tank top": "shirts",
  "crop top": "shirts",
  "tunic": "shirts",
  "jumper": "shirts",
  "sweater": "shirts",
  "pullover": "shirts",
  "cardigan": "shirts",
  "hoodie": "shirts",
  "sweatshirt": "shirts",
  "jersey": "shirts",
  "sports jersey": "shirts",
  "football jersey": "shirts",
  "basketball jersey": "shirts",
  "soccer jersey": "shirts",
  "dress": "dresses",
  "mini dress": "dresses",
  "sundress": "dresses",
  "cocktail dress": "dresses",
  "evening dress": "dresses",
  "maxi dress": "dresses",
  "romper": "dresses",
  "jumpsuit": "dresses",
  "overalls": "dresses",
  "pants": "pants",
  "trousers": "pants",
  "jeans": "pants",
  "chinos": "pants",
  "cargo pants": "pants",
  "sweatpants": "pants",
  "leggings": "pants",
  "tights": "pants",
  "yoga pants": "pants",
  "shorts": "shorts",
  "cargo shorts": "shorts",
  "bermuda shorts": "shorts",
  "athletic shorts": "shorts",
  "board shorts": "shorts",
  "swim trunks": "shorts",
  "skirt": "skirts",
  "mini skirt": "skirts",
  "a-line skirt": "skirts",
  "pencil skirt": "skirts",
  "maxi skirt": "skirts",
  "pleated skirt": "skirts",
  "shoes": "shoes",
  "sneakers": "shoes",
  "trainers": "shoes",
  "running shoes": "shoes",
  "athletic shoes": "shoes",
  "boots": "shoes",
  "ankle boots": "shoes",
  "knee boots": "shoes",
  "combat boots": "shoes",
  "hiking boots": "shoes",
  "rain boots": "shoes",
  "heels": "shoes",
  "high heels": "shoes",
  "stilettos": "shoes",
  "pumps": "shoes",
  "wedges": "shoes",
  "flats": "shoes",
  "ballet flats": "shoes",
  "loafers": "shoes",
  "oxfords": "shoes",
  "brogues": "shoes",
  "derby shoes": "shoes",
  "sandals": "shoes",
  "flip flops": "shoes",
  "slippers": "shoes",
  "house shoes": "shoes",
  "clogs": "shoes",
  "mules": "shoes",
  "slides": "shoes",
  "platform shoes": "shoes",
  "jacket": "jackets",
  "coat": "jackets",
  "blazer": "jackets",
  "suit jacket": "jackets",
  "sports jacket": "jackets",
  "leather jacket": "jackets",
  "denim jacket": "jackets",
  "bomber jacket": "jackets",
  "puffer jacket": "jackets",
  "down jacket": "jackets",
  "quilted jacket": "jackets",
  "trench coat": "jackets",
  "peacoat": "jackets",
  "parka": "jackets",
  "raincoat": "jackets",
  "winter coat": "jackets",
  "windbreaker": "jackets",
  "vest": "jackets",
  "waistcoat": "jackets",
  "gilet": "jackets",
  "watch": "watches",
  "wristwatch": "watches",
  "smartwatch": "watches",
  "pocket watch": "watches",
  "glasses": "glasses",
  "eyeglasses": "glasses",
  "reading glasses": "glasses",
  "sunglasses": "glasses",
  "aviator sunglasses": "glasses",
  "bag": "bags",
  "handbag": "bags",
  "purse": "bags",
  "clutch": "bags",
  "tote bag": "bags",
  "shoulder bag": "bags",
  "crossbody bag": "bags",
  "messenger bag": "bags",
  "backpack": "bags",
  "rucksack": "bags",
  "duffel bag": "bags",
  "travel bag": "bags",
  "laptop bag": "bags",
  "briefcase": "bags",
  "suitcase": "bags",
  "luggage": "bags",
  "jewelry": "jewelry",
  "necklace": "jewelry",
  "chain necklace": "jewelry",
  "choker": "jewelry",
  "pendant": "jewelry",
  "earrings": "jewelry",
  "stud earrings": "jewelry",
  "drop earrings": "jewelry",
  "hoop earrings": "jewelry",
  "bracelet": "jewelry",
  "cuff bracelet": "jewelry",
  "charm bracelet": "jewelry",
  "bangle": "jewelry",
  "ring": "jewelry",
  "signet ring": "jewelry",
  "engagement ring": "jewelry",
  "wedding ring": "jewelry",
  "hat": "hats",
  "cap": "hats",
  "baseball cap": "hats",
  "beanie": "hats",
  "bucket hat": "hats",
  "beret": "hats",
  "fedora": "hats",
  "wide brim hat": "hats",
  "sun hat": "hats",
  "visor": "hats",
  "headband": "hats",
  "turban": "hats",
  "belt": "belts",
  "leather belt": "belts",
  "chain belt": "belts",
  "waist belt": "belts",
  "scarf": "accessories",
  "neck scarf": "accessories",
  "head scarf": "scarf",
  "shawl": "accessories",
  "gloves": "accessories",
  "mittens": "accessories",
  "socks": "accessories",
  "ankle socks": "accessories",
  "knee socks": "accessories",
  "stockings": "accessories",
  "tie": "accessories",
  "neck tie": "accessories",
  "bow tie": "accessories",
  "bowtie": "accessories",
  "pin": "accessories",
  "brooch": "accessories",
  "umbrella": "accessories",
  "wallet": "accessories",
  "cardholder": "accessories",
  "coin purse": "accessories",
  "swimwear": "swimwear",
  "bikini": "swimwear",
  "swimsuit": "swimwear",
  "underwear": "underwear",
  "bra": "underwear",
  "briefs": "underwear",
  "boxers": "underwear",
  "panties": "underwear",
  "lingerie": "underwear",
};

export function normalizeCategory(itemLabel: string): string {
  const normalized = itemLabel.toLowerCase().trim();
  
  if (categoryMap[normalized]) {
    return categoryMap[normalized];
  }
  
  for (const [key, value] of Object.entries(categoryMap)) {
    if (normalized.includes(key) || key.includes(normalized)) {
      return value;
    }
  }
  
  return normalized;
}