INNER CODE UNIT · Python
has_effective_taste
LiuMengxuan04/shushu-internship-tool · skills/shushu-internship-tool/scripts/shushu_internship_tool/candidate_score.py:222
def has_effective_taste(taste_text: str | None) -> bool:
prefer, avoid = parse_user_taste(taste_text)
return bool(prefer or avoid)
def _ordered_intersection(items: Iterable[str], wanted: set[str]) -> list[str]:
result: list[str] = []
for item in items:
if item in wanted and item not in result:
result.append(item)
return result
def taste_score(candidate: dict[str, Any], taste_text: str | None) -> tuple[int, list[str], list[str], list[str]]:
prefer_tags, user_avoid_tags = parse_user_taste(taste_text)
if not (prefer_tags or user_avoid_tags):
return 0, [], [], []