You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.
_save_censored_word will fail` method will throw an exception
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/code/ratings_parser/utils/censorship/profanity_filter.py", line 15, in censor
return pf.censor(text)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 201, in censor
return self._censor(text=text, return_bool=False)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 796, in _censor
doc = self._parse(language=language, text=text_part)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 523, in _parse
return spacy_utlis.parse(nlp=nlp, text=text, language=language, use_profanity_filter=use_profanity_filter)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/spacy_utlis.py", line 19, in parse
return nlp(text, disable=disable, component_cfg=component_cfg)
File "/usr/local/lib/python3.8/site-packages/spacy/language.py", line 439, in __call__
doc = proc(doc, **component_cfg.get(name, {}))
File "/usr/local/lib/python3.8/site-packages/profanity_filter/spacy_component.py", line 37, in __call__
span = self._censor_spaceless_span(doc[i:j], language=language)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/spacy_component.py", line 78, in _censor_spaceless_span
censored_word = self._profanity_filter.censor_word(word=token, language=language)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 206, in censor_word
return self._censor_word(language=language, word=word)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 710, in _censor_word
censored_censored_part, no_profanity_inside = self._censor_word_part(language=language,
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 659, in _censor_word_part
self._save_censored_word(censored_word)
File "/usr/local/lib/python3.8/site-packages/profanity_filter/profanity_filter.py", line 630, in _save_censored_word
d = asdict(word)
File "/usr/local/lib/python3.8/dataclasses.py", line 1072, in asdict
raise TypeError("asdict() should be called on dataclass instances")
TypeError: asdict() should be called on dataclass instances
The text was updated successfully, but these errors were encountered:
Expected behavior
Profane word is saved in redis.
Real behavior
Exception is thrown.
How to reproduce
_save_censored_word
will fail` method will throw an exceptionThe text was updated successfully, but these errors were encountered: