running Jorkens on Linux

All about language programs, courses, websites and other learning resources
mcthulhu
Orange Belt
Posts: 228
Joined: Sun Feb 26, 2017 4:01 pm
Languages: English (native); strong reading skills - Russian, Spanish, French, Italian, German, Serbo-Croatian, Macedonian, Bulgarian, Slovene, Farsi; fair reading skills - Polish, Czech, Dutch, Esperanto, Portuguese; beginner/rusty - Swedish, Norwegian, Danish
x 590

running Jorkens on Linux

Postby mcthulhu » Sat May 15, 2021 9:34 pm

I'm still having problems building a binary for Linux, so I thought I'd post instructions on how to run it from source on Linux. I hope these are clear. I just tested this on a fresh install of Ubuntu 21.04 and it seems to work.

(python3 should be installed by default in Ubuntu, but you can type python3 to verify)

Code: Select all

sudo apt install python3-pip

(pip is not installed by default, no idea why)

Code: Select all

pip install stanza

(if this hangs (known pip/gnome-keyring bug on Ubuntu, apparently), adding "export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring" to your .bashrc seems to fix the problem).

Code: Select all

python3

and at the Python prompt, type

Code: Select all

import stanza

and then

Code: Select all

stanza.download('es')

(the es is the language code for Spanish; if you want a different language model, replace the language code)
(repeat as needed for however many languages you want supported)

type

Code: Select all

quit()
to exit Python

Code: Select all

sudo apt install npm


This should install both npm and node.js together; type npm --version and node --version to verify.

git should be installed by default in Ubuntu, but you can type git --version to verify.

Code: Select all

git clone https://github.com/mcthulhu/jorkens.git

(this downloads the source code from GitHub and puts it in a "jorkens" folder)

Code: Select all

cd jorkens

Code: Select all

rm package-lock.json


Code: Select all

npm i

(this will install all the dependencies listed in package.json; ignore the irrelevant error messages at the end about electron-builder)

Code: Select all

npm start


This last command is what runs Jorkens, and this is the only command needed to run it again later. After Jorkens opens, use File/Open file to open an epub book. In subsequent sessions, the last book opened should be resumed automatically.

You'll probably want to import a dictionary as one of your first steps, since local dictionary lookups are faster than the online ones. See the Wiki on GitHub for some tips on sources of dictionary data, and feel free to add other suggestions.
2 x

mokibao
Orange Belt
Posts: 123
Joined: Wed Mar 10, 2021 2:44 pm
Languages: Studying: way too many
x 314

Re: running Jorkens on Linux

Postby mokibao » Sat May 15, 2021 11:22 pm

Very cool, I didn't know jorkens could do offline dict lookups. Do you know how feasible it could be to also import audio/TTS renderings as well? Making an api call for each word lookup is not really usable for intensive reading imo, there is too much latency.
0 x

mcthulhu
Orange Belt
Posts: 228
Joined: Sun Feb 26, 2017 4:01 pm
Languages: English (native); strong reading skills - Russian, Spanish, French, Italian, German, Serbo-Croatian, Macedonian, Bulgarian, Slovene, Farsi; fair reading skills - Polish, Czech, Dutch, Esperanto, Portuguese; beginner/rusty - Swedish, Norwegian, Danish
x 590

Re: running Jorkens on Linux

Postby mcthulhu » Sat May 15, 2021 11:58 pm

Yes, the offline dictionary lookups are intended to be the primary ones. If a word isn't found locally, then I go to one of the online dictionaries, and depending on what I find I'll probably add that word to my local database for future use. Jorkens displays the size of the local dictionary at the bottom of the screen, so that will show "0" on the first run.

When you say API call, I assume you're referring to online dictionaries? The local SQLite database queries are very fast. (I was experimenting with showing definitions on hover, but the data was coming back way too fast as I moved across words on the page, so I'll have to figure out how to throttle it better. That's still on the to-do list.) The response time for the online lookups will probably vary by Web site, but WordReference searches seem to come back in a second or less. Or are you still talking about audio there? Forvo queries from Jorkens do seem to take longer.

I'm not sure what you mean by "import audio/TTS renderings." Storing audio clips in the dictionary database along with definitions? When TTS is available, it seems easier just to generate the audio again on demand.
1 x

mokibao
Orange Belt
Posts: 123
Joined: Wed Mar 10, 2021 2:44 pm
Languages: Studying: way too many
x 314

Re: running Jorkens on Linux

Postby mokibao » Sun May 16, 2021 1:35 am

Yeah, my primary focus was audio, since translation lookups are pretty much covered as you said. I was thinking of, like, having an option to generate and cache all TTS outputs for every word in a book, so it takes time at the beginning but then looking up a single word as you read is ultra-fast. If you share a database among all books from a given language you'd need fewer and fewer calls for each new book you load. Alternatively, you could just pre-download every word in an audio bank and hope it covers enough ground, but then it would probably be complicated to have it recognize inflected forms etc. I don't know how much hassle that'd represent and if it's worth it - I've tried to look for quality TTS engines or reasonably comprehensive word audio banks but it seems they all come at a premium, maybe I didn't look hard enough. The best I could find is something like Shootka, which is a wonderful initiative but woefully incomplete.
0 x


Return to “Language Programs and Resources”

Who is online

Users browsing this forum: themethod and 2 guests