emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pyim 954fa71 2/2: * pyim-candidates.el (pyim-candidate


From: ELPA Syncer
Subject: [elpa] externals/pyim 954fa71 2/2: * pyim-candidates.el (pyim-candidates-create-quanpin): 优化 jianpin 处理速度。
Date: Mon, 6 Dec 2021 04:57:27 -0500 (EST)

branch: externals/pyim
commit 954fa71a150faadc475161c280eb2d5718e8cd33
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    * pyim-candidates.el (pyim-candidates-create-quanpin): 优化 jianpin 处理速度。
---
 pyim-candidates.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pyim-candidates.el b/pyim-candidates.el
index a4f33d2..1a0e82b 100644
--- a/pyim-candidates.el
+++ b/pyim-candidates.el
@@ -141,13 +141,15 @@ IMOBJS 获得候选词条。"
                                    "[^-]*-"))
                (w1 (cl-remove-if-not
                     (lambda (cstr)
-                      (string-match-p regexp1 (pyim-cstring-to-pinyin cstr nil 
"-")))
+                      (let ((py (pyim-cstring-to-pinyin cstr nil "-")))
+                        (or (string-match-p regexp1 py)
+                            (string-match-p regexp2 py))))
                     w))
                (w2 (cl-remove-if-not
                     (lambda (cstr)
-                      (string-match-p regexp2 (pyim-cstring-to-pinyin cstr nil 
"-")))
-                    w)))
-          (push (append w1 w2) jianpin-words))))
+                      (string-match-p regexp1 (pyim-cstring-to-pinyin cstr nil 
"-")))
+                    w1)))
+          (push (append w2 w1) jianpin-words))))
 
     ;; 获取个人词条,词库词条和第一汉字列表。
     (dolist (imobj imobjs)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]