unique_char

unique_char(sentence)

Retrieve punctuations from sentence. If you want to change match repetitive characters to n numbers, chage the return line in the rep function to grp[0:n].

Parameters

sentence: str Text selected to apply transformation

Examples:

sentence="heyyy this is loong textttt sooon"
unique_char(rep,sentence)
    >>> 'hey this is long text son'