[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/pyim e00b7d633a 3/8: Add pyim-process-code-criteria var
From: |
ELPA Syncer |
Subject: |
[elpa] externals/pyim e00b7d633a 3/8: Add pyim-process-code-criteria variable. |
Date: |
Sat, 28 May 2022 18:57:48 -0400 (EDT) |
branch: externals/pyim
commit e00b7d633a92f841a88c40dd75b5fa5d2a98360e
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>
Add pyim-process-code-criteria variable.
* pyim-process.el (pyim-process-code-criteria): New variable.
(pyim-process-create-code-criteria): Use above variable.
(pyim-process-create-word, pyim-process-terminate): Use above
variable.
* pyim-cstring.el (pyim-cstring-to-code-criteria): Removed.
---
pyim-cstring.el | 9 ---------
pyim-process.el | 21 +++++++++++++++------
2 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/pyim-cstring.el b/pyim-cstring.el
index 331124941e..6de6a96ee0 100644
--- a/pyim-cstring.el
+++ b/pyim-cstring.el
@@ -37,15 +37,6 @@
"Chinese string tools for pyim."
:group 'pyim)
-(defvar pyim-cstring-to-code-criteria nil
- "用于 code 选取的基准字符串。
-
-`pyim-cstring-to-codes' 获取到一个词条的多个 codes 时,会将所有的
-codes 与这个字符串进行比较,然后选择一个最相似的 code 输出.
-
-这个字符串主要用于全拼和双拼输入法的多音字矫正,一般使用用户输入
-生成的 imobjs 转换得到,保留了用户原始输入的许多信息。")
-
(defun pyim-cstring-partition (string &optional to-cchar)
"STRING partition.
diff --git a/pyim-process.el b/pyim-process.el
index ebd9b73f9e..c807e0aa22 100644
--- a/pyim-process.el
+++ b/pyim-process.el
@@ -108,6 +108,15 @@ entered (nihaom) 的第一个候选词。
(defvar pyim-process-last-created-words nil
"记录最近创建的词条, 用于实现快捷删词功能: `pyim-delete-last-word' .")
+(defvar pyim-process-code-criteria nil
+ "用于 code 选取的基准字符串。
+
+当获取到一个词条的多个 codes 时, pyim 会将所有的 codes 与这个字
+符串进行比较,然后选择一个与这个字符串最相似的 code.
+
+这个变量主要用于全拼和双拼输入法的多音字矫正,其取值一般使用用户
+输入生成的 imobjs 转换得到,保留了用户原始输入的许多信息。")
+
(defvar pyim-process-run-async-timer nil
"异步处理 entered 时,使用的 timer.")
@@ -579,14 +588,14 @@ alist 列表。"
(not (pyim-process-auto-switch-english-input-p))))))
(defun pyim-process-create-code-criteria ()
- "创建 `pyim-cstring-to-code-criteria'."
- (setq pyim-cstring-to-code-criteria
+ "创建 `pyim-process-code-criteria'."
+ (setq pyim-process-code-criteria
(let ((str (string-join
(pyim-codes-create (pyim-process-get-first-imobj)
(pyim-scheme-name)))))
- (if (> (length pyim-cstring-to-code-criteria)
+ (if (> (length pyim-process-code-criteria)
(length str))
- pyim-cstring-to-code-criteria
+ pyim-process-code-criteria
str))))
(defun pyim-process-create-word (word &optional prepend wordcount-handler
criteria)
@@ -624,7 +633,7 @@ BUG:拼音无法有效地处理多音字。"
(code-prefix (pyim-scheme-get-option scheme-name :code-prefix))
(codes (pyim-cstring-to-codes
word scheme-name
- (or criteria pyim-cstring-to-code-criteria))))
+ (or criteria pyim-process-code-criteria))))
;; 保存对应词条的词频
(when (> (length word) 0)
(pyim-dcache-update-wordcount word (or wordcount-handler #'1+)))
@@ -657,10 +666,10 @@ BUG:拼音无法有效地处理多音字。"
"Terminate the translation of the current key."
(setq pyim-process-translating nil)
(pyim-entered-erase-buffer)
+ (setq pyim-process-code-criteria nil)
(setq pyim-process-force-input-chinese nil)
(setq pyim-candidates nil)
(setq pyim-candidates-last nil)
- (setq pyim-cstring-to-code-criteria nil)
(pyim-process-run-async-timer-reset)
(pyim-process-ui-hide)
(let* ((class (pyim-scheme-get-option (pyim-scheme-name) :class))
- [elpa] externals/pyim updated (c982b3fc3f -> 506ed8e1cd), ELPA Syncer, 2022/05/28
- [elpa] externals/pyim 3f8761b752 4/8: Sort pyim.el, ELPA Syncer, 2022/05/28
- [elpa] externals/pyim adf7958538 6/8: Update Development.org, ELPA Syncer, 2022/05/28
- [elpa] externals/pyim e00b7d633a 3/8: Add pyim-process-code-criteria variable.,
ELPA Syncer <=
- [elpa] externals/pyim 12b3e98f1b 5/8: 降低 pyim.el 对 pyim-cstring-utils 和 pyim-cregexp-utils 的依赖。, ELPA Syncer, 2022/05/28
- [elpa] externals/pyim a36f2295cd 1/8: Add pyim-cregexp-utils.el, ELPA Syncer, 2022/05/28
- [elpa] externals/pyim 506ed8e1cd 8/8: Update README., ELPA Syncer, 2022/05/28
- [elpa] externals/pyim fa0d22689d 7/8: Add pyim-dict-manager.el, ELPA Syncer, 2022/05/28
- [elpa] externals/pyim 4b1ba0e47e 2/8: Add pyim-cstring-utils.el, ELPA Syncer, 2022/05/28