Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'emoji' has no attribute 'UNICODE_EMOJI' #4

Open
bomin0624 opened this issue Jan 13, 2023 · 0 comments
Open

Comments

@bomin0624
Copy link

Problem Description

When I tried to use the sengiri, and tried to execute the code, The error came out.

Code

$ pip install sengiri
import sengiri
print(sengiri.tokenize('うーん🤔🤔🤔どうしよう'))

Error message:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In [31], line 1
----> 1 import sengiri
      2 print(sengiri.tokenize('うーん🤔🤔🤔どうしよう'))

File ~/anaconda3/lib/python3.9/site-packages/sengiri/__init__.py:2
      1 # -*- coding: utf-8 -*-
----> 2 from .sengiri import tokenize
      3 """sengiri
      4 
      5 This module provides the Japanese sentence-level tokenizer.
   (...)
     11     MIT License
     12 """
     14 VERSION = (0, 2, 1)

File ~/anaconda3/lib/python3.9/site-packages/sengiri/sengiri.py:6
      3 import emoji
      4 import MeCab
----> 6 EMOJIS = set(emoji.UNICODE_EMOJI.keys())
      7 DELIMITERS = set({'。', '.', '…', '・・・', '...', '!',
      8                   '!', '?', '?', '!?', '?!', '!?', '?!'})
      9 re_parenthesis = re.compile('([%s])([\((][^\))]{10,}[\))])' % ''.join(DELIMITERS))

AttributeError: module 'emoji' has no attribute 'UNICODE_EMOJI'

The error message was weird because when I looked at the sengiri.py line 6 the code had already updated to the EMOJI_DATA, not UNICODE_EMOJI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant