MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / clean_profile_topic_text

Function clean_profile_topic_text

agents/master-coordinator/main.py:1340–1346  ·  view source on GitHub ↗

Trim topic text extracted from profile-update messages.

(topic: str, *, strip_domain_suffix: bool = False)

Source from the content-addressed store, hash-verified

1338
1339
1340def clean_profile_topic_text(topic: str, *, strip_domain_suffix: bool = False) -> str:
1341 """Trim topic text extracted from profile-update messages."""
1342 cleaned = re.sub(r"\s+", " ", (topic or "").strip().strip("“”\"'`"))
1343 cleaned = cleaned.strip(",。!?,.!?;;::()()[]【】")
1344 if strip_domain_suffix:
1345 cleaned = re.sub(r"\s*(?:方向|领域|主题)$", "", cleaned, flags=re.IGNORECASE).strip()
1346 return cleaned
1347
1348
1349def parse_weight_target(value: Any) -> Optional[float]:

Calls

no outgoing calls

Tested by

no test coverage detected