This commit is contained in:
@@ -1976,7 +1976,13 @@ def score_marketplace_match(
|
||||
nitori_diffuser_model_conflict = _has_nitori_diffuser_model_conflict(left, right)
|
||||
if nitori_diffuser_model_conflict:
|
||||
reasons.append("nitori_diffuser_model_conflict")
|
||||
variant_selection_review = _has_named_variant_selection_review(left, right, shared_anchor)
|
||||
commercial_condition_gap = _has_commercial_condition_gap(left, right)
|
||||
if commercial_condition_gap:
|
||||
reasons.append("commercial_condition_gap")
|
||||
variant_selection_review = (
|
||||
_has_named_variant_selection_review(left, right, shared_anchor)
|
||||
or commercial_condition_gap
|
||||
)
|
||||
if variant_selection_review:
|
||||
reasons.append("variant_selection_review")
|
||||
|
||||
@@ -3070,6 +3076,24 @@ def _has_makeup_shade_selection_gap(left: ProductIdentity, right: ProductIdentit
|
||||
return bool(left_shades) != bool(right_shades)
|
||||
|
||||
|
||||
def _commercial_condition_terms(identity: ProductIdentity) -> set[str]:
|
||||
text = identity.normalized_name
|
||||
terms: set[str] = set()
|
||||
if any(term in text for term in ("即期品", "臨期", "短效", "短效期", "效期", "保存期限", "有效期限")):
|
||||
terms.add("expiry_sensitive")
|
||||
if any(term in text for term in ("盒損", "盒損品", "外盒損", "外盒瑕疵")):
|
||||
terms.add("box_damage")
|
||||
if any(term in text for term in ("福利品", "瑕疵品")):
|
||||
terms.add("clearance_condition")
|
||||
return terms
|
||||
|
||||
|
||||
def _has_commercial_condition_gap(left: ProductIdentity, right: ProductIdentity) -> bool:
|
||||
left_terms = _commercial_condition_terms(left)
|
||||
right_terms = _commercial_condition_terms(right)
|
||||
return bool(left_terms or right_terms) and left_terms != right_terms
|
||||
|
||||
|
||||
def _has_taicend_baby_spray_equivalence(left: ProductIdentity, right: ProductIdentity) -> bool:
|
||||
brand_tokens = {"taicend", "泰陞"}
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user