[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim 4c8b8afc5a 21/41: * pyim-candidates.el (pyim-candi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim 4c8b8afc5a 21/41: * pyim-candidates.el (pyim-candidates-quanpin): Simplify. |
Date: |
Sat, 4 Jun 2022 09:57:46 -0400 (EDT) |
branch: externals/pyim
commit 4c8b8afc5ac6b08db5bc36ee8ec8a84cac12279c
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
* pyim-candidates.el (pyim-candidates-quanpin): Simplify.
---
pyim-candidates.el | 44 ++++++++++++--------------------------------
1 file changed, 12 insertions(+), 32 deletions(-)
diff --git a/pyim-candidates.el b/pyim-candidates.el
index 52af01e5ec..6434e66ce7 100644
--- a/pyim-candidates.el
+++ b/pyim-candidates.el
@@ -164,44 +164,24 @@
candidates)))
(defun pyim-candidates-quanpin (imobjs scheme &optional fast-search)
- "`pyim-candidates-create' 内部使用的函数。"
+ "用于全拼输入法的 `pyim-candidates-create' 方法内部使用的函数。"
(let* ((znabc-words (pyim-candidates-znabc-words imobjs scheme fast-search))
(jianpin-words (pyim-candidates-jianpin-words imobjs scheme
fast-search))
(dcache-words (pyim-candidates-dcache-words imobjs scheme
fast-search))
- (personal-words (nth 0 dcache-words))
+ (personal-words (pyim-candidates-sort (nth 0 dcache-words)))
+ (chief-word (pyim-candidates-get-chief scheme personal-words))
(common-words (nth 1 dcache-words))
(pinyin-chars-1 (nth 2 dcache-words))
(pinyin-chars-2 (nth 3 dcache-words))
- chief-word)
-
- (setq personal-words (pyim-candidates-sort personal-words))
- (setq chief-word (pyim-candidates-get-chief scheme personal-words))
-
- ;; 调试输出
- (when pyim-debug
- (print (list :imobjs imobjs
- :chief-word chief-word
- :personal-words personal-words
- :common-words common-words
- :jianpin-words jianpin-words
- :znabc-words znabc-words
- :pinyin-chars-1
- (cl-subseq pinyin-chars-1
- 0 (min (length pinyin-chars-1) 5))
- :pinyin-chars-2
- (cl-subseq pinyin-chars-2
- 0 (min (length pinyin-chars-2) 5)))))
-
- (delete-dups
- (delq nil
- `(,chief-word
- ,@personal-words
- ,@jianpin-words
- ,@common-words
- ,@znabc-words
- ,@pinyin-chars-1
- ,@pinyin-chars-2
- )))))
+ (words `( :chief-word ,chief-word
+ :personal-words ,@personal-words
+ :jianpin-words ,@jianpin-words
+ :common-words ,@common-words
+ :znabc-words ,@znabc-words
+ :pinyin-chars-1 ,@pinyin-chars-1
+ :pinyin-chars-2 ,@pinyin-chars-2)))
+ (when pyim-debug (print words))
+ (delete-dups (cl-remove-if-not #'stringp words))))
(defun pyim-candidates-znabc-words (imobjs scheme &optional fast-search)
"智能ABC模式,得到尽可能的拼音组合,查询这些组合,得到的词条做为联想词。"
- [elpa] externals/pyim 1330b436a6 27/41: Refactor pyim-page.el, (continued)
- [elpa] externals/pyim 1330b436a6 27/41: Refactor pyim-page.el, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 302f1bff4b 34/41: Refactor pyim-preview.el, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 987087e515 15/41: Update pyim-candidates-create-quanpin., ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 35bf05ce3e 19/41: pyim-scheme-common -> pyim-scheme, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim fa9f9f4244 24/41: Update pyim-candidates-dcache-words., ELPA Syncer, 2022/06/04
- [elpa] externals/pyim aaa5f728f9 25/41: Fix compile warn., ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 29a112182a 28/41: Refactor pyim-candidates.el, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim c4d73f836d 13/41: pyim-candidates-create-get-dcache-words -> pyim-candidates-dcache-words, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 3e53c5e923 20/41: pyim-candidates-create-quanpin -> pyim-candidates-quanpin, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim c1cbba5f52 18/41: Fix pyim-tests.el, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 4c8b8afc5a 21/41: * pyim-candidates.el (pyim-candidates-quanpin): Simplify.,
ELPA Syncer <=
- [elpa] externals/pyim 7c6ece9d4d 26/41: * pyim-liberime.el (pyim-process-terminate-really): do not use :after., ELPA Syncer, 2022/06/04
- [elpa] externals/pyim cfe94f23f4 30/41: Set pyim-force-input-chinese-functions default value is nil., ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 5747879711 37/41: pyim-page-info-format style eql two-lines., ELPA Syncer, 2022/06/04