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

一简多繁,多次转同一内容,结果却不一样(还因浏览器而不同) #16

Open
garywill opened this issue Jun 13, 2021 · 0 comments

Comments

@garywill
Copy link

garywill commented Jun 13, 2021

“张三丰”转换为繁体,正确应为“張三丰”。
下面这段代码,连续转换一样的内容多次,每次不一样,交错有一次结果为“張三豐”

不被打斷 白雲 人云 豐收 張三丰 皇后 後面 
不被打斷 白雲 人云 豐收 張三豐 皇后 後面
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8"/>
  </head>
  <body>
    <script src="opencc-asm.js"></script>
    <script>
    for (var i=0; i<10; i++)
    {
      const { DictSource, Converter } = OpenCCWasm_
      OpenCCWasm_.ready().then(() => {
        // 获取s2t.json字典数据
        const dictSource = new DictSource('s2t.json');
        return dictSource.get();
      }).then((args) => {
        const converter = new Converter(...args)
        console.log(converter.convert('不被打断 白云 人云 丰收 张三丰 皇后 后面'))
        // 注意当不再需要使用converter时,请调用delete方法以释放内存
        converter.delete()
      })
    }
    </script>
  </body>
</html> 

以上是Firefox 78中的结果,Chromium 90 中,大部分得到 “張三豐”


随便问下,我正在做的一个浏览器扩展(链接),想用上这个库,怎样能通过Firefox审核呢(目前上架的还没加入opencc)?好像asm的代码都要提交一些源码资料

@garywill garywill changed the title 一简多繁,多次转同一内容,结果却不一样 一简多繁,多次转同一内容,结果却不一样(还因浏览器而不同) Jun 13, 2021
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