Subject: A new friendly HZ input method for cxterm

From: Qing Zhang <[email-masked]>
Date: Sun, 10 Jan 1993 17:19:29 PST

Hi, everybody,

If you are using cxterm and chinese, and are not satisfied with the input
method, you might be interested in this new HZ input method.

What is new?  The new feature is that you don't have to spell out PinYin
EXACTly in order to find words.  Sound great to thoes who are struggling hard
with PinYin?  Also, it support about 25,000 phrases, and allows you to define
your own phrases and symbols, all in a consistent style.

I call this method "MEPY" which stands for "Main Element PinYin" or in chinese
    \        ---      |   \  /      \
  -----     -----   --|- -----    -----
    |        | |      |   | |      \ /
  -----      | |      |/  | |     =====
    |       /  |    --|  -|-|-    |---|
  -----    /   L_     |   | |     |___|

and I had integrated it into cxterm X11 R5 in GB mode.  The main idea is that
it uses the main element of PinYin to identify character or phrases.  In the
following discussion, I use "HZ" for single Chinese Char, and "CW" for Chinese
Word or phrases.

1.      It support both HZ and CW mode. You will be switched to CW mode
        automatically by continuing typing in PinYin.

2.      The great thing about MEPY is its capability to tolerate wrong spelling
        of pinyin when you are looking for HZs or CWs. As many people had suffer
ed
        trying to get correct pinyin in order to find what they are looking for,
        MEPY does not require you to always type in correct pinyin, and it will
        tolerate many common mistakes, such as the confusion between "c" and "ch
",
         "r" and "l", "in" and "ing", "o" and "ou" and "uo", and so on.

        However, MEPY achieve this capability without sacrifying anything, if
        your pinyin is good, you will find MEPY is easy and convenient to use,
        if your pinyin is poor, you will be happy to find that you can still
        get the words you looking for, instead of frustrating by constant
        trying and error and trying.

        For example, if you are looking for a single HZ "zhang" and you typed
        in "zan", you can use a single key '>' or '<' to switch to "zang", "zhan
",
        and "zhang", each time, the corresponding pinyin will be prompted. But
        if you know the correct pinyin, you don't loose anything. Is this nicer
        than having to use Backspace to delete and try again?

3.      The main strength of MEPY is its ability to capture CW even though you
        don't type in correct Pinyin.  For example, if you want to find
        ChangJiang (long river) and you type in "canjan", you can still get
        what you want. The reason is that "changjiang" and "canjan" share the
        same ME Pinyin. This feature has two benefits: the first one is the
        ability to tolerate your wrong input; the second is to allow you to
        purposely use this feature to save some key strikings.

        Even great is that if you happened to type in "zhangjiang" to look for
        "ChangJiang" (long river),  it will still get the word.  Remember
        "Chang" (means long) has another pronounciation "Zhang".  There are
        many HZs which have more than one pronounciation, but under specific
        CWs, they have to be pronounced in one way or the other, but not both.
        In many occassions, people tend to make mistakes to get the correct
        prounciation, you can't blame people for these kinds of mistakes, you
        have to blame HZ.  In MEPY, it can tolerate these kinds of mistakes,
        therefore ease the user to find the CW they want.

4.      You can define your own CWs in a specific file, and define various
        symbols ( like punctuations, arithmetic symbol, numerical symbols )
        in another file. When MEPY is loaded, it will read these two files.
        Once loaded, you can use them in the same way as HZ and CW, the only
        difference is that, for user defined CW, you have to start with 'u',
        and for all symbols, you have to start with 'v', then you can input
        the key ( consisting of zero to four chars) you defined in the file
        to search the CW and symbols you want. With 4 char key, you can almost
        define everything you need, like name, technical term, commonly used
        phrases, even Greek characters, Japanese Hiragana, and so on. The
        advantage is that you don't need to switch input method to get them.

5.      Dynamically adjust the frequently used HZ and CW to make them easy to sp
ot.
        For CWs, it is simple, I just put the most recently selected CW at the
        first position. But for HZs, I decide not to do it that way, because
        many HZ entries have dozens of HZ to select, constant position change
        makes them randomly ordered, the result is that you have to examine each
        of them closely. Instead, I decided that each HZ entry has a fixed
        order, arranged from simple strokes to complex strokes (not very strickl
y),
        and those HZ which looks similar are clustered together to make them eas
y
        to find. Of course, those rarely used HZs are put at last, arranged in
        the same principle. In addition, I created some hot HZ caches to put
        those recently selected HZs, each starts with a vowel Pinyin letter.  So
        when you type in 'c', you will find all the recently selected HZ start
        with 'c'. The capacity of each cache depends on how many HZ you can
        displayed each time in the input area. The advantage is that you can
        easily find the frequently used HZ, at the same time, the order of
        regular HZ is not disturbed.

6.      MEPY data structure is very compact. With more than 7000 HZs and 25,000
        CWs, the data structure takes about 260K bytes momery. The whole module
        is totally portable, and ready to integrate into any word processor
        package. For example, I just spend a few hours to integrate it into
        cxterm.

I decided to put in into the public domain for every body to try it.  For
the moment, I only integrated into cxterm for X11 R5.0, there should be no
problem with X11 R4.0, but I haven't try it. Before putting it into public
domain, I would like to have some one to try it first to see if there is any
problem in interating.  If there is already a cxterm on your machine, and
you have the source code, all you need to do is to add two more source file
into the Imakefile, replace one source file, compile and run it.

Send me a mail if you want to try it.

The only "obligation" to use it is that you "have to" report any bugs to me
or places for improvement. For example, if you find some commonly used CWs are
missing, record them and send me a copy, I will put them into it in later
release, because a thorough data check is so time consuming that I can't afford
to do it myself.

#### NOTE ####

I do claim the copyright of this "MEPY" HZ input method and the related
source code and data.  You may not use this input method, souce code and
data for commercial purpose without written perssion from the author.

Qing Zhang,

[email-masked]
[email-masked]

###############################################################################