Brooooooklyn / pinyin

rust-pinyin binding for Node.js
https://napi.rs/docs/ecosystem/@napi-rs/pinyin
MIT License
146 stars 9 forks source link

似乎发生了一些非预期的行为 #244

Open Vinlic opened 1 year ago

Vinlic commented 1 year ago

const words = await asyncPinyin("中心", { segment: true }); console.log(words); // [ 'zhong', 'zhong', 'xin', 'xin' ]

我会获得以上结果,平台是arm64,当前模块版本是1.7.3。

AielloChan commented 8 months ago

Same in v1.7.3

xioxin commented 5 months ago

1.7.5 问题仍然存在

Welcome to Node.js v14.18.1.
Type ".help" for more information.
> const { asyncPinyin, pinyin } = require("@napi-rs/pinyin");
undefined
> pinyin('年龄', { segment: true})
[ 'nian', 'ling' ]
> asyncPinyin('年龄', { segment: true}).then(v => console.log(v))
Promise {
  <pending>,
  [Symbol(async_id_symbol)]: 539,
  [Symbol(trigger_async_id_symbol)]: 537,
  [Symbol(destroyed)]: { destroyed: false }
}
> [ 'nian', 'nian', 'ling', 'ling' ]