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

繁体中台湾变体的问题 opencc_config openCC 问题 #882

Closed
KyleBing opened this issue Sep 17, 2021 · 5 comments
Closed

繁体中台湾变体的问题 opencc_config openCC 问题 #882

KyleBing opened this issue Sep 17, 2021 · 5 comments

Comments

@KyleBing
Copy link

前言:

我已经阅读并大体了解了 OpenCC 的使用。
知道 s2tw.json 的配置是将简体转为繁体,再从繁体基础之上处理台湾独有的一些字词的对应。
基于这个文件: TWVariants.txt

问题:

有位五笔使用者的用户需要输简出繁的功能,配置方案也配置正确,schema.yaml 中配置是这样的

tradition:
#  opencc_config: s2t.json
#  opencc_config: t2s.json   # 繁 -> 简【默认】
#  opencc_config: t2tw.json  # 繁 -> 台湾
#  opencc_config: t2hk.json  # 繁 -> 香港
#  opencc_config: s2tw.json  # 簡 -> 臺灣標準
  opencc_config: s2twp.json  # 簡 -> 臺灣片語
  option_name: zh_trad

也能正常输出繁体,也能正常转换台湾独有的变体文字,比如

2021-09-17 14 08 58

有些文字能正常转换,比如上图的 。但 这个单字却不可以,词组是可以正常转换的。

2021-09-17 14 33 47

单字 却不行:
2021-09-17 14 32 18

找了半天不知道是哪出了问题,能否指个方向?或者你试一下可以吗?

s2twp.json

{
  "name": "Simplified Chinese to Traditional Chinese (Taiwan standard, with phrases)",
  "segmentation": {
    "type": "mmseg",
    "dict": {
      "type": "ocd",
      "file": "STPhrases.ocd"
    }
  },
  "conversion_chain": [
    {
      "dict": {
        "type": "group",
        "dicts": [
          {
            "type": "ocd",
            "file": "STPhrases.ocd"
          },
          {
            "type": "ocd",
            "file": "STCharacters.ocd"
          }
        ]
      }
    },
    {
      "dict": {
        "type": "ocd",
        "file": "TWPhrases.ocd"
      }
    },
    {
      "dict": {
        "type": "ocd",
        "file": "TWVariants.ocd"
      }
    }
  ]
}

参考问题:
簡繁配置說明關於 OpenCC :#420

@lotem
Copy link
Member

lotem commented Sep 17, 2021

「​吃」不是臺灣變體獨有的。不能據此判斷臺灣變體轉換是否正常工作。

@KyleBing
Copy link
Author

opencc 是能正常转换的,提供的 demo 页面中转换是正确的。只是不知道我是否设置正确。
2021-09-17 11 24 38

@lotem
Copy link
Member

lotem commented Sep 23, 2021

在輸入法裏能用這套配置才行……
輸入法轉換不走OpenCC的網站,是調用本地的opencc庫。

@KyleBing
Copy link
Author

I know.
我意思是,在线使用 OpenCC 台湾标准的模式下, 还是 ,说明转换没问题。
但在输入法中设置 s2twp.jsons2tw.json 时,单字 ,就变成了 ,无法正确转换,
而带床的词语却能正常转换成 ,比如 床垫

@lotem
Copy link
Member

lotem commented Sep 24, 2021

爲保證轉換結果相同,​要使用同樣版本的OpenCC字典文件。

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

2 participants