[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim fa9f9f4244 24/41: Update pyim-candidates-dcache-wo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim fa9f9f4244 24/41: Update pyim-candidates-dcache-words. |
Date: |
Sat, 4 Jun 2022 09:57:47 -0400 (EDT) |
branch: externals/pyim
commit fa9f9f4244c29e79c4eb8978892ece39a5c18382
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Update pyim-candidates-dcache-words.
---
pyim-candidates.el | 10 ++++++----
tests/pyim-tests.el | 19 ++++++++++---------
2 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/pyim-candidates.el b/pyim-candidates.el
index 38c8e065e0..3d157a6cac 100644
--- a/pyim-candidates.el
+++ b/pyim-candidates.el
@@ -225,7 +225,7 @@
(push (delete-dups (append w2 w1)) jianpin-words)))
(pyim-zip (nreverse jianpin-words) fast-search))))
-(defun pyim-candidates-dcache-words (imobjs scheme &optional fast-search
ignore-pymap-chars)
+(defun pyim-candidates-dcache-words (imobjs scheme &optional fast-search
pymap-chars-num)
"从 dcache 获取个人词条,词库词条和第一汉字列表。"
(let (personal-words common-words pinyin-chars-1 pinyin-chars-2)
(dolist (imobj imobjs)
@@ -247,9 +247,11 @@
;; 如果 w3 找不到第一个拼音对应的汉字,那就进一步使用
;; `pyim-pymap-py2cchar-get' 来查找,这个函数支持声母搜索。可以得到
;; 更多的词条。
- (w4 (when (and (not w3) (not ignore-pymap-chars))
- (pyim-candidates-pymap-chars
- (car (pyim-codes-create imobj scheme))))))
+ (w4 (unless w3
+ (cl-subseq
+ (pyim-candidates-pymap-chars
+ (car (pyim-codes-create imobj scheme)))
+ 0 pymap-chars-num))))
(push w1 personal-words)
(push w2 common-words)
(push w3 pinyin-chars-1)
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 032e452d7f..879b4277ca 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -545,19 +545,20 @@
(pyim-dhashcache-ishortcode2word (make-hash-table :test #'equal))
(quanpin (pyim-scheme-get 'quanpin))
(imobjs1 (pyim-imobjs-create "n" quanpin))
- (imobjs2 (pyim-imobjs-create "ni-hao" quanpin))
- (imobjs3 (pyim-imobjs-create "ni" quanpin)))
+ (imobjs2 (pyim-imobjs-create "ni" quanpin))
+ (imobjs3 (pyim-imobjs-create "ni-hao" quanpin)))
(puthash "n" (list "你" "您" "妮") pyim-dhashcache-ishortcode2word)
(puthash "ni" (list "你" "尼") pyim-dhashcache-icode2word)
- (puthash "ni" (list "你" "尼") pyim-dhashcache-code2word)
+ (puthash "ni" (list "尼" "你") pyim-dhashcache-code2word)
+ (puthash "ni-hao" (list "你好" "尼耗" "呢耗") pyim-dhashcache-icode2word)
(puthash "ni-hao" (list "你好" "尼耗") pyim-dhashcache-code2word)
(puthash "n-h" (list "你好" "你坏" "尼耗" "南好" "内核" "内河")
pyim-dhashcache-ishortcode2word)
- (should (equal (pyim-candidates-dcache-words imobjs1 quanpin nil t)
- '(("你" "您" "妮") nil nil nil)))
- (should (equal (pyim-candidates-dcache-words imobjs2 quanpin nil t)
- '(nil ("你好" "尼耗") ("你好" "尼耗") nil)))
- (should (equal (pyim-candidates-dcache-words imobjs3 quanpin nil t)
- '(("你" "尼") ("你" "尼") ("你" "尼" "你" "尼") nil)))))
+ (should (equal (pyim-candidates-dcache-words imobjs1 quanpin nil 10)
+ '(("你" "您" "妮") nil nil ("南" "乃" "囊" "脑" "呢" "内" "嫩" "能"
"你" "年"))))
+ (should (equal (pyim-candidates-dcache-words imobjs2 quanpin nil 10)
+ '(("你" "尼") ("尼" "你") ("你" "尼" "尼" "你") nil)))
+ (should (equal (pyim-candidates-dcache-words imobjs3 quanpin nil 10)
+ '(("你好" "尼耗" "呢耗") ("你好" "尼耗") ("你好" "尼耗" "呢耗" "你好" "尼耗")
nil)))))
(ert-deftest pyim-tests-pyim-candidates-pymap-chars ()
(should (equal (cl-subseq (pyim-candidates-pymap-chars "ni") 0 10)
- [elpa] externals/pyim 951013539c 33/41: Add progress to commentary, (continued)
- [elpa] externals/pyim 951013539c 33/41: Add progress to commentary, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim f4cc14ac64 32/41: Fix pyim-test.el, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 1b767c669e 40/41: * pyim-probe.el (pyim-probe-org-speed-commands): Updated., ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 6ef8630475 11/41: pyim-candidates-create-like-znabc -> pyim-candidates-znabc-words, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 2aa48479b4 14/41: pyim-candidates-create-get-pymap-chars -> pyim-candidates-pymap-chars, ELPA Syncer, 2022/06/04
- [elpa] externals/pyim 016064e7fc 16/41: Update docstring., ELPA Syncer, 2022/06/04
- [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 <=
- [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, 2022/06/04
- [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