def remove_unbound_punct(text_string):
    '''
    Removes all punctuation unattached from a non-whitespace or attached to another punctuation
    character unexpectedly (e.g. ".;';") within text_string and returns the new string as type str.

    Keyword argument:

    - text_string: string instance

    Exceptions raised:

    - InputError: occurs should a non-string argument be passed
    '''
    if text_string is None or text_string == "":
        return ""
    elif isinstance(text_string, str):
        return " ".join(re.sub(r''.join([r'[', PUNCT, r'][', PUNCT, r']+|\B[', PUNCT, r']+']), "",
                               text_string).split())
    else:
        raise InputError("string not passed as argument")
def remove_unbound_punct ( text_string ) : if text_string is None or text_string == "" : return "" elif isinstance ( text_string , str ) : return " " . join ( re . sub ( r'' . join ( [ r'[' , PUNCT , r'][' , PUNCT , r']+|\B[' , PUNCT , r']+' ] ) , "" , text_string ) . split ( ) ) else : raise InputError ( "string not passed as argument" )
Removes all punctuation unattached from a non-whitespace or attached to another punctuation
    character unexpectedly (e.g. ".;';") within text_string and returns the new string as type str.

    Keyword argument:

    - text_string: string instance

    Exceptions raised:

    - InputError: occurs should a non-string argument be passed