hyunwoongko / kss

KSS: Korean String processing Suite
BSD 3-Clause "New" or "Revised" License
421 stars 61 forks source link

EMOJI KeyError #51

Closed minqukanq closed 2 years ago

minqukanq commented 2 years ago

backend="pynori" 이용 시, EMOJI KeyError 발생

Code:

import kss

text = "사랑해♥"
sentences = kss.split_sentences(text, backend="pynori")
print(sentences)

Output:

>>> sentences = kss.split_sentences(text, backend="pynori")
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\kss.py", line 180, in split_sentences
    results += [
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\kss.py", line 181, in <listcomp>
    _split_sentences(
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\kss.py", line 292, in _split_sentences
    eojeols = _morph.pos(text=text, backend=backend)
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\morph.py", line 65, in pos
    _pos = self.pynori.do_analysis(
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\pynori\korean_analyzer.py", line 63, in do_analysis
    while self.kor_tokenizer.increment_token():
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\pynori\korean_tokenizer.py", line 356, in increment_token
    self.parse()
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\pynori\korean_tokenizer.py", line 472, in parse
    if self.character_definition.isGroup(firstCharacter) is False:
  File "C:\Users\mingu\anaconda3\envs\nlp\lib\site-packages\kss\pynori\dict\character_definition.py", line 44794, in isGroup
    return groupMap[character_category_map(ch)]
KeyError: 'EMOJI'

Process finished with exit code 1
hyunwoongko commented 2 years ago

3.7.0에서 해결되었습니다.