Rename variable s -> text.

This commit is contained in:
voussoir 2020-11-26 18:18:26 -08:00
parent adc4247efd
commit 2cb443cf6d

View file

@ -1,23 +1,23 @@
import re import re
import unicodedata import unicodedata
def collapse_whitespace(s): def collapse_whitespace(text):
''' '''
Replace all whitespace sequences with a single space and strip the ends. Replace all whitespace sequences with a single space and strip the ends.
''' '''
s = re.sub(r'\s+', ' ', s.strip()) text = re.sub(r'\s+', ' ', text.strip())
return s return text
def comma_space_split(s): def comma_space_split(text):
''' '''
Split the string by commas and spaces, discarding all extra Split the string by commas and spaces, discarding all extra
whitespace and blank parts. whitespace and blank parts.
'a b, c,,d' -> ['a', 'b', 'c', 'd'] 'a b, c,,d' -> ['a', 'b', 'c', 'd']
''' '''
if s is None: if text is None:
return s return text
return re.split(r'[ ,]+', s.strip()) return re.split(r'[ ,]+', text.strip())
def pascal_to_loudsnakes(text): def pascal_to_loudsnakes(text):
''' '''