davidmogar / cucco

Text normalization library for Python
MIT License
203 stars 27 forks source link

Normalizer unpacking not working on Python 2 #19

Closed davidmogar closed 7 years ago

davidmogar commented 7 years ago

As pointed in #17, at some point a bug was added:

Python 2.7.12 (default, Jul  1 2016, 15:12:24)                                                                              [33/147]
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from normalizr import Normalizr
>>> normalizr = Normalizr(language='en')
>>> print(normalizr.normalize(u'Who let the dog out?'))                                                                             
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "normalizr/normalizr.py", line 85, in normalize
    for normalization, kwargs in self._parse_normalizations(normalizations or DEFAULT_NORMALIZATIONS):
ValueError: too many values to unpack

This seems to be related with string types (str and unicode).