Giter VIP home page Giter VIP logo

sengiri's Issues

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

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.

Can't tokenize

Hi there! I can't tokenize the sentence, and raised error "ValueError: too many values to unpack (expected 2)"
Im just try this code :

print(sengiri.tokenize('遅刻したけど楽しかったし嬉しかった。すごく充実した!'))

and surface this error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.