GodsDevProject's picture
Update core/redaction.py
cdba8ff verified
raw
history blame contribute delete
201 Bytes
def redaction_density(text: str) -> float:
if not text:
return 0.0
blocks = text.count("β–ˆβ–ˆβ–ˆβ–ˆ") + text.count("[REDACTED]")
return round(blocks / max(len(text.split()), 1), 4)