DevTrendsDeveloper trends
Accent color

Product

Longyan, a Chinese popup dictionary that picks meanings from context

Popup dictionaries are tools where you hover over or highlight a word in a foreign language and a card shows you what it means. Language learners use them a lot for reading (Zhongwen and Yomitan are the popular browser o…

DTLifestyle & entertainmentDTResearch & learningDTWeb appDTWeb

About

Popup dictionaries are tools where you hover over or highlight a word in a foreign language and a card shows you what it means. Language learners use them a lot for reading (Zhongwen and Yomitan are the popular browser ones for Chinese and Japanese). I made one for Chinese that works across your entire computer (browser, WeChat, PDFs, whatever), and it picks out the correct definition of a multi-meaning word based on the sentence it's in. I think one of the hardest parts of learning Chinese as an English speaker is that so many words have several meanings that change with context. 卷 has thirteen (!!!) definitions, from "to roll up" to "a scroll" to "to compete to an unhealthy degree." Normal dictionaries show you all thirteen, but figuring out which one actually fits is more complex., so I made Longyan to do that for whatever you highlight. The tech side, for anyone curious: - It runs a small model (Qwen 3.5 4B) locally with llama.cpp. - The model never writes its own definitions. It can only choose from CC-CEDICT's (an open Chinese-English dictionary), so it can't make up a meaning. - It doesn't generate the answer as text. I put the answer up to the number in the prompt and read the model's probabilities for the next token. - I patched llama.cpp so it only computes the ~67k tokens (out of 248k) that the answers can ever use, which made it faster/efficent. For context I grew up speaking both Mandarin and English, so I spent a lot of time (9 months, this is literally my baby) making it as accurate as possible for learners. There are also ~1,000 short notes on slang and loaded words like 内卷 or 摸鱼. Those were written with Claude and checked against the dictionary. There's an interactive demo on the website that I think is worth trying even if this isn't for you :) It's 100% free and the whole codebase is on GitHub, including the evals and the llama.cpp patch: https://github.com/mapuchuu/longyan-reader

Discovery history

  1. Show HN

    Nov 25, 2026 · 1 observations

Discuss this product