From 071d5ca80379d0a44ee88e682e4b1043ef9891e9 Mon Sep 17 00:00:00 2001 From: stantheman0128 Date: Sat, 18 Jul 2026 03:44:04 +0800 Subject: [PATCH] =?UTF-8?q?s2t:=20protect=20=E6=98=AF=E5=8F=AA=E6=9C=89=20?= =?UTF-8?q?and=20related=20=E6=98=AF=E5=8F=AA*=20function=20words=20from?= =?UTF-8?q?=20=E6=98=AF=E5=8F=AA=20to=20=E6=98=AF=E9=9A=BB=20(#1304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keep the measure-word mapping 是只 -> 是隻, and add longer STPhrases entries so MaxMatch prefers 是只有 / 是只要 / 是只能 / 是只好 / 是只得 / 是只怕 over the two-character measure-word entry. Co-authored-by: Cursor --- data/dictionary/STPhrases.txt | 6 ++++++ test/testcases/testcases.json | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/data/dictionary/STPhrases.txt b/data/dictionary/STPhrases.txt index cb05687a0..b23ca2a0c 100644 --- a/data/dictionary/STPhrases.txt +++ b/data/dictionary/STPhrases.txt @@ -28052,6 +28052,12 @@ 昭苏县 昭蘇縣 是个 是個 是只 是隻 +是只好 是只好 +是只得 是只得 +是只怕 是只怕 +是只有 是只有 +是只能 是只能 +是只要 是只要 是念 是念 是罐子也有两个耳朵 是罐子也有兩個耳朵 是非只为多开口 是非只爲多開口 diff --git a/test/testcases/testcases.json b/test/testcases/testcases.json index 95a95e0b7..2d19b7a75 100755 --- a/test/testcases/testcases.json +++ b/test/testcases/testcases.json @@ -1825,6 +1825,36 @@ "tw2sp": "干红", "hk2sp": "干红" } + }, + { + "id": "BYVoid_OpenCC_Issue_1304_shi_zhiyou", + "input": "这是只有一种可能", + "expected": { + "s2t": "這是只有一種可能", + "s2tw": "這是只有一種可能", + "s2twp": "這是只有一種可能", + "s2hk": "這是只有一種可能" + } + }, + { + "id": "BYVoid_OpenCC_Issue_1304_shi_zhi_measure", + "input": "是只猫 是一只鸟", + "expected": { + "s2t": "是隻貓 是一隻鳥", + "s2tw": "是隻貓 是一隻鳥", + "s2twp": "是隻貓 是一隻鳥", + "s2hk": "是隻貓 是一隻鳥" + } + }, + { + "id": "BYVoid_OpenCC_Issue_1304_shi_zhi_siblings", + "input": "是只要 是只能 是只好 是只得 是只怕", + "expected": { + "s2t": "是只要 是只能 是只好 是只得 是只怕", + "s2tw": "是只要 是只能 是只好 是只得 是只怕", + "s2twp": "是只要 是只能 是只好 是只得 是只怕", + "s2hk": "是只要 是只能 是只好 是只得 是只怕" + } } ] }