From 67709ee7cf6fd463cd1a6e27e89833b265af0410 Mon Sep 17 00:00:00 2001 From: Mirtle Date: Wed, 14 Jun 2023 19:03:46 +0800 Subject: [PATCH] =?UTF-8?q?lua:=20=E4=BF=AE=E6=94=B9=20reduce=5Fenglish=5F?= =?UTF-8?q?filter=20=E8=8B=B1=E6=96=87=E8=AF=8D=E5=8C=B9=E9=85=8D=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=EF=BC=9B=20fix=20#349=20(#350)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/reduce_english_filter.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/reduce_english_filter.lua b/lua/reduce_english_filter.lua index c049ab1..54db469 100644 --- a/lua/reduce_english_filter.lua +++ b/lua/reduce_english_filter.lua @@ -22,7 +22,8 @@ local function reduce_english_filter(input, env) local index = 0 for cand in input:iter() do index = index + 1 - if string.lower(cand.text) == code then + -- 定位匹配的英文词 + if not string.find(cand.preedit, " ") then table.insert(pending_cands, cand) else yield(cand)