emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/pyim 91ffc476b8 11/35: pyim-dhashcache-get* -> pyim-dha


From: ELPA Syncer
Subject: [elpa] externals/pyim 91ffc476b8 11/35: pyim-dhashcache-get* -> pyim-dhashcache--get*
Date: Fri, 24 Jun 2022 08:58:06 -0400 (EDT)

branch: externals/pyim
commit 91ffc476b89f2e12b200cc5034934a679c543074
Author: Feng Shu <tumashu@163.com>
Commit: Feng Shu <tumashu@163.com>

    pyim-dhashcache-get* -> pyim-dhashcache--get*
---
 pyim-dhashcache.el  | 24 ++++++++++++------------
 tests/pyim-tests.el | 34 +++++++++++++++++-----------------
 2 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/pyim-dhashcache.el b/pyim-dhashcache.el
index f8ea51cc6d..d20129f4a6 100644
--- a/pyim-dhashcache.el
+++ b/pyim-dhashcache.el
@@ -179,7 +179,7 @@
 
 默认 WORD 放到已有词条的最后,如果 PREPEND 为 non-nil, WORD 将放
 到已有词条的最前面。"
-  (dolist (newcode (pyim-dhashcache-get-ishortcodes code))
+  (dolist (newcode (pyim-dhashcache--get-ishortcodes-ishortcodes code))
     (pyim-dhashcache--put
      pyim-dhashcache-ishortcode2word
      newcode
@@ -187,7 +187,7 @@
          `(,word ,@(remove word orig-value))
        `(,@(remove word orig-value) ,word)))))
 
-(defun pyim-dhashcache-get-ishortcodes (code)
+(defun pyim-dhashcache--get-ishortcodes-ishortcodes (code)
   "获取CODE 所有的简写 ishortcodes.
 
 比如: ni-hao -> (n-h)
@@ -254,7 +254,7 @@
          (lambda (key value)
            (puthash key
                     (pyim-dhashcache-calculate-priority
-                     (pyim-dhashcache-get-counts-from-log
+                     (pyim-dhashcache--get-ishortcodes-counts-from-log
                       value))
                     pyim-dhashcache-iword2priority))
          pyim-dhashcache-iword2count-log)
@@ -290,7 +290,7 @@
                         factor))))
           pyim-dhashcache-count-types))
 
-(defun pyim-dhashcache-get-counts-from-log (log-info &optional time)
+(defun pyim-dhashcache--get-ishortcodes-counts-from-log (log-info &optional 
time)
   "从 LOG-INFO 中获取所有的 count 值。
 
 比如: ((day :20220205 10
@@ -372,7 +372,7 @@
   (let ((ishortcode2word (make-hash-table :test #'equal)))
     (maphash
      (lambda (key value)
-       (dolist (newkey (pyim-dhashcache-get-ishortcodes key))
+       (dolist (newkey (pyim-dhashcache--get-ishortcodes-ishortcodes key))
          (puthash newkey
                   (delete-dups
                    `(,@(gethash newkey ishortcode2word)
@@ -393,9 +393,9 @@
 
 如果 FORCE 为真,强制加载。"
   (interactive)
-  (let* ((code2word-file (pyim-dhashcache-get-path 'pyim-dhashcache-code2word))
-         (word2code-file (pyim-dhashcache-get-path 'pyim-dhashcache-word2code))
-         (code2word-md5-file (pyim-dhashcache-get-path 
'pyim-dhashcache-code2word-md5)))
+  (let* ((code2word-file (pyim-dhashcache--get-ishortcodes-path 
'pyim-dhashcache-code2word))
+         (word2code-file (pyim-dhashcache--get-ishortcodes-path 
'pyim-dhashcache-word2code))
+         (code2word-md5-file (pyim-dhashcache--get-ishortcodes-path 
'pyim-dhashcache-code2word-md5)))
     (when (or force (and (not (equal dicts-md5 
(pyim-dcache-get-value-from-file code2word-md5-file)))
                          (not pyim-dhashcache--update-code2word-running-p)))
       (setq pyim-dhashcache--update-code2word-running-p t)
@@ -443,7 +443,7 @@ DCACHE 是一个 code -> words 的 hashtable.
        dcache)
       (pyim-dcache-save-value-to-file hashtable file))))
 
-(defun pyim-dhashcache-get-path (variable)
+(defun pyim-dhashcache--get-ishortcodes-path (variable)
   "获取保存 VARIABLE 取值的文件的路径."
   (when (symbolp variable)
     (concat (file-name-as-directory pyim-dcache-directory)
@@ -506,7 +506,7 @@ pyim 使用的词库文件是简单的文本文件,编码 *强制* 为 \\='utf
   (let ((shortcode2word (make-hash-table :test #'equal)))
     (maphash
      (lambda (key value)
-       (dolist (x (pyim-dhashcache-get-shortcodes key))
+       (dolist (x (pyim-dhashcache--get-ishortcodes-shortcodes key))
          (puthash x
                   (mapcar
                    (lambda (word)
@@ -528,7 +528,7 @@ pyim 使用的词库文件是简单的文本文件,编码 *强制* 为 \\='utf
      shortcode2word)
     shortcode2word))
 
-(defun pyim-dhashcache-get-shortcodes (code)
+(defun pyim-dhashcache--get-ishortcodes-shortcodes (code)
   "获取 CODE 所有的 shortcodes.
 
 比如:wubi/aaaa -> (wubi/aaa wubi/aa)
@@ -596,7 +596,7 @@ pyim 使用的词库文件是简单的文本文件,编码 *强制* 为 \\='utf
    ;; Fix warn
    (ignore orig-value)
    (pyim-dhashcache-calculate-priority
-    (pyim-dhashcache-get-counts-from-log
+    (pyim-dhashcache--get-ishortcodes-counts-from-log
      (gethash word pyim-dhashcache-iword2count-log)))))
 
 (defun pyim-dhashcache--update-iword2count-recent (word n hash-table)
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index cf5fa78410..06f426ea64 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -1235,25 +1235,25 @@ wo-hao 我好
   (should-not (pyim-dhashcache-pinyin-string< "你好" "你不好"))
   )
 
-(ert-deftest pyim-tests-pyim-dhashcache-get-shortcodes ()
-  (should (equal (pyim-dhashcache-get-shortcodes ".abcde") nil))
-  (should (equal (pyim-dhashcache-get-shortcodes "wubi/abcde")
+(ert-deftest pyim-tests-pyim-dhashcache--get-ishortcodes-shortcodes ()
+  (should (equal (pyim-dhashcache--get-ishortcodes-shortcodes ".abcde") nil))
+  (should (equal (pyim-dhashcache--get-ishortcodes-shortcodes "wubi/abcde")
                  '("wubi/abcd" "wubi/abc" "wubi/ab")))
-  (should (equal (pyim-dhashcache-get-shortcodes "abcde") nil))
-  (should (equal (pyim-dhashcache-get-shortcodes "ni-hao") nil))
-  (should (equal (pyim-dhashcache-get-shortcodes "") nil)))
+  (should (equal (pyim-dhashcache--get-ishortcodes-shortcodes "abcde") nil))
+  (should (equal (pyim-dhashcache--get-ishortcodes-shortcodes "ni-hao") nil))
+  (should (equal (pyim-dhashcache--get-ishortcodes-shortcodes "") nil)))
 
-(ert-deftest pyim-tests-pyim-dhashcache-get-ishortcodes ()
-  (should (equal (pyim-dhashcache-get-ishortcodes "ni-hao") '("n-h")))
-  (should (equal (pyim-dhashcache-get-ishortcodes "wubi/aaaa") nil))
-  (should (equal (pyim-dhashcache-get-ishortcodes "ni") '("n")))
-  (should (equal (pyim-dhashcache-get-ishortcodes "") nil)))
+(ert-deftest pyim-tests-pyim-dhashcache--get-ishortcodes-ishortcodes ()
+  (should (equal (pyim-dhashcache--get-ishortcodes-ishortcodes "ni-hao") 
'("n-h")))
+  (should (equal (pyim-dhashcache--get-ishortcodes-ishortcodes "wubi/aaaa") 
nil))
+  (should (equal (pyim-dhashcache--get-ishortcodes-ishortcodes "ni") '("n")))
+  (should (equal (pyim-dhashcache--get-ishortcodes-ishortcodes "") nil)))
 
-(ert-deftest pyim-tests-pyim-dhashcache-get-path ()
+(ert-deftest pyim-tests-pyim-dhashcache--get-ishortcodes-path ()
   (let* ((dir (pyim-tests-make-temp-file t))
          (pyim-dcache-directory dir))
-    (should (equal (pyim-dhashcache-get-path 'hello) (expand-file-name "hello" 
dir)))
-    (should (equal (pyim-dhashcache-get-path "hello") nil))))
+    (should (equal (pyim-dhashcache--get-ishortcodes-path 'hello) 
(expand-file-name "hello" dir)))
+    (should (equal (pyim-dhashcache--get-ishortcodes-path "hello") nil))))
 
 (ert-deftest pyim-tests-pyim-dhashcache-generate-file ()
   (let ((dist-file (pyim-tests-make-temp-file))
@@ -1371,7 +1371,7 @@ zuo-zuo-you-mang 作作有芒")
 yin-xing 因行
 ")))))
 
-(ert-deftest pyim-tests-pyim-dhashcache-get ()
+(ert-deftest pyim-tests-pyim-dhashcache--get-ishortcodes ()
   (let ((pyim-dcache-backend 'pyim-dhashcache)
         (pyim-dhashcache-code2word (make-hash-table :test #'equal))
         (pyim-dhashcache-icode2word (make-hash-table :test #'equal))
@@ -1415,8 +1415,8 @@ yin-xing 因行
     (should (equal (pyim-dcache-sort-words words)
                    '("你好" "呢耗" "你豪")))))
 
-(ert-deftest pyim-tests-pyim-dhashcache-get-counts-from-log ()
-  (should (member (pyim-dhashcache-get-counts-from-log
+(ert-deftest pyim-tests-pyim-dhashcache--get-ishortcodes-counts-from-log ()
+  (should (member (pyim-dhashcache--get-ishortcodes-counts-from-log
                    '((day :20220107 10
                           :20220106 6
                           :20220104 3



reply via email to

[Prev in Thread] Current Thread [Next in Thread]