reynoldsnlp / udar

UDAR Does Accented Russian: A finite-state morphological analyzer of Russian that handles stressed wordforms.
GNU General Public License v3.0
26 stars 1 forks source link

cannot import name 'CASES' from 'udar.tag' #23

Closed hj940709 closed 5 years ago

hj940709 commented 5 years ago

When I try to import this package, I get an import error as follows:

>>> import udar
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jxhou/.local/lib/python3.7/site-packages/udar/__init__.py", line 9, in <module>
    from .convenience import *  # noqa: F401, F403
  File "/home/jxhou/.local/lib/python3.7/site-packages/udar/convenience.py", line 9, in <module>
    from .tag import CASES
ImportError: cannot import name 'CASES' from 'udar.tag' (/home/jxhou/.local/lib/python3.7/site-packages/udar/tag.py)
reynoldsnlp commented 5 years ago

Sorry about that. I just removed it in commit 77486bb842fee9b9811fe3ee58ab1d83b3719f8f yesterday because I thought that it would be more maintainable to not manually encode that information separately. My thought was that it would be cleaner to pull that kind of grouping directly from tag.tag_dict using the morphosyntactic feature. For example, to get a list of CASE tags, you could use [name for name, tag in tag_dict.items() if tag.ms_feat == 'CASE'].

I like the idea of still supplying such lists natively, so I'll add it back in. I'm glad you brought this up. Thanks!