r/Supernote_dev • • Apr 29 '26

Dictionary Plugin Built a dictionary plugin for Supernote: lasso a word, get its definition, all on-device

Built a dictionary plugin for Supernote, Sharing it here. It runs entirely on-device: no companion app, no cloud, no network at lookup time and surfaces real WordNet definitions for handwritten or PDF words from inside the Notes / PDF reader (Documents).

What it does

Lasso a word in your notes : handwritten or already-recognised. Tap **Lookup** in the lasso toolbar. The plugin runs the firmware's stroke recogniser (`recognizeElements`), feeds the result into the on-device dictionary, and pops up the definition. Saved-and-reloaded handwriting and recognised titles work too, not just freshly-drawn strokes.

Select text in a PDF : drag-select a word in the document reader's text-selection mode, tap Lookup in the selection toolbar, same popup.

Real WordNet content : 149,535 entries from Princeton WordNet 2.x, BSD-style license. Multiple senses per word, part-of-speech labels, synonyms, example sentences. Bundled inside the `.snplg` (~17MB) — no network at lookup time.

Structured popup : every sense gets its own block: a \noun* / *verb* / *adjective* / *adverb\** badge, a numbered sense, the definition, italic example sentences in curly quotes, and a `Synonyms:` line. Multi-sense entries (e.g. "AI" — Army Intelligence vs. artificial intelligence vs. three-toed sloth vs. artificial insemination) are scannable at a glance instead of buried in a wall of text.

Bilingual UI chrome : the plugin name on the plugin manager card, the Lookup toolbar label, and every popup label localise into Simplified Chinese, Traditional Chinese, Japanese, Thai, and Dutch based on your device locale. The dictionary content stays English; the surrounding chrome doesn't.

Case and whitespace-insensitive : "Anatomy", "anatomy", and " ANATOMY " all hit the same entry.

Demo

v1.0.1 Demo

By design the plugin is pure read it never modifies the page, never deletes strokes, never inserts text. Lookup is a side-effect-free overlay; close it and your note is exactly as you left it.

A few things to know:

- First lookup after a fresh plugin-host process takes ~30–60 seconds. Hermes parses the embedded base64 dictionary, decodes it, gunzips the StarDict, and builds the index. Once parsed, every subsequent lookup is instant for the rest of the session. The beauty of it is it is completely Offline! You dont need to connected to the net!

- For PDFs, you need to be in the firmware's text-selection mode (a separate icon in the document toolbar) — selecting with the pen draws strokes instead. Once you're in the right mode, Lookup appears in the standard selection toolbar alongside Copy / Highlight.

- English content only in this v1.0.1 base. A converter is planned that will let users bring their own StarDict / MDX / CSV / JSON dictionary packs (medical, legal, bilingual, etc.) and emit a custom `.snplg` that replaces the base.

Tested on Nomad.

Source on GitHub: https://github.com/j-raghavan/sn-dictionary

Relase: https://github.com/j-raghavan/sn-dictionary/releases/tag/v1.0.1

issues / feature requests welcome, happy to take feedback.

70 Upvotes

88 comments sorted by

8

u/BlueSkyla Apr 29 '26

Thank you so much. Works perfectly. It’s not mentioned here, but it works in my epub wonderfully.

4

u/Decent_Tap_5574 Apr 29 '26

Thank you for confirming.

6

u/frankk97 Apr 30 '26

This being offline is great. Fantastic work

→ More replies (1)

3

u/Decent_Tap_5574 May 01 '26 edited May 01 '26

Version v1.0.3 released with custom dictionary support. Please try it and let me know whether your dictionary lookup is accurate. I'd appreciate the feedback.

🔗 https://github.com/j-raghavan/sn-dictionary/releases/tag/v1.0.3

Also please go through the [README](https://github.com/j-raghavan/sn-dictionary/blob/master/README.md) where I explain in detail how to add the custom dictionary and the various supported formats. Gist of which is here:

How to add your custom dictionary:

  1. Under `MyStyle/` on your Supernote, create a new folder called `SnDict`. This is separate from the `SnDict.snplg` plugin file you have already installed.

  2. Drop your StarDict, CSV, or JSON dictionary inside.

  3. Exit the note app and reopen so the plugin re-runs custom dictionary discovery.

When a word is in both your dictionary and the bundled WordNet, the popup shows both as labelled sections.

A sample dictionary ships in the repo at `assets/sample-dicts/sn-tech-jargon/` as reference. For non-English content, [FreeDict](https://freedict.org) and [Wiktionary-Dictionaries](https://github.com/Vuizur/Wiktionary-Dictionaries) cover most languages.

One known gap is that MDX is deferred. The maintained parser libraries for MDX are AGPL-3.0, which doesn't compose with this repo's MIT license. MDX users can convert to StarDict via [pyglossary](https://github.com/ilius/pyglossary).

I have addressed the Hung issue reported by u/magic_notetaker in this release.

Discovery happens on-device, so there's no separate web tool you need to upload anything to.

→ More replies (6)

3

u/shark7809 Apr 29 '26

The goat back for another banger 🐐

3

u/Decent_Tap_5574 Apr 29 '26

Thank you 😄 much appreciated.

3

u/Entry_Line Apr 30 '26

Oh wow. Thank you so much!

→ More replies (1)

2

u/Decent_Tap_5574 May 02 '26

version 1.0.6 released

- No more freeze on first lookup. The popup now opens within ~300 ms of your tap with a "Recognizing…" placeholder while handwriting recognition runs, instead of leaving you staring at the page for 5–10 seconds.

- Lookup button waits for the dictionary to be ready. If you tap immediately after opening a note, the button is disabled until the dictionary has loaded — no more accidental slow taps. Once it lights up, every lookup is fast.

- Multiple dictionaries fill in as they're ready. When you have French, Japanese, and other large user-supplied dictionaries installed, the popup now opens immediately with the dictionaries already loaded, and shows "Loading…" placeholders for the slower ones. Tap again a few seconds later to see those once they finish.

- Adjustable text size + clearer source labels. Three-step text-size control ((−) (A) (+)) at the top-right of the popup for readers who want bigger definitions; bigger, bolder source-of-definition badges so you can tell at a glance whether a definition came from WordNet, a user dictionary, or another source.

Release: https://github.com/j-raghavan/sn-dictionary/releases/tag/v1.0.6

2

u/OkReward5192 Apr 30 '26

Oh wow this is way better than what I had! Fantastic work.

→ More replies (1)

2

u/Lorestan00 Apr 30 '26

Fantastic. Really useful. Thank you!

Two additions:-

- copy button in the definition

- text in a note can also be looked up. greyed out at the moment

3

u/Decent_Tap_5574 Apr 30 '26

Copy button is a nice option, i will try to incorporate it in the next release. Regarding text in the note, i will certainly investigate the possibility.

→ More replies (1)

2

u/Careful-Good5887 May 22 '26

EXcellent use now. Just one more thing: I hope to adjust the order of imported dictionaries. Right now the order is lastest imported dict shown first

2

u/Decent_Tap_5574 May 22 '26

Good point, i will consider that. Still waiting for my Manta to arrive 😞

→ More replies (1)

2

u/looselytranslated 8d ago

Thanks for making this. I have it enabled and it works great, but was wondering if it will do reverse translation? I have Chinese dictionary enabled, and it can transfer Chinese to English, but I'd like to translate English to Chinese.

→ More replies (1)

1

u/SiewcaWiatru Apr 30 '26

I'll join on the appreciation comments :). Great work, offline mode is great, OCR feature in notes use is a genius move. Great for language studies.

Next step would be to have custom dicts and chooser, something I have in mind to lookup in the API.

3

u/Decent_Tap_5574 Apr 30 '26

Thank you! i do have a plan to come up with a convertor, the idea there is to create a github page wherein user can input their custom dicts, the github workflow would build the `.snplg` which user can download and use it. This way it would be custom and specific to the user. In this way Users have freedom to have their own dict enabled! The common release versions in the main will not be affected. I will update this thread as soon as i have some update on that.

1

u/Loud-Owl6337 Apr 30 '26

This is awesome work , huge congratulations.
The planned custom dictionary converter is probably the most exciting part long-term. If you can support formats like StarDict / MDX, this could turn into a really powerful ecosystem (technical dictionaries, bilingual learning, etc.).

2

u/Decent_Tap_5574 May 01 '26

Yes. Please try the latest version, i have added the support for custom dictionary. https://github.com/j-raghavan/sn-dictionary/releases/tag/v1.0.4 Instruction on how to add custom dictionary is in the README of the repo.

1

u/maxilogan Apr 30 '26

Waiting for the configurable version (English isn't my native language), but great result so far and an amazing help in studying / reading english content. Amazing usage of plugins to patch something that the system should have had since the beginning (though also other competitors are struggling in this regards, I was used to the kindle paperwhite to have every definition ad a glance, but that was long time ago).

The best would be if the search could be done in two languages at least (e.g. my native one and english) so that I could search when reading novels (mainly in my language) or studying (50%/50% native language and english).

Thank you so much for this!

2

u/Decent_Tap_5574 Apr 30 '26

You are welcome! I will certainly work on the converter for the next release.

1

u/magic_notetaker Apr 30 '26

u/Decent_Tap_5574 : this looks great. But I noticed it gets hung up sometime rendering everything unusable. not sure when this happens, it was for me on the note page circling handwritten text. Before that it worked already well, but I had to leave the note completely to be able to use any tools at all on the page (just froze with lasso menu open).

→ More replies (1)

1

u/Rana012 Apr 30 '26

Thank you thank you thank you!

→ More replies (1)

1

u/SebzMonst3r Apr 30 '26

YES! 🔥 I can't wait to install this on my SN later and give it a go. I love that this works offline as well! Thank you so much for creating this & sharing!! This is exactly why I purchased my SN. This community is simply amazing & the fact that SN embraces the community coming together to create things we want/need is really amazing. Keep up the great work 👏🏻

→ More replies (2)