Bookwards: A personal software project
Disclaimer: This post contains the exact same text that I've just published on Docker Hub and in my GitLab project. I'm publishing it on Journaly as well because it represents an update of my previous German post, where I wrote publicly about it for the first time. The post is quite technical and terse, but I hope you enjoy it nevertheless. Please bear in mind that the software project itself is still quite new and that I've mostly written it for my own language learning needs and ideas. Concretely, it's a very simple console application that works at its best under Linux. That's why I've decided to use Docker to distribute the software to those of you interested in trying it out. It works under Windows, macOS and Linux.
Introduction
This is a personal project. It consists of a computer program that I've written in order to learn, improve and maintain foreign languages. More concretely, it helps with the vocabulary of a language. Beyond the program itself, the Docker image edufuga/edwords contains my current vocabulary knowledge as well as some of my Journaly posts.
What can the program do?
The main purpose of the program is to improve your vocabulary of any language you care about by seeing and practising it in context. The context is provided by a text you want to read. There are two main functionalities: questioning and reading.
First of all, you use the "questioner" to enter your self-estimated knowledge of new words. This looks like the following screen recording.
Then, once you've entered a decent amount of vocabulary, you can read the book. That will look like this.
Evaluate the program (only for demonstration purposes)
By including my own vocabulary and writings in the Docker image, you can execute the program without taking care of any previous setup (other than having Docker). This way you can get a feel for the program. That said, please note that any changes in the vocabulary will be lost once the program is closed.
To start the console program, run the following command:
docker run --rm -it edufuga/edwords:latest
It should look similar to this screen recording, but with a different starting text. The starting text that I've chosen for demonstrating the program describes the program itself :). The text is in German and was originally posted here.
The colors of the text correspond to my current vocabulary knowledge of the corresponding language. Since I wrote the text myself, most of the words are shown in blue (i.e. actively known). Unknown words are shown in red, guessed words are orange, comprehended (understood, i.e. passively known) words are purple. Those words that I've considered as not belonging to the language itself, I've marked as ignored; they have a rose tone.
The program works by pressing single keys of the keyboard. If you're practising vocabulary with the questioner, then the keys I, U, G, C, K for "ignored", "unknown", "guessed", "comprehended" and "known" will be useful for telling the program your knowledge of every entered word. If you're reading a text, you can enter your word knowledge after pressing the E key, change the color mode with F, create connections between previously entered words using the R key, view the previously entered connections with K, navigate foward to a different line in the book by pressing L, show the current line number with S, mark the current screen position with M, return to the previously marked position with N, clear the screen with C and, finally, quit the program with Q.
Use the program productively (using your own vocabulary)
If you want to run the program with your own vocabulary, then run the following command:
docker run -v $WORDSFILES:/root/edwordsfiles --rm -it edufuga/edwords
Here I'm assuming that the environment variable WORDSFILES was set. In my case, I save the vocabulary files in the directory /Users/eduard/Develop/WordsFiles, so the previous command corresponds to the following alternative:
docker run -v /Users/eduard/Develop/WordsFiles:/root/edwordsfiles --rm -it edufuga/edwords
This way, the vocabulary in the path /root/edwordsfiles within the Docker container is replaced (shadowed) by the local folder saved as the value of the variable WORDSFILES. Now you're using my program with your own vocabulary, which is properly saved somewhere on your computer, so it won't be lost once you close the program.
Use the program more productively (using your own vocabulary and reading your own books)
Until now, the program has shown you one of my texts. Obviously, at some point you'll want to read something else. At least, I hope so. You can achieve that by mounting the plain text file you want to read into the Docker container and telling Docker where the book is found inside the container.
For example, in order to read a book about Docker with the program, using my locally saved vocabulary, I execute the following command:
docker run -v $WORDSFILES:/root/edwordsfiles -v $EBOOKS/DE/Docker\ -\ Bernd\ Öggl,\ Michael\ Kofler/book.txt:/root/DE/Docker/book.txt -e BOOK=/root/DE/Docker/book.txt --rm -it edufuga/edwords
The program expects the book to be a plain text file. Originally, I converted the .epub file to a .txt file using Calibre. I recommend you do the same for the books you want to read.
Like in the previous example, both WORDSFILES and EBOOKS are environment variables, pointing to the vocabulary and book folders, respectively. Additionally, the environment variable BOOK is used to tell Docker where the book file will be found. Obviously, this must correspond to the target of the volume mount (in this case, that's the path /root/DE/Docker/book.txt).
Tip: The program will import the book every time you start it, so depending on the book's length, that can take a moment. If you want to optimize that, then you should mount the directory /root/.bookwards to a local directory, following the same technique as before.
Hi Eduard,
it's nice to get an update of your program :) First of all: Congratulations on publishing it! This sounds much more accessible than first having to install the WSL and then being confronted with a console :D
Your instructions are very clear and I guess it would be easy using the program reading you instructions alongside.
Can't wait to see what else there'll be to come :) (GUI, GUI, GUI!!)
Hi Eduard!
This update sounds awesome! Congratulations! I might try it soon, but I currently don't have any ebook in a suitable format. I bought several books on wook.pt that are not downloadable at all. The only way to read them is using their web app or smartphone app 🙄 Maybe I can figure out how to download them or find them somewhere to import them into your program.
Caro: "This sounds much more accessible than first having to install the WSL and then being confronted with a console :D"
Uh... I'm sorry, but actually you do have to install the WSL first and then Docker (this is described online at the installation page for Docker under Windows: https://docs.docker.com/desktop/windows/install/). And in the end you are "confronted" with a console. That's what the program is (a console program), I'm afraid. But you are right: once you have the WSL and Docker, you don't need to install anything else (git for downloading the code of the program and java for building and running it), because that's taken care for by the Docker image (it contains the compiled program, which is started by executing the commands described in the text). In summary, all of this is admittedly not something for everyone, but it certainly is easier to use than it used to be.
I guess that I should describe in another text the necessary steps to install the program without Docker (this only works well with Linux and macOS) and another one for installing it under Android within the Termux app. In the end, that's how I use the program. It really just means having git and a JDK (java development kit), which are both really easy to install. And those instructions also work under the WSL in Windows (because it's just Linux).
Linda: thank you! I'd be really interested in your opinion and feedback :D. If both Caro and you say the current version of the program is completely useless/unusable for the normal computer user, then I'll start considering (again) how to change that in the future. Maybe a desktop GUI or a chat bot (for Telegram) or a mobile app (for Android) could be indeed an improvement.
Ups, haha. For a moment, I thought you didn't need the WSL with Docker 😅 And yes, it's a console program but I understood it that with Docker, you just need to install the program and you can use it. Without Docker, it's way more complicated to set up everything. That's what I meant with "being confronted with a console".
I don't think it's unusable or useless, just a bit difficult to set up if you're not used to it.
Yes, that's unfortunately true. The Docker setup under Windows is much more complicated that it is under Linux and macOS. Concretely, the WSL itself is a relatively new product from Micro$oft that requires enabling Virtualisation and several other steps described in the link I posted in the previous comment. Thankfully you have all of that already runnig :)
I just noticed: how does this post have anything to do with cats? Just because you're CATalan, you can't you the cat-tag for everything :D
Easter Egg wurde gefunden! Of course I can, Caro. The post has everything to do with CATs. It's a Console Application for Texts.
Eduard, no entiendo muy bien los detalles, pero te felicito y te deseo mucho éxito con tu proyecto!
Muchas gracias, CocoPop! Si tienes alguna pregunta concreta, ya sabes :). En principio simplemente es un programa para aprender vocabulario y leer documentos de texto (las palabras se colorizan según su nivel de conocimiento). El post describe como se "instala" el programa utilizando una tecnología llamada Docker. Admito que es un poco técnico para la comunidad de idiomas de Journaly. No sé si has mirado los vídeos de asciinema que he añadido, pero creo que con ellos se comprende mucho mejor de qué se trata el programa.
Edit: Creo recordar que tú tienes un iMac, no? En macOS es realmente muy fácil instalar Docker (https://docs.docker.com/desktop/mac/install/). Luego se inicia el programa abriendo una Terminal y ejecutando el comando
docker run --rm -it edufuga/edwords:latest
To all of you reading this post and asking yourself: But what the hell is Docker? here is an easy to follow (and short) video: https://www.youtube.com/watch?v=_dfLOzuIg2o&t=18s.
Tienes muy buena memoria. De hecho, me acabo de comprar el último modelo de iMac desktop que es un bonbón. Pero no me atrevo instalar nada. No soy como tú. Me da pánico hacer cualquier cosa técnica. Aún cuando tengo que actualizarlo, lo hago sudando la gota gorda 😅
De acuerdo!
🖥️😨😱😁😆
Congratulations on all the progress you've made with this program @Eduard, it seems really cool and this must have been a lot of work! And bahaha I love @Caro's comment about your cat topic tag... I saw that immediately and was looking forward to seeing how cats fit into your post. I wasn't sharp enough to see @Caro's logic regarding Catalan :D
Great work, I look forward to giving it a try in the future! 🥂🍾
Hey Robin! Thank you! I really look forward to reading about your experience with it :).
Yes, absolutely, one of the implications of being catalan is that I'm allowed to use the
cat
tag whenever I want, without further justification. Caro noticed the tag first, but that's no surprise, as she knows very well that there are often easter eggs scattered in my Journaly publications. Maybe I should obfuscate also part of the source code of my application, but that'd be a bit evil.Hi! I love it, it's a great idea and I think that can really help with the learning.
Hi! Thanks and welcome to Journaly. (I mostly bumped this post because I added pictures to it! 🎉🥳👯 This time I've also corrected it.)
Hi Eduard,
Eventually, I found some time to install your program. So far so good. I now have docker installed and
edufuga/edwords
shows in the image list. I hit run and it talks to me :D Currently, I'm not able to input anything.Hi Linda! Hey, that's really great!
Oh, I think that's because you "hit run" using Docker Desktop (the GUI for Windows and macOS on top of plain Docker). That's not how it's meant to be used (because you can't interact with the program using the keyboard that way, as you've commented). Instead, you have to open a console by typing "cmd" after pressing the Windows key, for example. Then, inside the console, you type the command I've written in this post:
docker run --rm -it edufuga/edwords:latest
. Extra info: The option-it
is what was missing in the GUI when you press the "run" button (that essentially starty a simpledocker run
command): it takes care of "attaching a keyboard" to it.Even better (at least that's how I use it under Windows): Open first the WSL (I'm assuming you've installed that) by typing
wsl
inside the console and then run the commanddocker run --rm -it edufuga/edwords:latest
.I hope that works and that you like the program once it does! If you have any further issues, you know where to reach me :). Ich freu mich schon auf dein Feedback :D.