) Solve the problem after sunpinyin uses a large dictionary

Source: Internet
Author: User

Solemnly declare: This article is reposted by the author on the Internet. I have made some changes and the ownership belongs to the original author!

Link: http://blog.csdn.net/nick_wong/article/details/7728653

Principle:
The fcitx-sunpinyin dictionary is automatically loaded into the memory upon startup, and then linked back to the original directory for use. during use, the dictionary is regularly backed up and backed up again when shutdown.

Effect:
Before optimization, the use of fcitx-sunpinyin, with the original dictionary is not too obvious discomfort, but even if it is replaced with the nearly 85m dictionary, fuzzy, it is completely stuck!
After optimization, the fcitx-sunpinyin response speed is completely the speed of light ~!!

In this example, UBUNTU 10.04 and fcitx 4.0.1

Note:
  1. In the following method, change "linuxholobby" to your Logon account. Otherwise, an accident occurs!
2. This method also applies to ibus-sunpinyin

Implementation Method:
1. Download a more comprehensive and useful dictionary and decompress the downloaded dictionary ~ /. Sunpinyin Directory: http://code.google.com/p/hslinuxextra/downloads/list

If you want to increase the memory size, OK

2. Open the terminal and run the following command to back up the dictionary:

mv /home/linuxhobby/.sunpinyin/userdict /home/linuxhobby/.sunpinyin/userdict.newcp /home/linuxhobby/.sunpinyin/userdict.new /dev/shm/userdict

3. sudo gedit/etc/rc. Local: Add the following statement before "Exit 0" to automatically load the dictionary at startup.

cp /home/linuxhobby/.sunpinyin/userdict.new /dev/shm/userdictchmod 777 /dev/shm/userdictln -s -f /dev/shm/userdict /home/linuxhobby/.sunpinyin/

4. sudo gedit/etc/crontab to create an automatic backup task

"00 */1 **" indicates that the dictionary is backed up every hour. The value can be adjusted as needed.

00 */1 * * * user cp /dev/shm/userdict /home/linuxhobby/.sunpinyin/userdict.new

5. sudo gedit/etc/init. d/backup_sunpinyin to create a script for automatically backing up the dictionary after shutdown.

#! /bin/shcp /dev/shm/userdict /home/linuxhobby/.sunpinyin/userdict.new

6. Use the following command to set the automatic backup script

sudo chown root:root /etc/init.d/backup_sunpinyinsudo chmod 744 /etc/init.d/backup_sunpinyinsudo chmod +x /etc/init.d/backup_sunpinyinsudo ln -s /etc/init.d/backup_sunpinyin /etc/rc0.d/K99backup_sunpinyinsudo ln -s /etc/init.d/backup_sunpinyin /etc/rc6.d/K99backup_sunpinyin

7. Restart your computer and test the effect ~

sudo reboot

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.