emacs-devel
[Top][All Lists]
Advanced

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

Re: Building intermediate Chinese language romanization alists


From: Karl Fogel
Subject: Re: Building intermediate Chinese language romanization alists
Date: Tue, 15 Jan 2019 18:23:33 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>Eric Abrahamsen <address@hidden> 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.)

Best regards,
-Karl

>>(apply #'quail-define-rules pinyin-map-alist)
>>
>>The input method wouldn't be affected, but we'd have access to the
>>mapping via the constant, which would be very useful.
>>
>>Pinyin would be the most useful romanization method to do this for, but
>>it looks like the CTLau and possibly ziranma methods might benefit from
>>similar treatment.
>>
>>(Another issue is that if the constant is written into PY.el, which
>>isn't a library, it might be a bit difficult to get out again, but
>>perhaps the defconst could be appended to one
>>of./lisp/language/{chinese.el,china-util.el}. Or PY.el could be made a
>>library.)
>>
>>I'm not entirely familiar with the language-related build process, but I
>>hope there might be an appropriate stage at which to hang the alist on a
>>variable name.
>>
>>Thanks,
>>Eric
>>
>>[1]: https://github.com/tumashu/pyim/blob/master/pyim-pymap.el



reply via email to

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