jbesomi/texthero

`remove_punctuation()` is not removing "\"

batmanscode opened this issue ยท 2 comments

>>> import texthero as hero
>>> import pandas as pd
>>> import string
>>>
>>> s = pd.Series(rf"{string.punctuation}")
>>> hero.remove_punctuation(s)
0     \ 
dtype: object

Hi, I could act on this question. Do you have any suggestions or can I start working from scratch?

A solution that could even improve the performance of the method:

import string

s = "dakmdalk\@....dada"

exclude = set(string.punctuation)
table = str.maketrans('', '', string.punctuation)
a = s.translate(table)

print(a)
# "dakmdalkdada"

Hey, happy to receive your PR @richecr !