From fdd5fbce0e5b0b5b436d8f7115b4bb1cfb372af3 Mon Sep 17 00:00:00 2001 From: Dvel Date: Tue, 28 Nov 2023 17:44:57 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20reduce=5Fenglish=5Ffilter.lua=20?= =?UTF-8?q?=E5=8F=AA=E8=A6=81=20cand.text=20=E5=8C=85=E5=90=AB=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E5=B0=B1=E5=A4=84=E7=90=86=20close=20#558?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/reduce_english_filter.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/reduce_english_filter.lua b/lua/reduce_english_filter.lua index d945807..22e2651 100644 --- a/lua/reduce_english_filter.lua +++ b/lua/reduce_english_filter.lua @@ -42,7 +42,10 @@ function M.init(env) "tan", "tang", "tank", "tap", "tar", "tax", "tec", "ted", "tel", "ten", "ter", "tex", "tic", "tied", "tier", "ties", "tim", "tin", "tip", "tit", "tour", "tout", "tum", "wag", "wait", "wail", "wan", "wand", "womens", "want", "wap", "war", "was", "wax", "way", "weir", "went", "won", "wow", "yan", "yang", "yen", "yep", "yes", - "yet", "yin", "your", "yum", "zen", "zip" } + "yet", "yin", "your", "yum", "zen", "zip", + -- 下面是大于 4 位的 + "quanx", + } M.all = {} for _, v in ipairs(all) do M.all[v] = true @@ -76,7 +79,7 @@ function M.func(input, env) for cand in input:iter() do index = index + 1 -- 找到要降低的英文词,加入 pending_cands - if cand.preedit:find(" ") or not cand.text:match("^[%a' ]+$") then + if cand.preedit:find(" ") or not cand.text:match("[a-zA-Z]") then yield(cand) else table.insert(pending_cands, cand)