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

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

[elpa] externals/pyim 339bf50 2/3: 拼音连续联想时,提供尽可能多的联想组合。


From: ELPA Syncer
Subject: [elpa] externals/pyim 339bf50 2/3: 拼音连续联想时,提供尽可能多的联想组合。
Date: Sun, 5 Dec 2021 09:57:28 -0500 (EST)

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

    拼音连续联想时,提供尽可能多的联想组合。
    
        * pyim-common.el (pyim-subconcat): (a b c d) => (a-b-c-d a-b-c a-b).
    
        * pyim-candidates.el (pyim-candidates-create:quanpin): 提供尽可能多的联想组合。
---
 pyim-candidates.el | 3 ++-
 pyim-common.el     | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/pyim-candidates.el b/pyim-candidates.el
index b028ae2..edc7f02 100644
--- a/pyim-candidates.el
+++ b/pyim-candidates.el
@@ -106,7 +106,8 @@ IMOBJS 获得候选词条。"
         (let ((candidates (pyim-candidates-create-quanpin imobjs scheme-name)))
           (push (car (pyim-candidates-create-quanpin imobjs scheme-name t)) 
output)
           (setq n (length (car candidates)))))
-      (cons (mapconcat #'identity (nreverse output) "") candidates))))
+      (append (pyim-subconcat (nreverse output) "")
+              candidates))))
 
 (defun pyim-candidates-create-quanpin (imobjs scheme-name &optional 
fast-search)
   "`pyim-candidates-create:quanpin' 内部使用的函数。"
diff --git a/pyim-common.el b/pyim-common.el
index 63b9f4c..9938f76 100644
--- a/pyim-common.el
+++ b/pyim-common.el
@@ -107,12 +107,12 @@ When CARE-FIRST-ONE is no-nil, ((a b c) (d e)) => (a d)."
                #'list lists))))))
 
 (defun pyim-subconcat (list &optional sep)
-  "Concat sublist of LIST with SEP: (a b c d) => (a-b-c a-b)."
-  (let ((n (- (length list) 1))
+  "Concat sublist of LIST with SEP: (a b c d) => (a-b-c-d a-b-c a-b)."
+  (let ((n (length list))
         output)
     (dotimes (i (- n 1))
       (let ((list (cl-subseq list 0 (- n i))))
-        (push (mapconcat #'identity list (or sep "-")) output)))
+        (push (mapconcat #'identity list (or sep "")) output)))
     (nreverse output)))
 
 (defun pyim-char-before-to-string (num)



reply via email to

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