Skip to content

Latest commit

 

History

History
373 lines (255 loc) · 9.94 KB

README.md

File metadata and controls

373 lines (255 loc) · 9.94 KB

GitHub Release F-Droid Version PyPI Version Python Versions CI Android Build AGPLv3+ Sponsor

Packaging status Packaging status

jiten

japanese android/cli/web dictionary based on jmdict/kanjidic

→ available online at jiten.dev

Get it from Fay's Repo Get it on F-Droid Get the APK from GitHub

Screenshots

app screenshot cli screenshot

Features

  • Fine-grained search using regexes (regular expressions)
    • simple searches don't require knowledge of regexes
    • quick reference available in the web interface and android app
  • JMDict multilingual japanese dictionary
    • kanji, readings (romaji optional), meanings & more
    • meanings in english, dutch, german, french and/or spanish
    • pitch accent (from Wadoku)
    • browse by frequency/jlpt
  • Kanji dictionary
  • Example sentences (from Tatoeba)
    • with english, dutch, german, french and/or spanish translation
    • some with audio
  • Stroke order
    • input a word or sentence and see how it's written

Interfaces

  • Android app
    • wraps the web interface (running locally on your device) in a webview
    • completely offline, no internet access required
    • easily share and open jiten.obfusk.dev links
  • Web interface
    • available online at https://jiten.obfusk.dev
    • light/dark mode
    • search history (stored locally)
    • tooltips to quickly see meanings and readings for kanji and words
    • use long press for tooltips on mobile
    • convert romaji to hiragana and between hiragana and katakana
    • can be run on your own computer
  • Command-line interface
  • WebView GUI
    • wraps the web interface (running locally on your computer)

CLI

JMDict

$ jiten -v jmdict --max 1 --word cat
$ jiten -v jmdict --max 1 --word kat --lang dut
$ jiten -v jmdict --max 1 --exact 誤魔化す

$ jiten -v jmdict +random         # random entry
$ jiten -v jmdict --prio +random  # random "priority" entry
$ jiten -v jmdict -n 4-5 +random  # random JLPT N4 or N5 entry

# convert romaji to hiragana & show romaji readings
$ jiten -v jmdict --max 1 --hiragana --romaji --word neko

# prefix commands: +k (katakana), +h (hiragana), +w (word) etc.
$ jiten -v jmdict --max 1 --romaji '+k +w ko-hi-'   # コーヒー

Kanji

$ jiten -v kanji --max 1 --word cat
$ jiten -v kanji --max 1 --exact cat
$ jiten -v kanji --max 1 --word 日

$ jiten -v kanji --max 1 '+r 犭艹田'    # search by radicals
$ jiten -v kanji --max 1 '+s 2-3-3'     # search by SKIP code

$ jiten radicals                        # show radicals table

Sentences

$ jiten -v sentences --max 1 kitten

Web Interface

$ jiten -v serve

Help

$ jiten --help
$ jiten jmdict    --help
$ jiten kanji     --help
$ jiten sentences --help

Tab Completion

NB: the syntax for the environment variable changed in click >= 8.0, use e.g. source_bash instead of bash_source for older versions.

For Bash, add this to ~/.bashrc:

eval "$(_JITEN_COMPLETE=bash_source jiten)"

For Zsh, add this to ~/.zshrc:

eval "$(_JITEN_COMPLETE=zsh_source jiten)"

For Fish, add this to ~/.config/fish/completions/jiten.fish:

eval (env _JITEN_COMPLETE=fish_source jiten)

WebView GUI for Linux/macOS/Windows

NB: requires pywebview.

$ jiten-gui

Bugs & Feature Requests

Issue Tracker

Questions & Feedback

Discussions

[email protected]

Installing

Debian

An official Debian package should be available soon.

You can also manually build a Debian package using the debian/sid branch, or download pre-built .debs via GitHub releases.

NixOS

An official package is also available in nixpkgs (un)stable.

Using pip

$ pip install jiten

NB: depending on your system you may need to use e.g. pip3 --user instead of just pip.

From git

NB: this installs the latest development version, not the latest release.

$ git clone https://github.com/obfusk/jiten.git
$ cd jiten
$ make
$ pip install -e .

NB: you may need to add e.g. ~/.local/bin to your $PATH in order to run jiten.

To update to the latest development version:

$ cd jiten
$ git pull --rebase
$ make

Dependencies

  • Python >= 3.8 + Flask + click + kanjidraw.
  • To build the SQLite PCRE C extension: a C compiler (e.g. gcc/clang) and the sqlite3 & pcre libraries & headers.
  • Basic build tools like make and patch.
  • To run the WebView GUI: pywebview >= 3.3.5.

Debian/Ubuntu

$ apt install python3-dev build-essential libsqlite3-dev libpcre3-dev
$ apt install python3-flask   # optional: Flask & click w/o pip

NB: currently, you'll need to install kanjidraw manually (i.e. using pip or from git).

Optional: WebView GUI

$ apt install python3-pyqt5.qtwebengine   # recommended: qtwebengine

$ apt install python3-webview             # if >= 3.3.5
$ pip3 --user install pywebview           # otherwise

Miscellaneous

Online Android App

There is also an online android app -- Jiten [Online] -- which essentially provides the same functionality as opening the https://jiten.obfusk.dev website in a web browser.

It does have some some small advantages (like long press for tooltips) and requires less storage space (and could be faster depending on your device and internet connection). You can install both at the same time if you want.

Web Interface on Android

You can also run the web interface locally (& offline) on your android phone. First, install termux, then run:

$ apt install clang python
$ pip install jiten

You can then run the web interface with:

$ jiten serve

and open http://localhost:5000 in your browser.

The web interface will keep running until you close termux or reboot.

Generating the DB

$ jiten setup

Forcing HTTPS

$ export JITEN_HTTPS=force

Forcing Domain Name

$ export JITEN_DOMAIN=jiten.obfusk.dev

License

Code

© FC Stegerman

AGPLv3+

JMDict & KanjiDic

© James William BREEN and The Electronic Dictionary Research and Development Group

CC-BY-SA

Wadoku (pitch)

© Ulrich Apel & Wadoku.de contributors

Non-commercial

Tatoeba (sentences & audio)

© Tatoeba contributors

CC-BY

Audio by huizi99, Mizu & yomi (CC BY-NC 4.0).

KanjiVG (radicals)

© Ulrich Apel

CC-BY-SA

Stroke Order Font

© Ulrich Apel, the AAAA project and the Wadoku project

BSD-3-Clause

JLPT Data

© Jonathan Waller

CC-BY

Kana Tables

© Wikipedia contributors

CC-BY-SA CC-BY-SA

Material Design Icons

© Google

Apache 2.0