Sign inSign up

alebast/epub-gender-highlight

By alebast

β€’Updated about 1 year ago

A program to give color to gendered words and keep currently highlighted text from epub3 centered.

Image
0

9.2K

alebast/epub-gender-highlight repository overview

πŸ“– Overview

This Docker image processes Russian EPUB files to make them easier to follow while reading and listening. It automatically:

🎨 Colors nouns based on grammatical gender:

    Blue β†’ masculine

    Red β†’ feminine

    Green β†’ neuter

πŸ– Highlights case-governing words (prepositions, verbs) with different background colors for dative, genitive, accusative, instrumental, and prepositional cases

πŸ–₯ Keeps the current highlighted sentence centered on screen when reading, making it easier to track during synchronized audiobook playback

🎯 Ideal Use Case

Designed for EPUB3 books in Russian β€” especially those produced with Storyteller for synchronized reading and listening. With this enhancement, learners of Russian can visually connect grammar patterns to real reading context while following along with the audio. πŸš€ How It Works

Mount your .epub file into the container.

The script scans all text inside the EPUB.

Morphological analysis (via pymorphy2) detects each word’s gender and case.

HTML is updated with custom CSS for color-coding.

A small JavaScript snippet ensures the current selection stays centered as you read.

The output is saved as a new .epub.

πŸ›  Usage

docker run --rm \
  -v $(pwd)/input:/input \
  -v $(pwd)/output:/output \
  alebast/russian-epub-highlighter

Input: /input/input.epub
Output: /output/output.epub

πŸ“¦ Docker Compose Example

services:
  epub-gender-highlight:
    image: alebast/epub-gender-highlight:latest
    container_name: epub-gender-highlight
    volumes:
      # Mount local folder with the original EPUB
      - /path/to/input:/app/input
      # Mount local folder where the processed EPUB will be saved
      - /path/to/output:/app/output
    restart: "no"

πŸ›  How to Run

Create two folders:

    mkdir input output

    Put your Russian EPUB in input/ and name it input.epub.

    Run:

    docker compose up

    Your processed EPUB will appear in output/output.epub.

🎨 Color Scheme

Feature	Color
Masculine nouns	Blue
Feminine nouns	Red
Neuter nouns	Green
Dative indicators	Light blue background
Genitive indicators	Light green background
Accusative indicators	Light yellow background
Instrumental indicators	Light purple background
Prepositional indicators	Light cyan background

πŸ“š Learning Benefit

By linking color cues to grammar, learners quickly internalize Russian gender and case structures in authentic reading contexts, without constant grammar-table lookup.

Tag summary

Content type

Image

Digest

sha256:307859282…

Size

151.1 MB

Last updated

about 1 year ago

docker pull alebast/epub-gender-highlight