Repository navigation
s2twp:不再將「社區」一律轉為「社群」(#1313) - #1511
Merged
Merged
Conversation
In Taiwan 社區 keeps its everyday meaning of a residential or local community (社區大學, 社區發展協會, 社區醫院), so the generic 社區 -> 社群 rule over-converts. Put the identity first so s2twp keeps 社區, and keep the online-community phrases: 開源社區 -> 開源社群, 網絡社區 -> 網路社群, 在線社區 -> 線上社群. TWPhrasesRev gains the matching reverse entries, and the variants_tw_s2twp case now expects 社區.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修正 #1313 中「社區 / 社群」一項。
問題:
TWPhrases.txt的社區 社群 社區會把所有「社區」轉成「社群」,例如社区大学 → 社群大學、社区发展协会 → 社群發展協會、社区医院 → 社群醫院。在臺灣,「社區」仍是居住地區、地方共同體的通用詞,法規名稱即為《社區大學發展條例》;「社群」主要用於網路、開源等語境。修改:
社區 社區 社群,s2twp 預設保留「社區」,反向對照仍完整(DictionaryReverseMappingTest)。開源社區 → 開源社群、網絡社區 → 網路社群、在線社區 → 線上社群,並在TWPhrasesRev.txt補上對應反向條目。s2twp、tw2sp測試案例;既有案例variants_tw_s2twp的 s2twp 預期改為「社區」。依據:
已知影響:未列入詞組的網路語境用法(如「技术社区」「开发者社区」「社区版」)將保留「社區」。這類搭配無法窮舉,依「疑義從無」原則僅保留語意穩定的詞組。tw2sp 結果不變。
測試:本機以 CMake 建置並執行
ctest(21/21 通過,含跑testcases.json的CommandLineConvertTest):修改前新 s2twp 案例失敗,修改後通過。Bazel 專屬的詞典測試(排序/去重、正反向對照、分詞覆蓋等)以同一建置另行編譯執行,均通過;golden 測試與sort.py排序檢查亦通過。完整 Bazel 測試待 CI 確認。與 #1512 相互獨立,可分別審閱(兩者合併後測試亦通過)。
此變更使用 Claude Code 撰寫。