[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim ce221279e6 1/7: Add pyim-liberime-create-word and
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim ce221279e6 1/7: Add pyim-liberime-create-word and remove pyim-liberime-create-word-at-point |
Date: |
Fri, 13 Jan 2023 23:58:03 -0500 (EST) |
branch: externals/pyim
commit ce221279e6ad2cd0b265d5899bf08b2781d62323
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Add pyim-liberime-create-word and remove pyim-liberime-create-word-at-point
---
pyim-liberime.el | 28 ++++++++++------------------
1 file changed, 10 insertions(+), 18 deletions(-)
diff --git a/pyim-liberime.el b/pyim-liberime.el
index 689c55746e..1a9a7f3bdc 100644
--- a/pyim-liberime.el
+++ b/pyim-liberime.el
@@ -295,33 +295,25 @@ Please see: https://github.com/rime/librime/issues/349"
(setq words nil))
(t (liberime-process-key 65366))))))))))
-(defun pyim-liberime-create-word-at-point (&optional number silent)
- "将光标前字符数为 NUMBER 的中文字符串添加到 RIME 数据库中。
-当 SILENT 设置为 t 是,不显示提醒信息。
+(defun pyim-liberime-create-word (word &rest _)
+ "将 WORD 添加到 RIME 数据库中。
-这个命令对多音字处理比较弱,所以有可能在 RIME 数据库中添加一些不
-合理的词条,比如:
-
- yin-xing -> 银行
-
-这个问题暂时还没有好的方法解决。"
- (interactive)
+这个函数仅用于 rime-quanpin scheme."
(when-let* ((rime-quanpin-p
(equal (pyim-scheme-name (pyim-scheme-current))
'rime-quanpin))
- (string (pyim-cstring-at-point (or number 2)))
- (chars (remove "" (split-string string "")))
+ (chars (remove "" (split-string word "")))
(codes-list
(mapcar (lambda (x)
(split-string x "-"))
- (pyim-cstring-to-pinyin string nil "-" t nil t))))
+ (pyim-cstring-to-pinyin word nil "-" t nil t))))
(dolist (codes codes-list)
- (pyim-liberime--create-word codes chars)
- (unless silent
- (message "将词条: %S -> %S 加入 rime 数据库。"
- (string-join codes "-") string)))))
+ (pyim-liberime--create-word codes chars))
+ (mapconcat (lambda (codes)
+ (format "%s -> %s" (string-join codes "-") word))
+ codes-list "; ")))
-(advice-add 'pyim-process-create-word-at-point :after
#'pyim-liberime-create-word-at-point)
+(advice-add 'pyim-process-create-word :after #'pyim-liberime-create-word)
(cl-defmethod pyim-process-terminate-really ((_scheme pyim-scheme-rime))
(cl-call-next-method)
- [elpa] externals/pyim updated (d1a192bee9 -> 126dae5fd7), ELPA Syncer, 2023/01/13
- [elpa] externals/pyim 126dae5fd7 7/7: Simplify pyim-cstring-to-pinyin, ELPA Syncer, 2023/01/13
- [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 <=
- [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