unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: tumashu  <tumashu@163.com>
To: "Clément Pit-Claudel" <cpitclaudel@gmail.com>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re:Re: [ELPA] New package: pyim
Date: Mon, 22 Feb 2021 16:47:38 +0800 (CST)	[thread overview]
Message-ID: <14736519.498e.177c8ec32a0.Coremail.tumashu@163.com> (raw)
In-Reply-To: <e69b3519-31be-2783-bf7e-70311e1681b4@gmail.com>

At 2021-02-22 16:19:34, "Clément Pit-Claudel" <cpitclaudel@gmail.com> wrote:
>On 2/22/21 1:49 AM, tumashu wrote:
>> the real quesiton for me,  is that  is it acceptable for GNU elpa  by import and convert  libpinyin's table to  pyim.
>
>Libpinyin seems to be GPLv3; if that is correct, then there is no issue at all and your use is completely acceptable.

sorry, I remeber wrong:

pyim-pymap.el is converted from pinyin_simp.dict.yaml of
[[https://github.com/rime/rime-pinyin-simp][rime-pinyin-simp]]

rime-pinyin-simp use LGPL-3.0 License, while pinyin_simp.dict.yaml
has the header like below:

# Rime dictionary
# encoding: utf-8
#
# A minimal Pinyin dictionary for simplified Chinese script
#
# Derived from android open source project:
# http://android.git.kernel.org/?p=platform/packages/inputmethods/PinyinIME.git
#

-----------------------------------------------------
the below is convert script.

(defun pyim-pymap-new nil)

(defun pyim-pymap-importer ()
  "将格式为:

你	ni
我	wo

的文件内容,转换为 pyim 的 pymap

注意: 这个文件中词条的词率由低到高排列。"
  (interactive)
  (let ((hashtable (make-hash-table :size 1000000 :test #'equal))
        alist)
    (while (not (eobp))
      (let* ((begin (line-beginning-position))
             (end (line-end-position))
             (items (split-string
                     (buffer-substring-no-properties begin end)
                     "	"))
             (word (nth 0 items))
             (pinyin (nth 1 items)))
        (when (and pinyin word)
          (puthash pinyin
                   (concat word
                           (replace-regexp-in-string
                            word ""
                            (or (gethash pinyin hashtable) "")))
                   hashtable)))
      (forward-line 1))
    (maphash
     #'(lambda (key value)
         (push (list key value) alist))
     hashtable)
    (setq pyim-pymap-new
          (seq-sort
           #'(lambda (a b)
               (string< (car a) (car b)))
           alist))))

  reply	other threads:[~2021-02-22  8:47 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22  2:42 [ELPA] New package: pyim tumashu
2021-02-22  2:55 ` tumashu
2021-02-22  3:01 ` [ELPA] " Stefan Monnier
2021-02-22  3:20   ` tumashu
2021-02-22  4:42     ` Stefan Monnier
2021-02-22  4:56       ` tumashu
2021-02-22  6:31         ` Eric Abrahamsen
2021-02-22  6:49           ` tumashu
2021-02-22  8:19             ` Clément Pit-Claudel
2021-02-22  8:47               ` tumashu [this message]
2021-02-22 16:29     ` Zhu Zihao
2021-02-22 16:36       ` Zhu Zihao
2021-02-22 17:02         ` Clément Pit-Claudel
2021-02-23  6:11       ` tumashu
2021-02-22 15:09   ` Eli Zaretskii
2021-02-22 17:41     ` Robert Pluim
2021-02-22 18:28       ` Eli Zaretskii
2021-02-22 18:40         ` Robert Pluim
2021-02-22 18:51           ` Eli Zaretskii
2021-02-22 22:27             ` Stefan Monnier
2021-02-23  3:30               ` Eli Zaretskii
2021-02-23  5:07                 ` Stefan Monnier
2021-02-23  9:08                   ` tumashu
2021-02-23 15:18                   ` Eli Zaretskii
2021-02-23 16:17                     ` Stefan Monnier
2021-02-23 16:37                       ` Eli Zaretskii
2021-03-07  8:44                     ` William Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14736519.498e.177c8ec32a0.Coremail.tumashu@163.com \
    --to=tumashu@163.com \
    --cc=cpitclaudel@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).