emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#34215: closed (27.0.50; Provide elisp access to Ch


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#34215: closed (27.0.50; Provide elisp access to Chinese pinyin-to-character mapping)
Date: Sun, 24 Feb 2019 19:13:03 +0000

Your message dated Sun, 24 Feb 2019 11:12:16 -0800
with message-id <address@hidden>
and subject line 
has caused the debbugs.gnu.org bug report #34215,
regarding 27.0.50; Provide elisp access to Chinese pinyin-to-character mapping
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
34215: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=34215
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 27.0.50; Provide elisp access to Chinese pinyin-to-character mapping Date: Sat, 26 Jan 2019 21:34:39 -0800 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
This bug report is apropos to this[1] emacs.devel thread.

The basic idea is that in the Emacs sources there's a file containing a
mapping between pinyin -- the most common Chinese romanization system --
and Chinese characters themselves. The mapping lives in
leim/MISC-DIC/pinyin.map, and is converted into a quail input method by
the `py-converter' function in titdic-cnv.el, which is part of the
"make" process.

I want this mapping to be available to elisp code in general, because
it's useful for all kinds of other language utilities (searching Chinese
characters using ascii letters, etc).

pinyin.map is a plain text file, each line consisting of a romanized
syllable, a TAB, and a string of the possible corresponding Chinese
characters. `titdic-convert' parses this and feeds it to
`quail-define-rules'.

My first thought was to add an intermediate step, where `titdic-convert'
first composes an alist, then feeds that alist to `quail-define-rules',
which would also allow us access to the alist.

The more I looked at it, the more hacky and awkward that approached
seemed, and it's not like it would save any memory: you still end up
with the data both in a quail method, and in a separate alist.

So this proposed patch simply parses the same file in the same way, but
in a different location. I've put it in china-util.el, but chinese.el
would also be a reasonable spot. Both those files are concerned with
encoding, but at least "china-util" gives the impression that it could
be a grab-bag.

I'm not sure this use of `source-directory' is particularly robust, but
I don't know how else to handle it.

Hope this will be considered!

Eric

[1]: https://lists.gnu.org/archive/html/emacs-devel/2019-01/msg00306.html

Attachment: 0001-New-constant-chinese-pinyin-character-map.patch
Description: Text Data


--- End Message ---
--- Begin Message --- Subject: Date: Sun, 24 Feb 2019 11:12:16 -0800 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

--- End Message ---

reply via email to

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