Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Get exception on particular input #11

Closed
nataliGitHub opened this issue Mar 22, 2019 · 2 comments
Closed

Get exception on particular input #11

nataliGitHub opened this issue Mar 22, 2019 · 2 comments
Labels
bug Something isn't working

Comments

@nataliGitHub
Copy link

nataliGitHub commented Mar 22, 2019

For these inputs "deathfrom", "eskimobob", ""piazza@gma" with pf.censor_whole_words=False, pf.censor_word throws below exception.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/nsmoli/venv/profanity/profanity-filter/profanity_filter/profanity_filter.py", line 246, in censor_word
    word=censored_part)
  File "/Users/nsmoli/venv/profanity/profanity-filter/profanity_filter/profanity_filter.py", line 746, in _censor_word
    censored = self._censor_word_by_part(word=word, profane_word=bad_word)
  File "/Users/nsmoli/venv/profanity/profanity-filter/profanity_filter/profanity_filter.py", line 603, in _censor_word_by_part
    flags=regex.IGNORECASE)
  File "/Users/nsmoli/venv/profanity/profanity-filter/lib/python3.7/site-packages/regex/regex.py", line 275, in sub
    return _compile(pattern, flags, kwargs).sub(repl, string, count, pos,
  File "/Users/nsmoli/venv/profanity/profanity-filter/lib/python3.7/site-packages/regex/regex.py", line 515, in _compile
    caught_exception.pos)
regex._regex_core.error: multiple repeat at position 4 (or 5)
@rominf rominf added the bug Something isn't working label Mar 23, 2019
@rominf
Copy link
Owner

rominf commented Mar 23, 2019

Nice catch! I'll investigate it.

PS: I've edited formatting in your question. In the future please use GitHub flavored markdown.

@rominf rominf closed this as completed in ac285cb Mar 23, 2019
@rominf
Copy link
Owner

rominf commented Mar 23, 2019

Fixed this exception. Please, use the latest version from PyPI.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants