[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 126dae5fd7 7/7: Simplify pyim-cstring-to-pinyin
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 126dae5fd7 7/7: Simplify pyim-cstring-to-pinyin |
Date: |
Fri, 13 Jan 2023 23:58:04 -0500 (EST) |
branch: externals/pyim
commit 126dae5fd74c209735e0b7a799d3c5a67735cb03
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Simplify pyim-cstring-to-pinyin
---
pyim-cstring.el | 42 +++++++++++++++++++-----------------------
1 file changed, 19 insertions(+), 23 deletions(-)
diff --git a/pyim-cstring.el b/pyim-cstring.el
index 527ba62932..7ddd406e98 100644
--- a/pyim-cstring.el
+++ b/pyim-cstring.el
@@ -112,35 +112,31 @@ BUG: 当 STRING 中包含其它标点符号,并且设置 SEPERATER 时,结
(if return-list
(list string)
string)
- (let (pinyins-list)
- ;; ("Hello" "银" "行") -> (("Hello") ("yin") ("hang" "xing"))
- (setq pinyins-list
+ (let* ((pinyins-list
+ ;; ("Hello" "银" "行") -> (("Hello") ("yin") ("hang" "xing"))
(mapcar (lambda (str)
(if (pyim-string-match-p "\\cc" str)
(pyim-pymap-cchar2py-get str)
(list str)))
(pyim-cstring--partition string t)))
-
- ;; 通过排列组合的方式, 重排 pinyins-list。
- ;; 比如:(("Hello") ("yin") ("hang")) -> (("Hello" "yin" "hang"))
- (setq pinyins-list
- (pyim-permutate-list
- (pyim-cstring--adjust-duoyinzi
- string pinyins-list)))
-
+ ;; 通过排列组合的方式, 重排 pinyins-list。
+ ;; 比如:(("Hello") ("yin") ("hang")) -> (("Hello" "yin" "hang"))
+ (pinyins-list (pyim-permutate-list
+ (pyim-cstring--adjust-duoyinzi
+ string pinyins-list)))
+ (list (mapcar (lambda (x)
+ (mapconcat (lambda (str)
+ (if shou-zi-mu
+ (substring str 0 1)
+ str))
+ x separator))
+ (if ignore-duo-yin-zi
+ (list (car pinyins-list))
+ pinyins-list))))
;; 返回拼音字符串或者拼音列表
- (let ((list (mapcar (lambda (x)
- (mapconcat (lambda (str)
- (if shou-zi-mu
- (substring str 0 1)
- str))
- x separator))
- (if ignore-duo-yin-zi
- (list (car pinyins-list))
- pinyins-list))))
- (if return-list
- list
- (string-join list " "))))))
+ (if return-list
+ list
+ (string-join list " ")))))
(defun pyim-cstring--adjust-duoyinzi (word pinyins-list)
"根据 WORD 对 PINYINS-LIST 进行校正。
- [elpa] externals/pyim updated (d1a192bee9 -> 126dae5fd7), ELPA Syncer, 2023/01/13
- [elpa] externals/pyim 126dae5fd7 7/7: Simplify pyim-cstring-to-pinyin,
ELPA Syncer <=
- [elpa] externals/pyim c6fd32f9b2 3/7: Simplify pyim-liberime-create-word, ELPA Syncer, 2023/01/13
- [elpa] externals/pyim 4689205781 5/7: Remove pinyins-list-adjusted, ELPA Syncer, 2023/01/13
- [elpa] externals/pyim ce221279e6 1/7: Add pyim-liberime-create-word and remove pyim-liberime-create-word-at-point, ELPA Syncer, 2023/01/13
- [elpa] externals/pyim be4678058d 2/7: pyim-process-create-word do not return message string., ELPA Syncer, 2023/01/13
- [elpa] externals/pyim a1e5df62ca 4/7: Add duoyinzi adjust feature, ELPA Syncer, 2023/01/13
- [elpa] externals/pyim 2757ccbbd6 6/7: Remove pinyins-list-adjusted again, ELPA Syncer, 2023/01/13