Today, an interesting thing happened: sogou cloud input method.
Use
First, let's take a look at how to install and use:
Go to the homepage http://pinyin.sogou.com/cloud/. we can see the following introduction:
In fact, the figure is quite clear, if you look at it carefully :)
However, after two minutes, I can see what it means, so I will simply repeat the steps here:
- Click the things marked with red circles and save them as bookmarks.
- Click the bookmarks on the webpage to enter Chinese characters, and enter English letters.
In actual use, you will see this interface:
The results are good.
Hu Si
"Cloud" is now a very popular concept, so what is cloud input method?
I have briefly read the basic workflow of sogou cloud's input method and shared it with you. If there is something wrong, please point it out.
First, let's take a look at how to start it: Click bookmarks on the webpage.
This bookmark has an article. It is not a simple url, but a piece of js Code:
javascript:void((function(){var%20n=navigator.userAgent.toLowerCase();ie=n.indexOf('msie')!=-1?1:0;if(document.documentMode)ie=0;charset='';if(ie)charset=document.charset;src=ie&&charset=='utf-8'?'http://web.pinyin.sogou.com/web_ime/init2_utf8.php':'http://web.pinyin.sogou.com/web_ime/init2.php';element=document.createElement('script');element.setAttribute('src',src);document.body.appendChild(element);})())
The basic meaning of the code is to judge the browser type of the user, and then load a piece of php code to our page (createElement ).
At this time, we can see the sogou cloud Input Method interface.
Then, enter pinyin on the webpage.
Open httpfox, a plug-in listening to http requests on FireFox, and you can see this result:
As you can see, he first loads a php script and then interacts with each other in the form of Ajax: sends user input to the Server and receives the response, display the results to our users.
Then I looked at the corresponding content (http://web.pinyin.sogou.com/web_ime/get_ajax/nihao.key)
It is actually a URL encoded for the nihao input. But what I get after URL Decoding is garbled, so I guess there is a little bit of encryption algorithm in it. After all, php scripts have been obfuscated.
Imagination
When used, it is found that the corresponding speed is still very fast. To do this, I think a lot of Memcache should be used.
However, I have not found out whether he can record the personalized lexicon of different users based on the user's cookies. Maybe this is a future direction.
If you are interested, you must try it and enjoy a great experience.