From 6d194515e159e6e5330b7215d371721c6c88d563 Mon Sep 17 00:00:00 2001 From: stantheman0128 Date: Sat, 18 Jul 2026 04:29:37 +0800 Subject: [PATCH] =?UTF-8?q?s2t:=20protect=20=E5=89=8D=E5=A4=B4=E5=8F=91?= =?UTF-8?q?=E7=94=9F=20from=20=E5=A4=B4=E5=8F=91=20to=20=E9=A0=AD=E9=AB=AE?= =?UTF-8?q?=20MaxMatch=20(#586)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a longer STPhrases entry so 前头发生 becomes 前頭發生 instead of matching 头发 in the middle. Co-authored-by: Cursor --- data/dictionary/STPhrases.txt | 1 + test/testcases/testcases.json | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/data/dictionary/STPhrases.txt b/data/dictionary/STPhrases.txt index cb05687a0..2076d52a4 100644 --- a/data/dictionary/STPhrases.txt +++ b/data/dictionary/STPhrases.txt @@ -8675,6 +8675,7 @@ 前呼后拥 前呼後擁 前回 前回 前因后果 前因後果 +前头发生 前頭發生 前奏曲 前奏曲 前婚后嫁 前婚後嫁 前家后继 前家後繼 diff --git a/test/testcases/testcases.json b/test/testcases/testcases.json index 95a95e0b7..f779b3253 100755 --- a/test/testcases/testcases.json +++ b/test/testcases/testcases.json @@ -1825,6 +1825,36 @@ "tw2sp": "干红", "hk2sp": "干红" } + }, + { + "id": "BYVoid_OpenCC_Issue_586_qiantou_fasheng", + "input": "前头发生", + "expected": { + "s2t": "前頭發生", + "s2tw": "前頭發生", + "s2twp": "前頭發生", + "s2hk": "前頭發生" + } + }, + { + "id": "BYVoid_OpenCC_Issue_586_qiantoufa_control", + "input": "前头发 剪头发 头发", + "expected": { + "s2t": "前頭髮 剪頭髮 頭髮", + "s2tw": "前頭髮 剪頭髮 頭髮", + "s2twp": "前頭髮 剪頭髮 頭髮", + "s2hk": "前頭髮 剪頭髮 頭髮" + } + }, + { + "id": "BYVoid_OpenCC_Issue_586_fa_control", + "input": "喉头发干 不断发生", + "expected": { + "s2t": "喉頭發乾 不斷發生", + "s2tw": "喉頭發乾 不斷發生", + "s2twp": "喉頭發乾 不斷發生", + "s2hk": "喉頭發乾 不斷發生" + } } ] }