pattern icon indicating copy to clipboard operation
pattern copied to clipboard

[BUG] AttributeError: 'unicode' object has no attribute 'synonyms'

Open nhat2008 opened this issue 7 years ago • 1 comments

When i use

from pattern.text.en import sentiment sentiment('c-53')

the error: AttributeError: 'unicode' object has no attribute 'synonyms' shows up.

nhat2008 avatar Jul 05 '18 09:07 nhat2008

well, I'm getting this error: AttributeError: 'str' object has no attribute 'synonyms'. I'm getting this when I try to do these things:

>>> from pattern.text.en import sentiment >>> sentiment("a-00193480")

and

>>> from pattern.text.en import Sentiment >>> a = Sentiment() >>> a("a-00193480")

When the input string is of the form r"^[acdnrv][-_][0-9]+$", then this error occurs on line 2441 in text/__init__.py. The string that was passed will not have synonyms, id, or pos attributes. This is causing the error. I'm not sure where these attributes came from or what this line is intended to do. Knowing this will help us solve this issue. @markus-beuckelmann @tom-de-smedt .

nvinayvarma189 avatar Jan 07 '19 18:01 nvinayvarma189