an independent Chinese IME is available

classic Classic list List threaded Threaded
70 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

an independent Chinese IME is available

Sean-130

Hi,

I just uploaded a script used as an IME (Input Method Editor) for
typing Chinese as an example:
http://vim.sourceforge.net/scripts/script.php?script_id=2506

The screen-shot can be found on http://maxiangjiang.googlepages.com/vim_ime.gif

For years, I have been dreaming of an independent IME to input Chinese
from within vim. After all, vim is a text editor, which should be able
to type in any language including CJK.  It is a pain to configure and
use the supported |+multi_byte_ime| API, which is dependent on
binaries outside of vim.

As a backgrounds to those who never used CJK, the IME is a big
business in Asian countries. The basic idea is how to input ten-
thousands of characters comfortably using English keyboard.

Now, I hope vim can jump the boat comfortably.

Thanks

Sean

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Tony Mechelynck

On 04/01/09 04:12, Sean wrote:

> Hi,
>
> I just uploaded a script used as an IME (Input Method Editor) for
> typing Chinese as an example:
> http://vim.sourceforge.net/scripts/script.php?script_id=2506
>
> The screen-shot can be found on http://maxiangjiang.googlepages.com/vim_ime.gif
>
> For years, I have been dreaming of an independent IME to input Chinese
> from within vim. After all, vim is a text editor, which should be able
> to type in any language including CJK.  It is a pain to configure and
> use the supported |+multi_byte_ime| API, which is dependent on
> binaries outside of vim.
>
> As a backgrounds to those who never used CJK, the IME is a big
> business in Asian countries. The basic idea is how to input ten-
> thousands of characters comfortably using English keyboard.
>
> Now, I hope vim can jump the boat comfortably.
>
> Thanks
>
> Sean

Interesting.

The "data file" http://maxiangjiang.googlepages.com/ChineseIME.dict 
doesn't seem to be in the "key, space, hanzi" format described in the
ChineseIME.vim plugin.

Maybe someday (if I come around to it) I'll try to build a datafile by
Kangxi (or similar) radicals and strokes, for people who can "see" hanzi
and maybe even "understand" them but not "say" them. I might even
already have the needed data in a different format somewhere on this
computer.


Best regards,
Tony.
--
Leibowitz's Rule:
        When hammering a nail, you will never hit your finger if you
hold the hammer with both hands.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2
In reply to this post by Sean-130

On 2009-01-04, Sean wrote:

>
> Hi,
>
> I just uploaded a script used as an IME (Input Method Editor) for
> typing Chinese as an example:
> http://vim.sourceforge.net/scripts/script.php?script_id=2506
>
> The screen-shot can be found on http://maxiangjiang.googlepages.com/vim_ime.gif
>
> For years, I have been dreaming of an independent IME to input Chinese
> from within vim. After all, vim is a text editor, which should be able
> to type in any language including CJK.  It is a pain to configure and
> use the supported |+multi_byte_ime| API, which is dependent on
> binaries outside of vim.
>
> As a backgrounds to those who never used CJK, the IME is a big
> business in Asian countries. The basic idea is how to input ten-
> thousands of characters comfortably using English keyboard.
>
> Now, I hope vim can jump the boat comfortably.

Very interesting! But the speed is too slow and, if the word preceded is a
Chinese, then it will make vim hang, so when I tried to

imap <space> <C-x><C-u><C-u><C-p><C-n>

it will make vim hang. :(

Anyway, it's a good start.

>
> Thanks
>
> Sean
>
> >
>


--
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Sean-130
In reply to this post by Tony Mechelynck

The data file is valid. I just downloaded it and these are the first
three lines:

a                   啊
a                   阿
a                   呵

The data file is in utf8 encoding. In order to read Chinese using vim,
I have the following settings on my .vimrc:

      set enc=utf8
      set gfn=Courier_New:h12:w7
      set gfw=SimSun-18030,Arial_Unicode_MS

Yes, you are free to make your own data file. Actually, hundreds if
not thousands of "patents" were created on how to define the <key>
part of the mapping, among other things.

Welcome to the vim world of IME :))

Sean



On Jan 3, 8:10 pm, Tony Mechelynck <[hidden email]>
wrote:

> On 04/01/09 04:12, Sean wrote:
>
>
>
> > Hi,
>
> > I just uploaded a script used as an IME (Input Method Editor) for
> > typing Chinese as an example:
> >http://vim.sourceforge.net/scripts/script.php?script_id=2506
>
> > The screen-shot can be found onhttp://maxiangjiang.googlepages.com/vim_ime.gif
>
> > For years, I have been dreaming of an independent IME to input Chinese
> > from within vim. After all, vim is a text editor, which should be able
> > to type in any language including CJK.  It is a pain to configure and
> > use the supported |+multi_byte_ime| API, which is dependent on
> > binaries outside of vim.
>
> > As a backgrounds to those who never used CJK, the IME is a big
> > business in Asian countries. The basic idea is how to input ten-
> > thousands of characters comfortably using English keyboard.
>
> > Now, I hope vim can jump the boat comfortably.
>
> > Thanks
>
> > Sean
>
> Interesting.
>
> The "data file"http://maxiangjiang.googlepages.com/ChineseIME.dict
> doesn't seem to be in the "key, space, hanzi" format described in the
> ChineseIME.vim plugin.
>
> Maybe someday (if I come around to it) I'll try to build a datafile by
> Kangxi (or similar) radicals and strokes, for people who can "see" hanzi
> and maybe even "understand" them but not "say" them. I might even
> already have the needed data in a different format somewhere on this
> computer.
>
> Best regards,
> Tony.
> --
> Leibowitz's Rule:
>         When hammering a nail, you will never hit your finger if you
> hold the hammer with both hands.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2
In reply to this post by anhnmncb-2

On 2009-01-04, anhnmncb wrote:

>
> On 2009-01-04, Sean wrote:
>>
>> Hi,
>>
>> I just uploaded a script used as an IME (Input Method Editor) for
>> typing Chinese as an example:
>> http://vim.sourceforge.net/scripts/script.php?script_id=2506
>>
>> The screen-shot can be found on http://maxiangjiang.googlepages.com/vim_ime.gif
>>
>> For years, I have been dreaming of an independent IME to input Chinese
>> from within vim. After all, vim is a text editor, which should be able
>> to type in any language including CJK.  It is a pain to configure and
>> use the supported |+multi_byte_ime| API, which is dependent on
>> binaries outside of vim.
>>
>> As a backgrounds to those who never used CJK, the IME is a big
>> business in Asian countries. The basic idea is how to input ten-
>> thousands of characters comfortably using English keyboard.
>>
>> Now, I hope vim can jump the boat comfortably.
>
> Very interesting! But the speed is too slow and, if the word preceded is a
> Chinese, then it will make vim hang, so when I tried to
>
> imap <space> <C-x><C-u><C-u><C-p><C-n>
>
> it will make vim hang. :(
>
> Anyway, it's a good start.

And I find punctation symbol can't be put in the data file to input Chinese
punctation, in that case vim will hang.

>
>>
>> Thanks
>>
>> Sean
>>
>> >
>>
>
>


--
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

bill lam
In reply to this post by Tony Mechelynck

On Sun, 04 Jan 2009, Tony Mechelynck wrote:
> Maybe someday (if I come around to it) I'll try to build a datafile by
> Kangxi (or similar) radicals and strokes, for people who can "see" hanzi
> and maybe even "understand" them but not "say" them. I might even
> already have the needed data in a different format somewhere on this
> computer.

If you are interested I can send you the source file that radical for
traditional chinese in (about 30000 characters).

I didn't use this plugin, but I guess it should limit the characters
displayed in popup box in order to be useful.  Anyway, for beginners,
it is easier to just input the first and the last radical only, and
let it display a list of characters to chose from. If it can accept
exactly two keystroke before calling up the popup box, there should be
no speed penalty.

--
regards,
====================================================
GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
唐詩163 馬戴  楚江懷古
    露氣寒光集  微陽下楚丘  猿啼洞庭樹  人在木蘭舟
    廣澤生明月  蒼山夾亂流  雲中君不見  竟夕自悲秋

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

panshizhu
In reply to this post by Sean-130

Sean 写道:
> Yes, you are free to make your own data file. Actually, hundreds if
> not thousands of "patents" were created on how to define the <key>
> part of the mapping, among other things.
>
> Welcome to the vim world of IME :))

For patents... It seems that the name IME is proprietary for Microsoft.
That might be the reason most input methods in the Linux world are named
IM or XIM, they never has a name IME.

I suspect you may have to change the name 'IME' into something else for
the legal reason. Anyway, 'Input Method Editor' isn't the best
description for your masterpiece, 'Input Method Inside an Editor' is,
probably IMIE is a better name.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Sean-130
In reply to this post by anhnmncb-2


I am interested in how to improve performance, which seems not the
issue for me, though.

These are my computing environments:

laptop: HP MODEL nc6320
OS: Windows XP
CPU: 1.66GHz
RAM: 2GB

Also, the gvim.exe Memory Usage is less than 7MB with or without my
plugin.

My own data file is over 32K lines, and the Chinese shows up within
one second after I type ma<C-I>, as shown on my screenshot.  If I
typed <C-I> on empty space, I did find it is kind of "hanging" and I
had to type <C-C> to stop it. However, it makes little sense to type
<C-I> over empty space.

I also tried to sort the data file every time after I do update, but
it makes no difference in performance to me.

It would be interesting to know if it makes difference if you cut the
sample data file by half?

By the way, I disabled the standard $VIMRUNTIME/plugin directory.

Thanks

Sean




On Jan 3, 8:31 pm, anhnmncb <[hidden email]> wrote:

> On 2009-01-04, Sean wrote:
>
> > Hi,
>
> > I just uploaded a script used as an IME (Input Method Editor) for
> > typing Chinese as an example:
> >http://vim.sourceforge.net/scripts/script.php?script_id=2506
>
> > The screen-shot can be found onhttp://maxiangjiang.googlepages.com/vim_ime.gif
>
> > For years, I have been dreaming of an independent IME to input Chinese
> > from within vim. After all, vim is a text editor, which should be able
> > to type in any language including CJK.  It is a pain to configure and
> > use the supported |+multi_byte_ime| API, which is dependent on
> > binaries outside of vim.
>
> > As a backgrounds to those who never used CJK, the IME is a big
> > business in Asian countries. The basic idea is how to input ten-
> > thousands of characters comfortably using English keyboard.
>
> > Now, I hope vim can jump the boat comfortably.
>
> Very interesting! But the speed is too slow and, if the word preceded is a
> Chinese, then it will make vim hang, so when I tried to
>
> imap <space> <C-x><C-u><C-u><C-p><C-n>
>
> it will make vim hang. :(
>
> Anyway, it's a good start.
>
>
>
> > Thanks
>
> > Sean
>
> --
> Regards,
> anhnmncb
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Tony Mechelynck
In reply to this post by bill lam

On 04/01/09 05:49, bill lam wrote:
> On Sun, 04 Jan 2009, Tony Mechelynck wrote:
>> Maybe someday (if I come around to it) I'll try to build a datafile by
>> Kangxi (or similar) radicals and strokes, for people who can "see" hanzi
>> and maybe even "understand" them but not "say" them. I might even
>> already have the needed data in a different format somewhere on this
>> computer.
>
> If you are interested I can send you the source file that radical for
> traditional chinese in (about 30000 characters).

Yes, why not? The Unihan database is more like 30 _million_ characters,
but of course it includes a lot of info that would be superfluous in
this case.

>
> I didn't use this plugin, but I guess it should limit the characters
> displayed in popup box in order to be useful.  Anyway, for beginners,
> it is easier to just input the first and the last radical only, and
> let it display a list of characters to chose from. If it can accept
> exactly two keystroke before calling up the popup box, there should be
> no speed penalty.
>

OTOH, it might be advantageous to modify the plugin to take advantage of
Vim's ability to display a comment next to each completion (for
instance, depending on the data source, a translation or a reading for
the hanzi in question).


Best regards,
Tony.
--
Underlying Principle of Socio-Genetics:
        Superiority is recessive.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Tony Mechelynck
In reply to this post by anhnmncb-2

On 04/01/09 05:41, anhnmncb wrote:
[...]
> And I find punctation symbol can't be put in the data file to input Chinese
> punctation, in that case vim will hang.
[...]

You could create a keymap for CJK punctuation, or even just use
|i_CTRL-V_digit| -- most of them are in the block starting at U+3000
after all.

Best regards,
Tony.
--
"... an experienced, industrious, ambitious, and often quite often
picturesque liar."
                -- Mark Twain

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2
In reply to this post by Sean-130

On 2009-01-04, Sean wrote:

>
>
> I am interested in how to improve performance, which seems not the
> issue for me, though.
>
> These are my computing environments:
>
> laptop: HP MODEL nc6320
> OS: Windows XP
> CPU: 1.66GHz
> RAM: 2GB

Please don't top post.
windows 2000, centrino 1.66GHz and 768 RAM here.

>
> Also, the gvim.exe Memory Usage is less than 7MB with or without my
> plugin.
>
> My own data file is over 32K lines, and the Chinese shows up within
> one second after I type ma<C-I>, as shown on my screenshot.  If I

hey, one second is too long, and if the candidate list needs to take 0.5s to
pop up, then the max speed of input per minute will just 120/s, too slow!

> typed <C-I> on empty space, I did find it is kind of "hanging" and I
> had to type <C-C> to stop it. However, it makes little sense to type
><C-I> over empty space.

But hitting <space> to input hanzi is more quick and convenient than <C-i>.

>
> I also tried to sort the data file every time after I do update, but
> it makes no difference in performance to me.
>
> It would be interesting to know if it makes difference if you cut the
> sample data file by half?

My data file is for cangjie input method, and has 30790 lines long, I don't
think it's a big data file for IM.

>
> By the way, I disabled the standard $VIMRUNTIME/plugin directory.
>
> Thanks
>
> Sean


--
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2
In reply to this post by Tony Mechelynck

On 2009-01-04, Tony Mechelynck wrote:

>
> On 04/01/09 05:41, anhnmncb wrote:
> [...]
>> And I find punctation symbol can't be put in the data file to input Chinese
>> punctation, in that case vim will hang.
> [...]
>
> You could create a keymap for CJK punctuation, or even just use
>|i_CTRL-V_digit| -- most of them are in the block starting at U+3000
> after all.

Yes, but this is vim's way, it's not an IM's way.

--
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Tony Mechelynck
In reply to this post by anhnmncb-2

On 04/01/09 07:20, anhnmncb wrote:

> On 2009-01-04, Sean wrote:
>>
>> I am interested in how to improve performance, which seems not the
>> issue for me, though.
>>
>> These are my computing environments:
>>
>> laptop: HP MODEL nc6320
>> OS: Windows XP
>> CPU: 1.66GHz
>> RAM: 2GB
>
> Please don't top post.
> windows 2000, centrino 1.66GHz and 768 RAM here.
>
>> Also, the gvim.exe Memory Usage is less than 7MB with or without my
>> plugin.
>>
>> My own data file is over 32K lines, and the Chinese shows up within
>> one second after I type ma<C-I>, as shown on my screenshot.  If I
>
> hey, one second is too long, and if the candidate list needs to take 0.5s to
> pop up, then the max speed of input per minute will just 120/s, too slow!
>
>> typed<C-I>  on empty space, I did find it is kind of "hanging" and I
>> had to type<C-C>  to stop it. However, it makes little sense to type
>> <C-I>  over empty space.
>
> But hitting<space>  to input hanzi is more quick and convenient than<C-i>.

Ctrl-I and Tab are synonymous to Vim anyway.

>
>> I also tried to sort the data file every time after I do update, but
>> it makes no difference in performance to me.
>>
>> It would be interesting to know if it makes difference if you cut the
>> sample data file by half?
>
> My data file is for cangjie input method, and has 30790 lines long, I don't
> think it's a big data file for IM.
>
>> By the way, I disabled the standard $VIMRUNTIME/plugin directory.
>>
>> Thanks
>>
>> Sean
>
>

Best regards,
Tony.
--
        THE WOMBAT

The wombat lives across the seas,
Among the far Antipodes.
He may exist on nuts and berries,
Or then again, on missionaries;
His distant habitat precludes
Conclusive knowledge of his moods.
But I would not engage the wombat
In any form of mortal combat.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

panshizhu
In reply to this post by Sean-130

Sean 写道:

> I am interested in how to improve performance, which seems not the
> issue for me, though.
>
> These are my computing environments:
>
> laptop: HP MODEL nc6320
> OS: Windows XP
> CPU: 1.66GHz
> RAM: 2GB
>
> Also, the gvim.exe Memory Usage is less than 7MB with or without my
> plugin.
>
> My own data file is over 32K lines, and the Chinese shows up within
> one second after I type ma<C-I>, as shown on my screen shot.  If I
> typed <C-I> on empty space, I did find it is kind of "hanging" and I
> had to type <C-C> to stop it. However, it makes little sense to type
> <C-I> over empty space.
<C-I> does not work for me and I have to use <C-X><C-U> to work, I don't
see you mapping <C-I> to anything I suspect you mapped it in your .vimrc?

It make sense to type over empty space since that may be an extra
keystroke. i.e. you typed 马,then press your <C-I> after 马。

The performance is low compared to most existing input methods, the
performance does improve when I truncate the dict file, however, in
practical the dict file would be only larger than the sample, not smaller.

After all, any use-case this can be used for a full sentence? I consider
the following:
1. cannot use space for completion, which is very common in IMEs.
2. cannot use number keys for selection, e.g. when there's multiple
selections there is no way to select the 3rd quickly.
3. completion window does not pop-up when typing, must type<C-I> which
means we don't know whether a word is available and we don't know an
error when typing.
4. cannot match the first characters if the whole word missing: type
woyao<C-I> and nothing happens, we expect 'wo' can be matched and show
我, since the problem here is woyao not recorded as vocabulary.

At the current stage, the ease of use is low, and if we rely on vim's
built-in completion things cannot be easily improved.


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Sean-130
In reply to this post by Tony Mechelynck

An updated version is uploaded on http://vim.sourceforge.net/scripts/script.php?script_id=2506
with the following three improvement:

(1) fix completion hanging after starting from non-word characters
(2) add pumheight=10 to limit the height of popup menu
(3) add two entries on data file for testing datafile:
       (3.1) english<C-^> should show Chinese translation for
"English"
       (3.2) chinese<C-^> should show Chiense translation for
"Chinese"

Sean
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

Sean-130
In reply to this post by panshizhu


> 1. cannot use space for completion, which is very common in IMEs.

If you want, you can map <space> as
imap  <Space>  <C-X><C-U><C-U><C-P><C-N>

A problem in general is that input is kind of mixture of Chinese and
English. It is a good idea if we want to make it as a fully-fledged
IME. In such a case, another plugin, "Automatically open the popup
menu for completion" from Takeshi can be used together. It is
available on http://www.vim.org/scripts/script.php?script_id=1879

> 2. cannot use number keys for selection, e.g. when there's multiple
> selections there is no way to select the 3rd quickly.

This is a limitation of vim omni completion feature. I am not sure if
Bram also thinks it is a limitation or not.

> 3. completion window does not pop-up when typing, must type<C-I> which
> means we don't know whether a word is available and we don't know an
> error when typing.

This is an advanced feature, and it is available on another plugin
mentioned above.

> 4. cannot match the first characters if the whole word missing: type
> woyao<C-I> and nothing happens, we expect 'wo' can be matched and show
> 我, since the problem here is woyao not recorded as vocabulary.

Yes, it depends on the data file. For demonstration purpose, I updated
a new version of data file including woyao as the <key>. Therefore,
you can type woyan<C-^> now.

The feature you mentioned here seems like "associate" (联想), which is
not available for vim omni completion.

Anyway, the best part of an independent vim IME like my script is that
the data file is under control. For example, my own data file is a
mixture of PinYin and English, which suits my own backgrounds.

By the way, <C-^> is used in the script now, as it is consistent with
the original meaning of i_<C-^> in vim.

Sean



On Jan 3, 10:37 pm, pansz <[hidden email]> wrote:

> Sean 写道:
>
> > I am interested in how to improve performance, which seems not the
> > issue for me, though.
>
> > These are my computing environments:
>
> > laptop: HP MODEL nc6320
> > OS: Windows XP
> > CPU: 1.66GHz
> > RAM: 2GB
>
> > Also, the gvim.exe Memory Usage is less than 7MB with or without my
> > plugin.
>
> > My own data file is over 32K lines, and the Chinese shows up within
> > one second after I type ma<C-I>, as shown on my screen shot.  If I
> > typed <C-I> on empty space, I did find it is kind of "hanging" and I
> > had to type <C-C> to stop it. However, it makes little sense to type
> > <C-I> over empty space.
>
> <C-I> does not work for me and I have to use <C-X><C-U> to work, I don't
> see you mapping <C-I> to anything I suspect you mapped it in your .vimrc?
>
> It make sense to type over empty space since that may be an extra
> keystroke. i.e. you typed 马,then press your <C-I> after 马。
>
> The performance is low compared to most existing input methods, the
> performance does improve when I truncate the dict file, however, in
> practical the dict file would be only larger than the sample, not smaller.
>
> After all, any use-case this can be used for a full sentence? I consider
> the following:
> 1. cannot use space for completion, which is very common in IMEs.
> 2. cannot use number keys for selection, e.g. when there's multiple
> selections there is no way to select the 3rd quickly.
> 3. completion window does not pop-up when typing, must type<C-I> which
> means we don't know whether a word is available and we don't know an
> error when typing.
> 4. cannot match the first characters if the whole word missing: type
> woyao<C-I> and nothing happens, we expect 'wo' can be matched and show
> 我, since the problem here is woyao not recorded as vocabulary.
>
> At the current stage, the ease of use is low, and if we rely on vim's
> built-in completion things cannot be easily improved.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2

Hi Sean, I think the first thing need to be done is to improve the speed of
completion, I can't live if I have typed 10 hanzis in 5s, and need to wait 8s
for vim to complete them.

--
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

panshizhu
In reply to this post by Sean-130

Sean 写道:
>
>> 1. cannot use space for completion, which is very common in IMEs.
>
> If you want, you can map <space> as
> imap  <Space>  <C-X><C-U><C-U><C-P><C-N>
Well, it works, but we will be unable to type the space character at
all. For <space> to work we may need a "mode" then, simple ascii insert
mode and complex character input mode.


>> 4. cannot match the first characters if the whole word missing: type
>> woyao<C-I> and nothing happens, we expect 'wo' can be matched and show
>> 我, since the problem here is woyao not recorded as vocabulary.
> The feature you mentioned here seems like "associate" (联想), which is
> not available for vim omni completion.

What I meant is not "associate" 联想, it is (say) part-completion:

for example: suppose we have the following in the dict:
aaa   阿
aaa   啊
bbb   波
bbb   播

but we don't have the vocabulary: aaabbb.

Then how can I complete when I type: aaabbb? Typical IM should try to
complete something as possible, so when we press <space> it tries to
complete aaa as 阿 and/or open the selection menu for aaa, leaving bbb
behind, then if we press <space> again, it will try to complete bbb to
波 and/or open the selection menu for bbb.

This is also useful even if we had an item in the dict and we want other
combinations:

aaabbb  阿波

now if we type aaabbb and want it to complete to 啊播,how? when we
press the first <space> we should get a menu which list 阿波 as the
first item and 阿 and 啊 as the second, third item。if we selected 阿波
then everything finished, if we selected 啊, then we will got the menu
for the next character which shows 波 and 播。



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2

On Sun, 04 Jan 2009 16:09:41 +0800, pansz <[hidden email]> wrote:

>
> Sean 写道:
>>
>>> 1. cannot use space for completion, which is very common in IMEs.
>>
>> If you want, you can map <space> as
>> imap  <Space>  <C-X><C-U><C-U><C-P><C-N>
> Well, it works, but we will be unable to type the space character at
> all. For <space> to work we may need a "mode" then, simple ascii insert
> mode and complex character input mode.

I use these lines for toggle im:

let s:ywim = 0
function YW_IMtoggle()
     if s:ywim == 0
         imap <space> <C-x><C-u><C-u><C-p><C-n>
         let s:ywim = 1
     elseif s:ywim == 1
         iunmap <space>
         let s:ywim = 0
     endif
endfunction

imap <C-\> <C-o>:call YW_IMtoggle()<CR>

>
>
>>> 4. cannot match the first characters if the whole word missing: type
>>> woyao<C-I> and nothing happens, we expect 'wo' can be matched and show
>>> 我, since the problem here is woyao not recorded as vocabulary.
>> The feature you mentioned here seems like "associate" (联想), which is
>> not available for vim omni completion.
>
> What I meant is not "associate" 联想, it is (say) part-completion:
>
> for example: suppose we have the following in the dict:
> aaa   阿
> aaa   啊
> bbb   波
> bbb   播
>
> but we don't have the vocabulary: aaabbb.
>
> Then how can I complete when I type: aaabbb? Typical IM should try to
> complete something as possible, so when we press <space> it tries to
> complete aaa as 阿 and/or open the selection menu for aaa, leaving bbb
> behind, then if we press <space> again, it will try to complete bbb to
> 波 and/or open the selection menu for bbb.
>
> This is also useful even if we had an item in the dict and we want other
> combinations:
>
> aaabbb  阿波
>
> now if we type aaabbb and want it to complete to 啊播,how? when we
> press the first <space> we should get a menu which list 阿波 as the
> first item and 阿 and 啊 as the second, third item。if we selected 阿波
> then everything finished, if we selected 啊, then we will got the menu
> for the next character which shows 波 and 播。
>
>
>
> >
>



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: an independent Chinese IME is available

anhnmncb-2
In reply to this post by Sean-130

These lines in your script change the vim options globally, I don't think it's
a good way.

    set completeopt=menu,preview,longest
    set pumheight=10

    set completefunc=ChineseIME

And why not add a advice for imap in vimscript.org instead of writing it in your
plugin?

    imap  <C-^>  <C-X><C-U><C-U><C-P><C-N>

--
Regards,
anhnmncb


--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

1234