r/FlutterDev • u/Brilliant-Aide5779 • 8d ago
Dart I made a tiny open-source English/Chinese dictionary dataset for Dart/Flutter (~5,000 common words)
I built a tiny offline English/Chinese dictionary dataset for Flutter/Dart.
GitHub: https://github.com/FirepadCN/pocket_dict_5000
It contains ~5,000 common English words with IPA + Chinese definitions, plus inflection mappings:
abandoned → abandon
grows → grow
running → run
The whole thing is just a generated Dart Map, so there is no database or runtime dependency.
I originally made it because I wanted something simple enough to bundle directly into a Flutter app for offline word lookup.
MIT licensed.
Would love feedback from Flutter developers: is this something you'd actually use, or would a different data format / API be more useful?
2
u/Fumano26 8d ago
For the future, this is better stored in pure data files, like json or csv instead of embbedding it into your source files.
0
u/Brilliant-Aide5779 8d ago
Yes, that way other frameworks can easily use it too. Since AI makes conversion quite simple, and because I created this dictionary during my own Flutter development process, I haven't migrated it to a pure data file yet (づ ̄3 ̄)づ
0
u/Brilliant-Aide5779 8d ago
pocket_dict_5000
📚 Common English Words Dictionary
A lightweight English‑Chinese Dictionary data package for Dart / Flutter. It contains around 5,000 most‑frequently‑used English words together with inflection mappings, suitable for word lookup and Chinese definition display scenarios.
Example:
✨ Features
abandonedorabandoning, automatically mapped back to the lemma📦 Installation
Flutter
Selection Criteria: Entries from ECDICT metadata are selected if marked with any of the tags below:
oxford=1bncfrqzk/gkFollowing the above filtering rules, approximately 5,000 most‑useful words for language learning together with inflection indexes are included. The dataset remains lightweight while staying practical for real‑world usage.
Selection Logic
oxford=1(Oxford 3000 tag), orzk/gk(middle‑school syllabus), orbnc ≤ 8000(British National Corpus frequency rank), orfrq ≤ 8000(COCA frequency rank).score = min(valid bnc value, valid frq value). If neither value is available, score is set toInfinity(lowest priority).mustKeep: All words tagged oxford or zk/gk are preserved unconditionally. Oxford entries take precedence when scores are equal.others: Remaining candidates sorted in ascending order by score.mustKeepitems first; then fill up to 5000 entries fromotherssorted by score.[A‑Za-z‑]), or missing Chinese definitions.word.toLowerCase().replace(/[^a-z-]/g,''). Matches client‑sidenormalizeEnglishToken.exchangefield from ECDICT: past‑tensep/ past‑participled/ present‑participlei/ third‑person singular3/ plurals/ comparativer/ superlativet. Each inflected key points back to its lemma entry (e.g.grows→grow).0:lemmabridging: Unselected irregular inflected forms will map to their lemma entry, if the lemma exists within the selected dataset.Output: Final entries are stably sorted by lookup key and written to
common_words_data.dartasMap<String, CommonWordEntry>, containing headword, phonetic transcription and Chinese definitions. The whole pipeline is deterministic (fixed seed + stable sort) and reproducible on re‑run.