This commit is contained in:
@@ -16,12 +16,15 @@
|
||||
"name": "1.1 狂歡購物節爬蟲"
|
||||
},
|
||||
"mothers_day_2026": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"schedule_hours": 4,
|
||||
"lpn_code": "O7ylWdZJHj8",
|
||||
"activity_name": "母親節超值限時購",
|
||||
"page_type": "mothers_day",
|
||||
"name": "2026 母親節促銷爬蟲"
|
||||
"name": "2026 母親節促銷爬蟲",
|
||||
"status": "paused",
|
||||
"pause_reason": "活動頁已回傳「很抱歉此EDM不存在」,改為手動指定 LPN 或啟用 MOMO_ENABLE_SEASONAL_PROMO_SCHEDULE 後再排程",
|
||||
"paused_date": "2026-05-21"
|
||||
},
|
||||
"valentine_520_2026": {
|
||||
"enabled": false,
|
||||
|
||||
@@ -232,6 +232,20 @@ SEARCH_NOISE_PHRASES = (
|
||||
"多色任選",
|
||||
"多色可選",
|
||||
"多色",
|
||||
"德國妮維雅",
|
||||
"無印止汗滾珠",
|
||||
"眉彩刷",
|
||||
"眉餅盒分開販售",
|
||||
"極細筆芯",
|
||||
"防水抗暈",
|
||||
"兒童化妝品",
|
||||
"無毒防曬霜",
|
||||
"天然彩妝",
|
||||
"內贈芳香劑",
|
||||
"衛浴精油擴香瓶棒組",
|
||||
"衛浴精油擴香瓶",
|
||||
"三色選一",
|
||||
"贈複方",
|
||||
)
|
||||
|
||||
SEARCH_NOISE_TOKENS = {
|
||||
@@ -290,6 +304,15 @@ SEARCH_NOISE_TOKENS = {
|
||||
}
|
||||
|
||||
SEARCH_IDENTITY_ANCHORS = (
|
||||
"智能光感應無線自動除臭芳香噴霧機",
|
||||
"usb精油薰香機",
|
||||
"超音波水氧機",
|
||||
"類光繚指甲油",
|
||||
"多效提亮防曬霜",
|
||||
"速描眼線膠筆",
|
||||
"經典旋轉眉筆",
|
||||
"3d造型眉彩餅補充芯",
|
||||
"止汗爽身乳液",
|
||||
"持久植物香氛精油",
|
||||
"口袋雙色修容打亮盤",
|
||||
"經典乳霜",
|
||||
@@ -496,6 +519,7 @@ BRAND_ALIAS_OVERRIDES = {
|
||||
"za": ("za",),
|
||||
"xiaomi": ("小米有品", "小米", "xiaomi"),
|
||||
"mac": ("m.a.c", "mac", "m a c"),
|
||||
"opi": ("o.p.i", "opi", "o p i"),
|
||||
}
|
||||
|
||||
PRODUCT_TYPES = {
|
||||
@@ -1927,6 +1951,8 @@ def _extract_anchor_phrases(token: str) -> list[str]:
|
||||
return []
|
||||
|
||||
phrases: list[str] = []
|
||||
if "經典旋轉眉筆" in cleaned:
|
||||
phrases.append("經典旋轉眉筆")
|
||||
if "悠斯晶" in normalized and "經典乳霜" in normalized:
|
||||
phrases.append("悠斯晶經典乳霜")
|
||||
if "經典乳霜" in normalized:
|
||||
@@ -2206,6 +2232,8 @@ def build_search_terms(name: str, max_terms: int = 3) -> list[str]:
|
||||
return "romand"
|
||||
if {"im", "meme"} <= identity.brand_tokens:
|
||||
return "im meme"
|
||||
if {"recipe", "box"} <= identity.brand_tokens:
|
||||
return "recipe box"
|
||||
chinese = sorted(
|
||||
(token for token in identity.brand_tokens if re.search(r"[\u4e00-\u9fff]", token)),
|
||||
key=lambda token: (-len(token), token),
|
||||
@@ -2233,6 +2261,9 @@ def build_search_terms(name: str, max_terms: int = 3) -> list[str]:
|
||||
brand_part = primary_brand_phrase()
|
||||
spec_part = " ".join(_search_spec_terms(identity))
|
||||
core_phrases = _ranked_search_core_phrases(identity, limit=4)
|
||||
full_name_anchor_phrases = _extract_anchor_phrases(name)
|
||||
if full_name_anchor_phrases:
|
||||
core_phrases = list(dict.fromkeys(full_name_anchor_phrases + core_phrases))
|
||||
core_short = " ".join(core_phrases[:2])
|
||||
core_primary = core_phrases[0] if core_phrases else ""
|
||||
product_type_aliases = set(PRODUCT_TYPES.get(identity.product_type or "", ()))
|
||||
|
||||
Reference in New Issue
Block a user