Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
pudo committed Jan 25, 2024
1 parent 37a2b56 commit b1992a8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion fingerprints/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,18 @@ def clean_brackets(text: str) -> str:

@lru_cache(maxsize=2000)
def clean_name_ascii(text: Optional[str]) -> Optional[str]:
"""Super-hardcore string scrubbing."""
"""
This function performs a series of operations to clean and normalize the input text.
It transliterates the text to ASCII, removes punctuation and symbols, converts the
text to lowercase, replaces certain character categories, and collapses consecutive
spaces.
Args:
text (Optional[str]): The input text to be cleaned.
Returns:
Optional[str]: The cleaned text, or None if the cleaned text is empty or too short.
"""
# transliterate to ascii
text = ascii_text(text)
if text is None:
Expand Down

0 comments on commit b1992a8

Please sign in to comment.