mirror of
https://github.com/d0zingcat/rime_wanxiang.git
synced 2026-06-02 15:11:23 +00:00
fix: 当'作为分隔符又与it's重合,不在插入空格导致其分开
This commit is contained in:
@@ -153,6 +153,19 @@ local function restore_sentence_spacing(cand, split_pattern, check_pattern)
|
||||
end
|
||||
|
||||
local new_text = table.concat(parts, " ")
|
||||
local new_text = ""
|
||||
for i, part in ipairs(parts) do
|
||||
if i == 1 then
|
||||
new_text = part
|
||||
else
|
||||
local last_char = sub(new_text, -1)
|
||||
if last_char == "'" or last_char == "-" then
|
||||
new_text = new_text .. part
|
||||
else
|
||||
new_text = new_text .. " " .. part
|
||||
end
|
||||
end
|
||||
end
|
||||
new_text = gsub(new_text, "%s%s+", " ")
|
||||
|
||||
if new_text == "" then return cand end
|
||||
|
||||
Reference in New Issue
Block a user