From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.devel Subject: Re: Building intermediate Chinese language romanization alists Date: Tue, 15 Jan 2019 16:29:09 -0800 Message-ID: <87d0ox1m3u.fsf@ericabrahamsen.net> References: <87h8e94o10.fsf@ericabrahamsen.net> <87y37l4fi2.fsf@red-bean.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1547598443 10401 195.159.176.226 (16 Jan 2019 00:27:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2019 00:27:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 16 01:27:18 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gjZ37-0002aj-P3 for ged-emacs-devel@m.gmane.org; Wed, 16 Jan 2019 01:27:17 +0100 Original-Received: from localhost ([127.0.0.1]:55330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjZ5E-00035s-GC for ged-emacs-devel@m.gmane.org; Tue, 15 Jan 2019 19:29:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gjZ57-000359-Qi for emacs-devel@gnu.org; Tue, 15 Jan 2019 19:29:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gjZ56-00088L-I6 for emacs-devel@gnu.org; Tue, 15 Jan 2019 19:29:21 -0500 Original-Received: from [195.159.176.226] (port=41284 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gjZ55-00082s-3O for emacs-devel@gnu.org; Tue, 15 Jan 2019 19:29:19 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gjZ2u-0002I9-GY for emacs-devel@gnu.org; Wed, 16 Jan 2019 01:27:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 28 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:Otd0IrCZ86wpmr+mE7dqA++vTvg= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232379 Archived-At: Karl Fogel writes: >>Eric Abrahamsen writes: >>>I might be able to get the map back out of quail somehow, but since this >>>seems to be something that more than a few people would like access to, >>>I wonder if it would be acceptable to add an intermediary step, creating >>>(for instance) a defconst called `pinyin-map-alist' that holds the >>>contents of pinyin.map, and then changing the `quail-define-rules' call >>>to: >> >>I think I've done the reverse-mapping you want. In my .emacs >> >(http://svn.red-bean.com/repos/kfogel/trunk/.emacs), start at the >> function >`kf-pinyin-from-char'. See also the code to build >> `kf-quail-inverted-map' >right above it. > > Ah, I meant to preface that response with "I don't know if this is useful to your purposes, but... [etc]" > > Basically I was just saying "Yes, you can get the map back out of quail", by providing you an existence proof :-). > > I totally agree with you that it would be better for Emacs to offer > the bidirectional mapping by default. I don't know enough to comment > on whether your proposed method is a good way to do this. (I wrote > that inversion code in 2004, and although I use it often, I haven't > had to hack on it since then or explore quail mappings further.) My proposal would create a pinyin-to-character alist, that's all. If you wanted character-to-pinyin you'd still have to reverse that, but it would still be quite a bit simpler than pulling open the quail-map yourself!