-
Notifications
You must be signed in to change notification settings - Fork 1
Setting Up iBus
git clone --recursive https://github.com/jerinphilip/lemonade
apt-get install libglib2.0-dev libibus-1.0-dev # this is required.
Some provider is required to provide sgemm. There are several ways to achieve this, one option is given below:
sudo apt-get install libopenblas-dev
You may chose intel MKL or OneDNN alternatively. A recent cmake (>3.18) should detect and configure this correctly.
cmake -B build -S $PWD
cmake --build build --target all
cd build && sudo make install
The ibus-daemon scans /usr/share/component/ibus/
for engine xmls and loads it into its registry. Currently it seems to only read from the /usr/share/...
, hence the need for sudo to install. Other binaries etc will be installed in ../dist
and launched.
It's easier to use the python-module to download models etc required into your local machine. Prebuilt python wheels are available:
# Install `bergamot` CLI via pip.
python3 -m pip install bergamot -f https://github.com/jerinphilip/bergamot-translator/releases/expanded_assets/latest
# Download en-de-tiny and de-en-tiny models.
bergamot download -m en-de-tiny
bergamot download -m de-en-tiny
$ $ bergamot download
Getting inventory from https://translatelocally.com/models.json....Done.
Downloading and extracting cs-en-base into .../home/jerin/.local/share/lemonade/models/csen.student.base Done.
Downloading and extracting cs-en-tiny into .../home/jerin/.local/share/lemonade/models/csen.student.tiny11 Done.
Downloading and extracting en-cs-base into .../home/jerin/.local/share/lemonade/models/encs.student.base Done.
Downloading and extracting en-cs-tiny into .../home/jerin/.local/share/lemonade/models/encs.student.tiny11 Done.
Downloading and extracting en-de-base into .../home/jerin/.local/share/lemonade/models/ende.student.base Done.
Downloading and extracting en-de-tiny into .../home/jerin/.local/share/lemonade/models/ende.student.tiny11 Done.
Downloading and extracting es-en-tiny into .../home/jerin/.local/share/lemonade/models/esen.student.tiny11 Done.
Downloading and extracting en-es-tiny into .../home/jerin/.local/share/lemonade/models/enes.student.tiny11 Done.
Downloading and extracting et-en-tiny into .../home/jerin/.local/share/lemonade/models/eten.student.tiny11 Done.
Downloading and extracting en-et-tiny into .../home/jerin/.local/share/lemonade/models/enet.student.tiny11 Done.
Downloading and extracting is-en-tiny into .../home/jerin/.local/share/lemonade/models/isen.student.tiny11 Done.
Downloading and extracting nb-en-tiny into .../home/jerin/.local/share/lemonade/models/nben.student.tiny11 Done.
Downloading and extracting nn-en-tiny into .../home/jerin/.local/share/lemonade/models/nnen.student.tiny11 Done.
Downloading and extracting de-en-base into .../home/jerin/.local/share/lemonade/models/deen.student.base Done.
Downloading and extracting de-en-tiny into .../home/jerin/.local/share/lemonade/models/deen.student.tiny11 Done.
List available models:
$ bergamot ls
The following models are available:
1. cs-en-base Czech-English base
2. cs-en-tiny Czech-English tiny
3. en-cs-base English-Czech base
4. en-cs-tiny English-Czech tiny
5. en-de-base English-German base
6. en-de-tiny English-German tiny
7. es-en-tiny Spanish-English tiny
8. en-es-tiny English-Spanish tiny
9. et-en-tiny Estonian-English tiny
10. en-et-tiny English-Estonian tiny
11. is-en-tiny Icelandic-English tiny
12. nb-en-tiny Norwegian (Bokmal)-English tiny
13. nn-en-tiny Norwegian (Nynorsk)-English tiny
14. de-en-base German-English base
15. de-en-tiny German-English tiny
Run a local translation to check if any issues:
$ echo "Hello World." | bergamot translate -m en-de-tiny # translate from stdin
Hallo Welt.
Inorder for the integrated GNOME entries to be populated, I have often had to kill iBus and restart the daemon. Sometimes logging out of GNOME Session and starting again is required.
killall ibus-daemon
ibus-daemon -dRxv
- Go to Settings > Language and Region
- Search for "lemonade", add it among input sources. If you don't see this entry, try logging out of GNOME and back in again.
You can command line verify if ibus has loaded the engine correctly by looking for it
ibus read-cache | grep "lemonade"
If there's output in the XML it means IBUS integration is aware of lemonade engine.
- Now on the top-right in GNOME there'll be a drop-down allowing to choose from Input methods. Choose lemonade.
Use the UI on top-right corner in GNOME.
iBus logs are set to write at $HOME/.ibus-engine-lemonade.log
, which may have some useful information. The author checks for issues by using in translation component by using a test-executable.
./build/lemonade/test real < data/samples.txt
./build/lemonade/test fake < data/samples.txt
The above provide access to the translator / mock translator that is used by lemonade-engine during runtime.
sudo make install
killall ibus-daemon; # Kill existing,
ibus-daemon -dRxv; # respawn
# Choose from menu items again.