演算法缺陷導致s2twp「正則表達式=>正規表示式」無作用
A pull request for this has already been merged.
- #1193 by @frankslin — merged
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- localization
Research direction
Start by tracing the s2twp conversion path and how STPhrases.ocd2 tokenizes text before applying TWPhrases* rules. Compare the handling of 「正则表达式」 with the intended 「正規表示式」 result. Done should mean the phrase-level rule works despite earlier tokenization, with relevant conversion behavior verified.
Written by the indexing model from the issue text.
Description
如題,雖然 TWPhrases* 有定義「正則表達式=>正規表示式」,但實際使用會把「正则表达式」轉成「正則表示式」。
我看不太懂C的程式碼,但就目前s2twp的配置檔看起來,程式似乎是先根據 STPhrases.ocd2 分詞,然後再對分詞後的片段做簡繁轉換和地區字詞轉換。由於 STPhrases 已經有「表达式=>表達式」一詞,原文會被切成「正则 表达式」,之後簡轉繁成為「正則 表達式」,由於已被切開,因此TWPhrases* 定義的「正則表達式=>正規表示式」無法匹配。
演算法可能需要改進,否則只有在STPhrases加入「正则表达式=>正則表達式」才能解決此問題。
- Dominant language
- C++
- Stars
- 10.1k
- Forks
- 1.1k
- Avg merge
- 47m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from BYVoid/OpenCC
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
术忽 → 朮忽 should be the s2t mapping (currently 術忽)Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
-
update TWPhrasesOther.txtMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
「100人参加了这次活动」转化错误May be free again A pull request for this issue was closed without being merged. Opentriaged
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
-
挽「发」 -> 挽「發」May be free again A pull request for this issue was closed without being merged. Opentriaged
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/DirectXShaderCompiler#9173 ·
Maintainers usually reply within 2 days
-
feature:config kind:docs os:windows toolchain:cmake triaged
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
arch-based bug niri
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
noctalia-dev/noctalia#5552 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 5 days