Skip to content

itsupera/furiganalyse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Buy Me A Coffee donate button

Furiganalyse

Annotate Japanese ebooks with furigana, and other conversions.

→ Try it here!


Supported input formats:

  • EPUB
  • AZW3 (without DRM)
  • MOBI

Supported output formats:

  • EPUB
  • AZW3 (without DRM)
  • MOBI
  • Many text files (one per book part)
  • Single text file
  • Anki Deck (each sentence as a card)
  • HTML (readable in web browser)

Setup and run

Using Docker to install all the dependencies and dictionaries (tested on Ubuntu 20.04):

docker build -t furiganalyse .

Or grab the latest prebuilt image:

docker pull itsupera/furiganalyse:latest
docker tag itsupera/furiganalyse:latest furiganalyse:latest

Run as a web app

docker run -p 127.0.0.1:5000:5000 furiganalyse:latest

Then open http://127.0.0.1:5000 in your web browser

Run as a CLI

# Run this from the directory your ebook (for example "book.epub") is in
docker run -v $PWD:/workspace --entrypoint=python3 furiganalyse:latest \
    -m furiganalyse /workspace/book.epub /workspace/book_with_furigana.epub

Calling the API

# Submit a job
curl -v -XPOST http://127.0.0.1/submit \
    -F "file=@<path-to-your-epub>" \
    -F furigana_mode="add" \
    -F writing_mode="horizontal-tb" \
    -F of="epub" \
    -F redirect=false

# Response will look like this:
# {"uid":"<job-id>"}

# Check the status of the job
curl -v http://127.0.0.1/jobs/<job-id>/status
# Response will look like this:
# {
#   "uid": "<job-id>",
#   "status": "complete",
#   "result": "(...data...)"
# }

# Download the result
curl http://127.0.0.1/jobs/<job-id>/file -o output.epub