(text, match=None)
return text
Clean text, remove forbidden characters.
Clean text, remove forbidden characters.
Clean text remove forbidden characters .
def _clean_text(text, match=None):
    ''' Clean text, remove forbidden characters.
    '''
    # all non alpha numeric characters, except for _ and :
    # replace them with space
    # the + condenses a group of consecutive characters all into one space
    # (rather than assigning a space to each)
    if match is None:
        match = '[^a-zA-Z0-9_:]+'
    text = re.sub(match, ' ', text)
    # now replace the colon with semicolon
    text = re.sub(":", ";", text)
    return text
def _clean_text ( text , match = None ) : # all non alpha numeric characters, except for _ and : # replace them with space # the + condenses a group of consecutive characters all into one space # (rather than assigning a space to each) if match is None : match = '[^a-zA-Z0-9_:]+' text = re . sub ( match , ' ' , text ) # now replace the colon with semicolon text = re . sub ( ":" , ";" , text ) return text