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

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

[elpa] externals/pyim b3677eb 3/3: Remove pyim-permutate-list2


From: ELPA Syncer
Subject: [elpa] externals/pyim b3677eb 3/3: Remove pyim-permutate-list2
Date: Sun, 21 Nov 2021 09:57:24 -0500 (EST)

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

    Remove pyim-permutate-list2
---
 pyim-common.el  | 24 +-----------------------
 pyim-cstring.el |  2 +-
 2 files changed, 2 insertions(+), 24 deletions(-)

diff --git a/pyim-common.el b/pyim-common.el
index fb3c692..92f1d94 100644
--- a/pyim-common.el
+++ b/pyim-common.el
@@ -75,8 +75,7 @@
 
 (defun pyim-permutate-list (list)
   "使用排列组合的方式重新排列 LIST.
-这个函数由 ‘二中’ 提供,`pyim-cstring-to-pinyin' 没有使用这个函数
-(速度稍微有点慢)。"
+这个函数由 ‘二中’ 提供。"
   (let ((list-head (car list))
         (list-tail (cdr list)))
     (cond ((null list-tail)
@@ -86,27 +85,6 @@
                       append (mapcar (lambda (l) (cons element l))
                                      (pyim-permutate-list list-tail)))))))
 
-(defun pyim-permutate-list2 (list)
-  "使用排列组合的方式重新排列 LIST.
-这个函数由 ’翀/ty‘ 提供,`pyim-cstring-to-pinyin' 默认使用这个函数。"
-  (if (= (length list) 1)
-      (mapcar #'list (car list))
-    (pyim-permutate-list2-internal (car list) (cdr list))))
-
-(defun pyim-permutate-list2-internal (one two)
-  "`pyim-permutate-list2' 的内部函数。"
-  (let (return)
-    (if (null (car two))
-        one
-      (dolist (x1 one)
-        (dolist (x2 (car two))
-          (push (if (listp x1)
-                    (append x1 (list x2))
-                  (list x1 x2))
-                return)))
-      (setq one return)
-      (pyim-permutate-list2-internal one (cdr two)))))
-
 (defun pyim-list-merge (a b)
   "Join list A and B to a new list, then delete dups."
   (let ((a (if (listp a)
diff --git a/pyim-cstring.el b/pyim-cstring.el
index 11182e3..fde9cdf 100644
--- a/pyim-cstring.el
+++ b/pyim-cstring.el
@@ -260,7 +260,7 @@ BUG: 当 STRING 中包含其它标点符号,并且设置 SEPERATER 时,结
 
       ;; 通过排列组合的方式, 重排 pinyins-list。
       ;; 比如:(("Hello") ("yin") ("hang" "xing")) -> (("Hello" "yin" "hang") 
("Hello" "yin" "xing"))
-      (setq pinyins-list-permutated (pyim-permutate-list2 pinyins-list))
+      (setq pinyins-list-permutated (pyim-permutate-list pinyins-list))
 
       ;; 使用 pyim 的安装的词库来校正多音字。
       (when adjust-duo-yin-zi



reply via email to

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