hexenq / kuroshiro

Japanese language library for converting Japanese sentence to Hiragana, Katakana or Romaji with furigana and okurigana modes supported.
https://kuroshiro.org
MIT License
837 stars 94 forks source link

UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object at Function.from (native) #67

Open thuraucsy opened 5 years ago

thuraucsy commented 5 years ago

Cannot convert the following text to okurigana. But if I remove "・" from the sentence, the error disappear.

await kuroshiro.convert(' 次にあげる「ブラック・ユーモア」の例を見れば、自分で判断を下すことができるだろう。', {mode:'okurigana', to:'hiragana'});

I'm using

"kuroshiro": {
  "version": "1.1.2",
  "resolved": "https://registry.npmjs.org/kuroshiro/-/kuroshiro-1.1.2.tgz",
  "integrity": "sha512-kM8OjYancYcr6awdfZum02tKR+p6+MheW+DojRHg71QunMdLPaXqY8sMP/FLsInioEiGs1T13zNyxjOG65K0KQ==",
  "requires": {
    "babel-runtime": "^6.26.0"
  }
},
"kuroshiro-analyzer-kuromoji": {
  "version": "1.1.0",
  "resolved": "https://registry.npmjs.org/kuroshiro-analyzer-kuromoji/-/kuroshiro-analyzer-kuromoji-1.1.0.tgz",
  "integrity": "sha512-BSJFhpsQdPwfFLfjKxfLA9iL+/PC6LCR9vgwgb5Jc7jZwk9ilX8SAV6CwhAQZY611tiuhbB52ONYKDO8hgY1bA==",
  "requires": {
    "kuromoji": "^0.1.1"
  }
hexenq commented 4 years ago

Hello thuraucsy. I gave a try with you test sentence but nothing error happened and the result was right. What error message did you get?

thuraucsy commented 4 years ago

@hexenq I got the following error.

UnhandledPromiseRejectionWarning: TypeError: Cannot convert undefined or null to object at Function.from (native)

hexenq commented 4 years ago

@thuraucsy Still cannot reproduce the error. I think full error stacks or a runnable demo (such as jsbin) might be helpful.