Skip to main content

yet another tool to help you read text in Japanese video games

Project description

zōritori 草履取り

yet another tool to help Japanese language learners read text in video games

features

  • annotate kanji with furigana
  • color code proper nouns (like NHK News Web Easy)
  • look up words on mouse hover, or open Jisho or Wikipedia
  • automatically collect vocabulary with context
  • (optional) English subtitles via machine translation

Taiko Risshiden V

This is a work in progress and is rough around the edges.

requirements:

  • Windows, Linux, or Mac (tested on Windows 10, Ubuntu 22.04, and macOS Montery)
  • Python 3.10.x (tested with 3.10.9)
  • either Tesseract or a Google Cloud Vision API account
  • (optional) DeepL API account for machine translated subtitles
  • (Linux only) scrot, python3-tk, python3-dev. X11 only for now, Wayland may not work

installation:

on Windows, the following worked:

  • install Python 3.10.x
  • install zoritori via pip (optionally via pipx)

on Mac and Linux, I ran into numerous issues installing via pip/pipx, so for now use the development process:

  • install Python 3.10.9 (recommended via pyenv)
  • install Poetry
  • clone this repo
  • install dependencies via poetry install
  • when running zoritori, use poetry run python -m zoritori ... (see below for command line args)

for all platforms:

  • download the example config file from here
  • if using Tesseract, follow these instructions to install it, then configure it by specifying the path to the tesseract binary in config.ini
  • if using Google Cloud Vision, follow these steps to create a project and download a credentials JSON file. then add that as an environment variable. Windows: $env:GOOGLE_APPLICATION_CREDENTIALS="C:\path\to\json", Mac/Linux: export GOOGLE_APPLICATION_CREDENTIALS=/path/to/json

usage

  • start: zoritori -e <tesseract|google> -c /path/to/config.ini
  • an invisible window (with title "zoritori") should appear. make sure this window has focus
  • identify the region of the screen containing text you want to read
  • using your mouse, (left) click and drag a rectangle around the text
  • after a moment, you should see furigana over any kanji in the region, and proper nouns highlighted (blue, orange, and green boxes). hovering over words inside the region should display a dictionary result, if one is found

keyboard shortcuts

key Description
T toggle translation
C manual refresh
J open Jisho search for word under cursor
W open Japanese Wikipedia search for word under cursor
E open English Wikipedia search for word under cursor
R + mouse-drag select main region when in click through mode
Q + mouse-drag select one time lookup when in click through mode

more options/etc

secondary clipping

After selecting a region, zoritori will watch that area for changes, and refresh if any are detected. If you want to select a new region, just click and drag again. If you want to keep your original region, but want to do a one-time look up a word outside the region, right click and drag around the word.

click through mode

By default, the transparent overlay won't send clicks through to underlying applications, including your game. It will steal focus if you click anywhere on the screen. On Windows only (for now) you can enable click through mode in the config.ini file or command-line parameters. On Mac and Linux, this is not supported at the moment.

When click through mode is enabled, use R (without mouse clicking) to drag select a region, and use Q to select a region for a one-time lookup.

comparing OCR engines

Tesseract is free, open source, and works offline. Unfortunately, in my experience it has less accurate recognition, and sometimes returns very messy bounding box data, making it difficult to accurately place furigana.

Google Cloud Vision has per usage costs, but should be free for low usage, and is closed source and requires an Internet connection (the selected region is sent as an image to Google for processing)

saving vocabulary

By default nothing is saved. But if you want to save vocabulary words, add a folder name in the config.ini file or command-line parameters.

With only NotesFolder set, all vocabulary will be saved in one folder. Fullscreen screenshots are saved each time OCR runs, along with a markdown file that include new vocabulary found, for later review.

With only NotesRoot set, vocabulary will be saved as above but inside individual folders for each session (once for each time you start zoritori) to make review less cumbersome.

With both NotesFolder and NotesRoot set, NotesFolder behavior takes precedence (everything saved in one folder).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zoritori-0.0.2.post1.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zoritori-0.0.2.post1-py3-none-any.whl (28.2 kB view details)

Uploaded Python 3

File details

Details for the file zoritori-0.0.2.post1.tar.gz.

File metadata

  • Download URL: zoritori-0.0.2.post1.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-56-generic

File hashes

Hashes for zoritori-0.0.2.post1.tar.gz
Algorithm Hash digest
SHA256 32eb9b6c52ef7f984c1feb49620fd45c3db13f5672ebfb9502df21e06e77809c
MD5 4a812f1bbf84668607be78977105a071
BLAKE2b-256 1ae6932d0f47e4b5e789ead52fac5d4b79bcebdaf883e38a501569377882ce82

See more details on using hashes here.

File details

Details for the file zoritori-0.0.2.post1-py3-none-any.whl.

File metadata

  • Download URL: zoritori-0.0.2.post1-py3-none-any.whl
  • Upload date:
  • Size: 28.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.10.6 Linux/5.15.0-56-generic

File hashes

Hashes for zoritori-0.0.2.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 49985f9aa624910fffacdf8f4c9a7ad031ebeaa93403aea24ef5a297b79e8c9d
MD5 8cf92dfe0c6f912e3026c21b46c9a02a
BLAKE2b-256 1e4614d1130da3c26838a0084b69776c9906b891714821124035df6298b1ac4e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page