Skip to content

feat: dictionary support#1402

Draft
mcrosson wants to merge 147 commits intocrosspoint-reader:masterfrom
mcrosson:feat-dictionary
Draft

feat: dictionary support#1402
mcrosson wants to merge 147 commits intocrosspoint-reader:masterfrom
mcrosson:feat-dictionary

Conversation

@mcrosson
Copy link
Copy Markdown

@mcrosson mcrosson commented Mar 15, 2026

Summary

  • General 'dictionary support' discussion has started in Dictionary Support #1599
    • Please use this discussion for bug reports, usage questions, etc.
  • User manual ; see docs/dictionary.md (link)
    • This document contains more information than stated in this PR summary
  • Developer documentation ; see docs/dictionary-development.md (link)
    • This document contains more information than stated in this PR summary
  • Compared to PR feat: Add dictionary word lookup feature #857
    • Full feature parity is complete
    • This was the starting point for this PR's work
  • Compared to PR feat: Add Dictionary word-lookup feature to reader #1542
    • Full feature parity is complete
    • There may be performance differences but they are minor. See below discussion for additional detail.
  • StarDict support: syn files, offset files, ifo metadata
    • Only dict/dz + idx files needed for dictionary use
  • On-device dictionary pre-processing before use: decompression + offset file generation
    • Required if supplied dictionary is compressed (dz) or lacking offset files (oft)
  • Offline pre-processing script (Python, run before transfer to device)
  • Script that allows merging multiple StarDict dictionaries
    • This should be used if you need 'multiple active dictionaries'
  • View dictionary ifo metadata on-device (parsed and raw views)
  • Select a dictionary from a list that is built using .dictionaries or dictionaries folder on sd card
  • Per-book dictionary override (reader menu)
  • Word lookup: direct, case-normalized, stem variants, alt-form (.syn), fuzzy suggestions
  • Phrase / multi-word lookup
  • Lookup from definition (chained lookups without returning to reader)
  • Lookup history with tunable max number of entries
  • HTML rendering of dictionary data (expat-based, dedicated renderer)
  • IPA pronunciation characters / info supported (see docs/dictionary.md for details)
  • Test infrastructure: 19 dictionaries + 20 chapter test epub

Additional Context

See the discussion linked above for more detail on progress, planned changes, etc

General

  • This implementation is functionally complete
  • This branch is kept up to date with functional code. Major breakages should not happen.
  • PR's to this PR are welcome
  • Bug reports are welcome

RAM / ROM Usage Differences

Metric crosspoint feat-dictionary Delta
RAM 95,212 B (29.1%) 96,004 B (29.3%) +792 B (+0.2%)
Flash 5,755,079 B (87.8%) 5,838,629 B (89.1%) +83,550 B (+1.3%)

AI Usage

Did you use AI tools to help write this code? YES - Claude ; chosen as the original PR I started with used AI.

…at can hold multiple dictionaries (stardict format, one folder per dictionary) and a stting to choose between 'none' and any dictionary in the dictonary folder on the sd card -- this is a BREAKING, INCOMPLETE change
… code is within the validation method to keep everything related to validation in one place
…hich is 'too heavy' for the x4 -- this allows them to be extracted on-device
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 15, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9b5d2491-9ff7-4378-af54-ef6deb6dcea8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

mcrosson added 20 commits March 15, 2026 23:00
…ide the development of the expat processing engine that is planned for later
… remove '.ifo' file as a requirement to use dictionary, allow line wrap for all metadata fields/lines in ifo file display, add 'no ifo found' alert if trying to view metadata for a dict w/o ifo file
@Anseryde
Copy link
Copy Markdown

Anseryde commented Apr 29, 2026

The switch to Noto Serif from Bookerly has caused a build failure from when you last merged upstream back into this PR which I ran into when trying to flash the latest version of this to try out @mcrosson

Currently on 6289a79 for now

@antziko
Copy link
Copy Markdown

antziko commented Apr 29, 2026

The switch to Noto Serif from Bookerly has caused a build failure from when you last merged upstream back into this PR which I ran into when trying to flash the latest version of this to try out @mcrosson

Currently on 6289a79 for now

I removed the folder and redo git clone to resolve it. :)

@Anseryde
Copy link
Copy Markdown

Anseryde commented Apr 30, 2026

The switch to Noto Serif from Bookerly has caused a build failure from when you last merged upstream back into this PR which I ran into when trying to flash the latest version of this to try out @mcrosson
Currently on 6289a79 for now

I removed the folder and redo git clone to resolve it. :)

@antziko I think by doing that you rebased your repo onto the kmn-custom branch instead of the feat-dictionary branch, which is this PR, so you didn't run into any build failures. mcrosson's crosspoint fork has the kmn-custom branch as the main cloned branch by default. Your solution therefore isn't an actual solution at all. I have now tried doing exactly what you said and cloned specifically the feat-dictionary branch, and the same build failure has appeared again.

@mcrosson this is still an issue, stemming from the switch to Noto Serif upstream causing a build failure on the feat-dictionary branch of your fork of crosspoint, which is what this PR is based on.

@mcrosson
Copy link
Copy Markdown
Author

There was a bad push. I tested the update on the wrong device (I have 2 here) and pushed. About the time I realized the mistake my computer crashed and I'm waiting on a new PSU so I can fix the build.

It should be sorted soon but I'm kind of stuck until a new PSU arrives for my computer.

@antziko
Copy link
Copy Markdown

antziko commented May 1, 2026

@antziko I think by doing that you rebased your repo onto the kmn-custom branch instead of the feat-dictionary branch, which is this PR, so you didn't run into any build failures. mcrosson's crosspoint fork has the kmn-custom branch as the main cloned branch by default. Your solution therefore isn't an actual solution at all. I have now tried doing exactly what you said and cloned specifically the feat-dictionary branch, and the same build failure has appeared again.

@mcrosson this is still an issue, stemming from the switch to Noto Serif upstream causing a build failure on the feat-dictionary branch of your fork of crosspoint, which is what this PR is based on.

You are right, the default repo is not feat-dictionary.

@Anseryde
Copy link
Copy Markdown

Anseryde commented May 4, 2026

@mcrosson I think I've found a new bug on the latest version of this PR on the X4, where the lookup history is no longer capable of being updated. I looked up a new word multiple times and it did not get added to the lookup history for a book.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants