zero-pinyin-service
zero-pinyin-service is a dbus service to provide pinyin input method service for zero-el pinyin input method. This allows doing arbitrarily complex things in C, while the elisp side code can be simple and efficient.
You can see the dbus service interface in ./com.emacsos.zero.ZeroPinyinService1.ZeroPinyinServiceInterface.xml
You can check zero-el document at https://blog.emacsos.com/zero-el.html
zero-pinyin-service requires a character/word table to get candidates for pinyin preedit string. It uses libpyzy’s openphrase db for this. zero-pinyin-service should know how to break pinyin and how to convert pinyin preedit string to Chinese character candidates, currently it also use libpyzy for this. So you can think of the current implementation as an adapter that makes libpyzy work with zero-el pinyin input method. This implementation is to get zero-el pinyin working with minimum effort. There are lots of improvements that can be done here.
how to build zero-pinyin-service
- Get meson build tool.
- Install zero-pinyin-service dependencies
sudo apt install libglib2.0-dev libsqlite3-dev uuid-dev
- Build zero-pinyin-service
git clone https://gitlab.emacsos.com/sylecn/libpyzy.git cd libpyzy/src/ # Side note: zero-pinyin-service must be in libpyzy src dir to build, because # it uses the source code directly. I didn't use libpyzy as a dependency # because I have done code review and patched the libpyzy code and those # changes are not sent to upstream. libpyzy is pretty inactive these days. git clone https://gitlab.emacsos.com/sylecn/zero-pinyin-service.git cd zero-pinyin-service/ meson setup release/ cd release && ninja
You can install it on local system via
cd release sudo ninja install
Or you can build a deb and install the deb instead.
- Create deb for zero-pinyin-service
Create deb requires fpm tool.
fpm --version
At project root dir,
./create-deb.sh
how to install meson
Read official doc for how to install it. The key commands are
apt install python3-pip
python3 -m pip install --user meson
# add ~/.local/bin to PATH
how to install fpm tool
Read official doc for how to install it. The key commands are
apt install ruby ruby-dev
gem install --user fpm
# add ruby gem bin dir to PATH
2019-08-31 ibus-pinyin user db inference notice.
zero-pinyin-service reuses ibus-pinyin’s userdb at ~/.cache/ibus/pinyin/user-1.0.db
This is generally not a problem. But if ibus-pinyin (libpyzy) changes their table schema in the future, zero-pinyin-service may require update.
zero-pinyin-service also stores user phrase in this db. So user phrases are shared between zero-pinyin and ibus-pinyin.
If you don’t use ibus-pinyin, this is not a problem for you. zero-pinyin-service works fine when ibus-pinyin is not installed.