[V10.346] 補強 PChome identity anchor scorer
This commit is contained in:
@@ -426,6 +426,28 @@ def test_marketplace_matcher_does_not_promote_different_option_without_spec():
|
||||
assert "strong_exact_spec_match" not in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_matcher_promotes_shared_identity_anchor_near_threshold():
|
||||
from services.marketplace_product_matcher import score_marketplace_match
|
||||
|
||||
obge = score_marketplace_match(
|
||||
"【OBgE】自然遮瑕素顏霜 50g",
|
||||
"OBgE/自然遮瑕素顏霜50g",
|
||||
momo_price=699,
|
||||
competitor_price=699,
|
||||
)
|
||||
unicat = score_marketplace_match(
|
||||
"【UNICAT 變臉貓】超持久細滑眼線筆1.5ml",
|
||||
"【UNICAT】超持久細滑眼線筆 1.5ml 新品搶先優惠",
|
||||
momo_price=399,
|
||||
competitor_price=399,
|
||||
)
|
||||
|
||||
for diagnostics in (obge, unicat):
|
||||
assert diagnostics.score >= 0.76
|
||||
assert diagnostics.hard_veto is False
|
||||
assert "shared_identity_anchor" in diagnostics.reasons
|
||||
|
||||
|
||||
def test_marketplace_search_terms_prefer_readable_brand_core_spec():
|
||||
from services.marketplace_product_matcher import build_search_terms
|
||||
|
||||
|
||||
Reference in New Issue
Block a user