On Sun May 31 2015 Feng Shu wrote:
> I just use `pyim-hanzi2pinyin' function, which do such work:
> "你好 BBDB" -> "nihao BBDB"
> so, what I want to do is like this, for example:
> 1. I have a contact record, which name is "你好 BBDB"
> 2. If use `string-match', I need type "你好" to search this record, which
> need to use Chinese input method and not convenience.
I am still surprised: The purpose of having input methods is to
solve exactly this type of problems! With a suitable input method
you should be able to type plain ascii
which the input method will convert into the text string
i.e., the input method should go the opposite direction from what
chinese-pyim appears to do. And this should work whenever you need
to specify the string "你好 BBDB", be it for searching BBDB, be it
for creating a new record, or be it something completely different
you need to do with emacs.
(Going the opposite direction "nihao BBDB" -> "你好 BBDB" instead of
"你好 BBDB" -> "nihao BBDB" which chinese-pyim seems to do is
certainly much cleaner because emacs will always use the text
strings you really aim for.)
> Another toy example is that you can use "az" to match
> "affffggggzzkkkz", at bbdb-search's condition, this is useful.
It's not quite clear to me what the underlying algorithm is. But
whatever it might be, it seems to be independent of anything
BBDB-specific. So if the behavior you describe is indeed useful, it
should be implemented in a more generic way than using customizable
variables that affect only rather particular use cases.
> Another approach is auto add "AKA" field with a fuction, the
> problem of this approach is that, many different chinese-char have
> same pinyin, so I need deal with many many conflites when I use
> this approach.
But isn't this likewise a rather general problem with how chinese
characters are handled?
There are already quite many chinese input methods for emacs. Have
you checked them? Possibly there is not yet an input method doing
what you have in mind. But then it might be much better if you
tried to fix that by defining another chinese input method. It's
not good to cure symptoms if the actual problem appears to lie
> The above `string-match' only meanful in `bbdb-search', meanless
> in other situation.
BBDB Home Page: http://bbdb.sourceforge.net/