explaingit

asxelot/fastdict.koplugin

Analysis updated 2026-05-18

1LuaAudience · generalComplexity · 2/5Setup · easy

TLDR

A KOReader plugin that makes tap-on-word dictionary lookups on Kindles much faster by searching dictionaries in-process instead of restarting a slow helper program each time.

Mindmap

mindmap
  root((repo))
    What it does
      Fast lookups
      In process engine
      Sdcv fallback
    Tech stack
      Lua
      LuaJIT
      Python tools
    Use cases
      Kindle reading
      Large dictionaries
      Cache prebuild
    Audience
      E-reader owners
      Kindle KOReader users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Speed up tap-on-word dictionary lookups on a Kindle running KOReader.

USE CASE 2

Use large StarDict format dictionaries without waiting seconds per lookup.

USE CASE 3

Pre-build lookup caches ahead of time so the first taps on a dictionary are instant.

USE CASE 4

Verify that fast lookups match sdcv's original results before relying on them.

What is it built with?

LuaLuaJITPythonzlib FFI

How does it compare?

asxelot/fastdict.koplugindaveshap/rtw2_world_resistancedmytro-dovg/pid-combinator
Stars111
LanguageLuaLuaLua
Setup difficultyeasyeasymoderate
Complexity2/52/53/5
Audiencegeneralgeneralgeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Just copy five Lua files into KOReader's plugins folder and restart.

No license information is stated in the README.

In plain English

FastDict is a plugin for KOReader, the open source e-reader software many Kindle owners install to replace the stock reading app. Its job is to make tap-on-word dictionary lookups faster. Normally, KOReader looks up definitions by launching a separate program called sdcv every time you tap a word, and that program rereads the entire dictionary file from scratch on each launch. With large dictionaries, such as a 46 megabyte file holding 1.7 million word forms, that rescan can take several seconds, which feels slow on an e-reader. FastDict fixes this by handling exact word lookups itself, inside KOReader's own process, instead of starting a new program each time. It builds small helper files, called cache files, once per dictionary, and then uses those caches to jump straight to the right entry with a fast search method rather than scanning the whole file again. When a dictionary or query type is not supported by this faster method, or if something goes wrong, FastDict automatically falls back to the original sdcv approach, so lookups should never fail, only sometimes run at the older speed. The plugin also tries a few simple English word shape guesses when an exact match is not found, such as turning streets into street or walked into walk, so common inflected words still resolve quickly. It only accepts a guess if it matches a real dictionary entry, so it will not invent answers, though irregular words like went still rely on the slower fallback search. Installing FastDict on a Kindle means copying a handful of Lua files into KOReader's plugins folder and restarting the app. There is also an optional step to pre build the lookup caches right away instead of waiting for the first tap. The project includes a companion Python tool for merging dictionary index files offline, plus test scripts to check that results match the original sdcv output exactly and that the plugin's behavior is correct on a desktop computer before using it on a device.

Copy-paste prompts

Prompt 1
Walk me through copying FastDict's files into KOReader's plugins folder on my Kindle.
Prompt 2
Explain how FastDict's binary search over idx and syn files works compared to sdcv.
Prompt 3
Show me how to use merge_syn.py to merge a syn file into an idx file offline.
Prompt 4
Help me run FastDict's parity test to confirm it matches sdcv's exact search results.

Frequently asked questions

What is fastdict.koplugin?

A KOReader plugin that makes tap-on-word dictionary lookups on Kindles much faster by searching dictionaries in-process instead of restarting a slow helper program each time.

What language is fastdict.koplugin written in?

Mainly Lua. The stack also includes Lua, LuaJIT, Python.

What license does fastdict.koplugin use?

No license information is stated in the README.

How hard is fastdict.koplugin to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is fastdict.koplugin for?

Mainly general.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.