{"id":28188827,"url":"https://github.com/neocl/jamdict","last_synced_at":"2025-05-16T09:12:06.169Z","repository":{"id":50015973,"uuid":"71852909","full_name":"neocl/jamdict","owner":"neocl","description":"Python 3 library for manipulating Jim Breen's JMdict, KanjiDic2, JMnedict and kanji-radical mappings","archived":false,"fork":false,"pushed_at":"2021-06-06T04:04:03.000Z","size":1028,"stargazers_count":137,"open_issues_count":7,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-18T01:37:45.011Z","etag":null,"topics":["dictionary","jamdict","japanese","japanese-dictionary","japanese-language","japanese-study","jmdict","kanji","kanjidic2","python","python-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neocl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-25T02:47:58.000Z","updated_at":"2025-03-12T13:41:52.000Z","dependencies_parsed_at":"2022-09-19T17:00:41.132Z","dependency_job_id":null,"html_url":"https://github.com/neocl/jamdict","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocl%2Fjamdict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocl%2Fjamdict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocl%2Fjamdict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neocl%2Fjamdict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neocl","download_url":"https://codeload.github.com/neocl/jamdict/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501543,"owners_count":22081532,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dictionary","jamdict","japanese","japanese-dictionary","japanese-language","japanese-study","jmdict","kanji","kanjidic2","python","python-library"],"created_at":"2025-05-16T09:12:05.401Z","updated_at":"2025-05-16T09:12:06.163Z","avatar_url":"https://github.com/neocl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jamdict\r\n\r\n[Jamdict](https://github.com/neocl/jamdict) is a Python 3 library for manipulating Jim Breen's JMdict, KanjiDic2, JMnedict and kanji-radical mappings.\r\n\r\n[![ReadTheDocs Badge](https://readthedocs.org/projects/jamdict/badge/?version=latest\u0026style=plastic)](https://jamdict.readthedocs.io/)\r\n\r\n**Documentation:** https://jamdict.readthedocs.io/ \r\n\r\n# Main features\r\n\r\n* Support querying different Japanese language resources\r\n  - Japanese-English dictionary JMDict\r\n  - Kanji dictionary KanjiDic2\r\n  - Kanji-radical and radical-kanji maps KRADFILE/RADKFILE\r\n  - Japanese Proper Names Dictionary (JMnedict) \r\n* Fast look up (dictionaries are stored in SQLite databases)\r\n* Command-line lookup tool [(Example)](#command-line-tools)\r\n\r\n[Contributors](#contributors) are welcome! 🙇. If you want to help, please see [Contributing](https://jamdict.readthedocs.io/en/latest/contributing.html) page.\r\n\r\n# Try Jamdict out\r\n\r\nJamdict is used in [Jamdict-web](https://jamdict.herokuapp.com/) - a web-based free and open-source Japanese reading assistant software.\r\nPlease try out the demo instance online at:\r\n\r\nhttps://jamdict.herokuapp.com/\r\n\r\nThere also is a demo [Jamdict virtual machine](https://replit.com/@tuananhle/jamdict-demo) online for trying out Jamdict Python code on Repl.it:\r\n\r\nhttps://replit.com/@tuananhle/jamdict-demo\r\n\r\n# Installation\r\n\r\nJamdict \u0026 Jamdict database are both available on [PyPI](https://pypi.org/project/jamdict/) and can be installed using pip\r\n\r\n```bash\r\npip install --upgrade jamdict jamdict-data\r\n```\r\n\r\n# Sample jamdict Python code\r\n\r\n```python\r\nfrom jamdict import Jamdict\r\njam = Jamdict()\r\n\r\n# use wildcard matching to find anything starts with 食べ and ends with る\r\nresult = jam.lookup('食べ%る')\r\n\r\n# print all word entries\r\nfor entry in result.entries:\r\n     print(entry)\r\n\r\n# [id#1358280] たべる (食べる) : 1. to eat ((Ichidan verb|transitive verb)) 2. to live on (e.g. a salary)/to live off/to subsist on\r\n# [id#1358300] たべすぎる (食べ過ぎる) : to overeat ((Ichidan verb|transitive verb))\r\n# [id#1852290] たべつける (食べ付ける) : to be used to eating ((Ichidan verb|transitive verb))\r\n# [id#2145280] たべはじめる (食べ始める) : to start eating ((Ichidan verb))\r\n# [id#2449430] たべかける (食べ掛ける) : to start eating ((Ichidan verb))\r\n# [id#2671010] たべなれる (食べ慣れる) : to be used to eating/to become used to eating/to be accustomed to eating/to acquire a taste for ((Ichidan verb))\r\n# [id#2765050] たべられる (食べられる) : 1. to be able to eat ((Ichidan verb|intransitive verb)) 2. to be edible/to be good to eat ((pre-noun adjectival (rentaishi)))\r\n# [id#2795790] たべくらべる (食べ比べる) : to taste and compare several dishes (or foods) of the same type ((Ichidan verb|transitive verb))\r\n# [id#2807470] たべあわせる (食べ合わせる) : to eat together (various foods) ((Ichidan verb))\r\n\r\n# print all related characters\r\nfor c in result.chars:\r\n    print(repr(c))\r\n\r\n# 食:9:eat,food\r\n# 喰:12:eat,drink,receive (a blow),(kokuji)\r\n# 過:12:overdo,exceed,go beyond,error\r\n# 付:5:adhere,attach,refer to,append\r\n# 始:8:commence,begin\r\n# 掛:11:hang,suspend,depend,arrive at,tax,pour\r\n# 慣:14:accustomed,get used to,become experienced\r\n# 比:4:compare,race,ratio,Philippines\r\n# 合:6:fit,suit,join,0.1\r\n```\r\n\r\n## Command line tools\r\n\r\nTo make sure that jamdict is configured properly, try to look up a word using command line\r\n\r\n```bash\r\npython3 -m jamdict lookup 言語学\r\n========================================\r\nFound entries\r\n========================================\r\nEntry: 1264430 | Kj:  言語学 | Kn: げんごがく\r\n--------------------\r\n1. linguistics ((noun (common) (futsuumeishi)))\r\n\r\n========================================\r\nFound characters\r\n========================================\r\nChar: 言 | Strokes: 7\r\n--------------------\r\nReadings: yan2, eon, 언, Ngôn, Ngân, ゲン, ゴン, い.う, こと\r\nMeanings: say, word\r\nChar: 語 | Strokes: 14\r\n--------------------\r\nReadings: yu3, yu4, eo, 어, Ngữ, Ngứ, ゴ, かた.る, かた.らう\r\nMeanings: word, speech, language\r\nChar: 学 | Strokes: 8\r\n--------------------\r\nReadings: xue2, hag, 학, Học, ガク, まな.ぶ\r\nMeanings: study, learning, science\r\n\r\nNo name was found.\r\n```\r\n\r\n## Using KRAD/RADK mapping\r\n\r\nJamdict has built-in support for KRAD/RADK (i.e. kanji-radical and radical-kanji mapping).\r\nThe terminology of radicals/components used by Jamdict can be different from else where.\r\n\r\n- A radical in Jamdict is a principal component, each character has only one radical.\r\n- A character may be decomposed into several writing components.\r\n\r\nBy default jamdict provides two maps:\r\n\r\n- jam.krad is a Python dict that maps characters to list of components.\r\n- jam.radk is a Python dict that maps each available components to a list of characters.\r\n\r\n```python\r\n# Find all writing components (often called \"radicals\") of the character 雲\r\nprint(jam.krad['雲'])\r\n# ['一', '雨', '二', '厶']\r\n\r\n# Find all characters with the component 鼎\r\nchars = jam.radk['鼎']\r\nprint(chars)\r\n# {'鼏', '鼒', '鼐', '鼎', '鼑'}\r\n\r\n# look up the characters info\r\nresult = jam.lookup(''.join(chars))\r\nfor c in result.chars:\r\n    print(c, c.meanings())\r\n# 鼏 ['cover of tripod cauldron']\r\n# 鼒 ['large tripod cauldron with small']\r\n# 鼐 ['incense tripod']\r\n# 鼎 ['three legged kettle']\r\n# 鼑 []\r\n```\r\n\r\n## Finding name entities\r\n\r\n```bash\r\n# Find all names with 鈴木 inside\r\nresult = jam.lookup('%鈴木%')\r\nfor name in result.names:\r\n    print(name)\r\n\r\n# [id#5025685] キューティーすずき (キューティー鈴木) : Kyu-ti- Suzuki (1969.10-) (full name of a particular person)\r\n# [id#5064867] パパイヤすずき (パパイヤ鈴木) : Papaiya Suzuki (full name of a particular person)\r\n# [id#5089076] ラジカルすずき (ラジカル鈴木) : Rajikaru Suzuki (full name of a particular person)\r\n# [id#5259356] きつねざきすずきひなた (狐崎鈴木日向) : Kitsunezakisuzukihinata (place name)\r\n# [id#5379158] こすずき (小鈴木) : Kosuzuki (family or surname)\r\n# [id#5398812] かみすずき (上鈴木) : Kamisuzuki (family or surname)\r\n# [id#5465787] かわすずき (川鈴木) : Kawasuzuki (family or surname)\r\n# [id#5499409] おおすずき (大鈴木) : Oosuzuki (family or surname)\r\n# [id#5711308] すすき (鈴木) : Susuki (family or surname)\r\n# ...\r\n```\r\n\r\n## Exact matching\r\n\r\nUse exact matching for faster search.\r\n\r\nFind the word 花火 by idseq (1194580)\r\n\r\n```python\r\n\u003e\u003e\u003e result = jam.lookup('id#1194580')\r\n\u003e\u003e\u003e print(result.names[0])\r\n[id#1194580] はなび (花火) : fireworks ((noun (common) (futsuumeishi)))\r\n```\r\n\r\nFind an exact name 花火 by idseq (5170462)\r\n\r\n```python\r\n\u003e\u003e\u003e result = jam.lookup('id#5170462')\r\n\u003e\u003e\u003e print(result.names[0])\r\n[id#5170462] はなび (花火) : Hanabi (female given name or forename)\r\n```\r\n\r\nSee `jamdict_demo.py` and `jamdict/tools.py` for more information.\r\n\r\n# Useful links\r\n\r\n* JMdict: [http://edrdg.org/jmdict/edict_doc.html](http://edrdg.org/jmdict/edict_doc.html)\r\n* kanjidic2: [https://www.edrdg.org/wiki/index.php/KANJIDIC_Project](https://www.edrdg.org/wiki/index.php/KANJIDIC_Project)\r\n* JMnedict: [https://www.edrdg.org/enamdict/enamdict_doc.html](https://www.edrdg.org/enamdict/enamdict_doc.html)\r\n* KRADFILE: [http://www.edrdg.org/krad/kradinf.html](http://www.edrdg.org/krad/kradinf.html)\r\n\r\n# Contributors\r\n\r\n- [Le Tuan Anh](https://github.com/letuananh) (Maintainer)\r\n- [alt-romes](https://github.com/alt-romes)\r\n- [Matteo Fumagalli](https://github.com/matteofumagalli1275)\r\n- [Reem Alghamdi](https://github.com/reem-codes)\r\n- [Techno-coder](https://github.com/Techno-coder) \r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocl%2Fjamdict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneocl%2Fjamdict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneocl%2Fjamdict/lists"}