Jump to content
Chinese-Forums
  • Sign Up

Intelligent switching of IMEs


roddy

Recommended Posts

2 hours ago, roddy said:

I know. It would be imperfect

 

I really had a lot to do today so I decided to play around with this instead and see how easy it is to detect what you are typing. 

 

I'm not sure if I'll have the time to really develop it too much but if there is a lot of interest I can try to make it into something because I think it's a cool idea (I'm also willing to give this over to someone smarter than me because this isn't really my area of expertise)

 

Anyway, here is a prototype, it definitely needs some tweaking because the Chinese sentence I chose was a very easy example I think. 

 

ChineseTyping.thumb.gif.59944529fe615c03e015e133595b1255.gif

 

4 hours ago, Dlezcano said:

This sounds interesting, how can I do that and under which operating systems?

Windows only because I'm not skilled enough to make anything cross platform. It works in Windows 10 and the default Chinese IME (which I use for English input and Chinese input), I haven't really tried to make anything else work. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

ChineseTyping.thumb.gif.f6b90f51a0a0c4d50aac5ee891e6b07d.gif

Yes the spaces make things easier. 

 

Not really a problem when typing in English or long Chinese phrases.

 

Right now it validates/checks for pinyin when you get to 6 characters (the longest pinyin) but clears it when space is pressed (so no validation), which is why it thinks it's English when I accept the char. But I guess it should validate when spaces is pressed. That way it won't switch you out of Chinese if you are accepting separate characters but might not . 

Link to comment
Share on other sites

23 minutes ago, markhavemann said:

Trying to type a capital letter during Chinese input would be an immediate indication that you are trying to type in English, wouldn't it? 

no, as there are many phrases that use capital letters on them, particularly in new phrases popularised on the internet.

 

eg 这个T恤很牛B,不过太TM的贵,下次再买?OK啦

Link to comment
Share on other sites

2 hours ago, markhavemann said:

Trying to type a capital letter during Chinese input would be an immediate indication that you are trying to type in English, wouldn't it?

Even if that worked, you'd end up with Pointless Capitals, which Is Much more annoying than having To press the Shift Key.

Which you would have to press anyway to get a capital letter in the first place. So it'd be the same amount of work for worse results.

Link to comment
Share on other sites

But you wouldn’t do it just to switch language. The software would just look out for it as a sign you’re typing English. 
 

I think the incidence of capitals letters is low enough in Chinese to not worry about. Remember, we don’t need perfection. 

  • Like 1
Link to comment
Share on other sites

After thinking a bit I realised that over-automating things could be a bad idea.

 

If it incorrectly automatically changes things too often it may waste more time than it saves, so I thought it might be smart to prompt you to change rather than decide for you. That way almost no validation is needed at all and, at least with typing pinyin, it can take advantage of their being no spaces. 

 

Switching between IME's is slow and also gets interrupted if you type anything too quickly after trying to switch, so quickly and automatically switching between English and Chinese doesn't seem like a great idea. 

 

The video below will basically buffer what you type, then if the text between spaces (and other non-typing keys) is long enough it will prompt you. 

 

Pressing control will remove what you've typed, switch input, then input what you've typed so far so that you can choose characters or keep typing in Chinese

ChineseTyping.thumb.gif.5d4911155654cdf4670699b8252e023a.gif

 

Not really important: 

One problem is that checking the status of the IME (pinyin or English) is slow and also sometimes will tell you that it's switch before it actually has. That means right now it's just waiting 1 second after trying to switch to pinyin, hoping it's switched, then blindly sending your input. There are probably more concrete ways of making sure of the input method but I'm not sure right now.

 

On my computer I only have one input language (Chinese) and the English input part of that is the default. Switching between actual languages/keyboards is even slower which is why I chose this way, but if you wanted to have separate languages/keyboard on the system, it might need to work slightly different with better checking.

Link to comment
Share on other sites

How often is it going to incorrectly automatically change the IME though? There are English words which can look like pinyin initially - re-gu-la-rly, I suppose. And English words that are plausibly pinyin - guide, women. 

Link to comment
Share on other sites

2 hours ago, roddy said:

How often is it going to incorrectly automatically change the IME though?

I think that detecting Chinese input when typing English would be pretty accurate. I've made some changes to what I've done and it does a pretty good job of switching over any time I type more than three syllables in Chinese without changing when I don't want it to. 

 

Preventing unnecessary changes when typing in Chinese might be more difficult. Spelling mistakes could make pinyin look like English words.

 

Another consideration is if you are using shortcuts and wbzd for something like 我不知道.

 

This wouldn't be detected as pinyin if you are typing English so it wouldn't switch to pinyin input. This probably wouldn't really be annoying since it's easy to retype, but if you are already in Chinese input, wbzd doesn't look like pinyin at all, so things like that could be a problem that would need some thought (checking words in an English dictionary? Seems like overkill though) 

 

Link to comment
Share on other sites

7 minutes ago, markhavemann said:

Another consideration is if you are using shortcuts and wbzd for something like 我不知道

 

I think I couldn't give up writing like that anymore. Even though doable, it seems it is harder to do than thought. Maybe the software could learn from our typing habits?

Link to comment
Share on other sites

6 minutes ago, Dlezcano said:

Maybe the software could learn from our typing habits?

That would be really cool but it sounds like a job for Google's engineers.

 

I think for like 1% of the effort you can get somewhere very close to that. Just have something that buffers what you type and with a shortcut key will switch IME's and input what you thought you were typing into the pinyin IME (basically what happened in the last GIF, but potentially even simpler) 

 

Then if you are hoping for 这事发生在放学后 and you type zsfczfangxueh (for example) and you look up only to realise you have zsfczfangxueh instead of characters, you press Ctrl+Win+Left (for example) and it automatically selects and deletes it, changes the IME then types it in for you. 

 

It seems like most of the frustration lies in this part, but something really similar would be possible with English in the Pinyin IME, maybe even letting you change between how many words back you want to retrieve from what you typed while in Chinese input. 

 

Something super complicated definitely sounds cool but I think with like 5 hours of work you could get something that does almost the same thing (just with a little user input) that a huge complex dictionary checking, typing habit learning thing would do. 

 

 

 

Link to comment
Share on other sites

19 hours ago, roddy said:

Remember, we don’t need perfection.

I think you do, or something very close to it, otherwise it would be incredibly annoying with the computer second-guessing you.

 

What are you guys doing that makes switching from Roman input to character input so time-consuming and 麻烦? For me, I literally just have to press the shift key and it instantly switches from 中文 to English and back. You'd need to build something really good to improve on that.

Link to comment
Share on other sites

1 hour ago, Lu said:

What are you guys doing that makes switching from Roman input to character input so time-consuming and 麻烦? For me, I literally just have to press the shift key and it instantly switches from 中文 to English and back.

 

My computer has cangjie, english and pinyin on a cycle. No matter what preferences I set, ms seems to always find a way to switch back to its 'intelligent' guessing of what system I want in what window. Even when the language bar symbol displays '倉' it will sometimes just suddenly switch to English when I start typing. Incredibly annoying. I want the pinyin input on my computer, but want it disabled in my ime list. This also seems impossible without uninstalling and reinstalling every time I want to use it. I do feel like multilingual support is still really bad in an age where the things computers are capable of is astounding.

 

Why cant I just have a dedicated key on my keyboard that switches me between two languages? I used to have a Samsung laptop a few years ago that had a big '中' key next to the right alt key, and it did precisely that. Now its gone I really miss it...

Link to comment
Share on other sites

1 hour ago, roddy said:

But I forget...

OK that I understand. Not a problem I have in this particular case, but I can relate.

 

37 minutes ago, Tomsima said:

No matter what preferences I set, ms seems to always find a way to switch back to its 'intelligent' guessing of what system I want in what window.

My computer does something like this too and I share your frustration. My previous computer didn't try to be smart and it said on the language bar what language it was set too, that was more convenient. I don't know enough about computers (and am not willing to spend enough time on this) to try to fix it.

Link to comment
Share on other sites

Join the conversation

You can post now and select your username and password later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Click here to reply. Select text to quote.

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...