{"id":19196140,"url":"https://github.com/nsneruno/jm_dict","last_synced_at":"2025-05-09T00:33:20.901Z","repository":{"id":61973883,"uuid":"414975548","full_name":"nsNeruno/jm_dict","owner":"nsNeruno","description":"Implementation of JMDict Japanese Dictionary in Dart using ObjectBox Database","archived":false,"fork":false,"pushed_at":"2022-09-06T10:43:12.000Z","size":19802,"stargazers_count":10,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-20T10:40:29.876Z","etag":null,"topics":["dart","database","dictionary","flutter","japanese-dictionary","japanese-language","objectbox"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/jm_dict","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nsNeruno.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-08T12:19:49.000Z","updated_at":"2025-02-24T15:49:38.000Z","dependencies_parsed_at":"2022-10-24T13:30:45.050Z","dependency_job_id":null,"html_url":"https://github.com/nsNeruno/jm_dict","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fjm_dict","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fjm_dict/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fjm_dict/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nsNeruno%2Fjm_dict/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nsNeruno","download_url":"https://codeload.github.com/nsNeruno/jm_dict/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171166,"owners_count":21865275,"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":["dart","database","dictionary","flutter","japanese-dictionary","japanese-language","objectbox"],"created_at":"2024-11-09T12:12:47.676Z","updated_at":"2025-05-09T00:33:20.877Z","avatar_url":"https://github.com/nsNeruno.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jm_dict\n\n[![Pub](https://img.shields.io/pub/v/jm_dict.svg)](https://pub.dartlang.org/packages/jm_dict)\n\nImplementation of the [JMdict Japanese Dictionary Project](http://www.edrdg.org/wiki/index.php/JMdict-EDICT_Dictionary_Project) as a Flutter plugin.\n\n**Usage of this plugin must conform to the [Attribution and Credits](https://pub.dev/packages/jm_dict#attribution-and-credits) section below.**\n\n## Getting Started\n\nThis plugin enables your app to load and use the Japanese Dictionary provided by JMdict/EDICT Project.    Supports looking up entries by kana, romaji, kanji and the meaning/glossary content.  Currently doesn't support entry editing.\n\nThis plugin stores the dictionary locally and uses [ObjectBox](https://pub.dev/packages/objectbox) as it's local database architecture.  There are **three ways** to initiate the plugin and it requires the file [JMdict.gz](http://ftp.edrdg.org/pub/Nihongo/JMdict.gz),  which contains the **JMdict XML** file.\n\n### Provide from Asset\nPlace the **JMdict.gz** file within your project, typically on the same level as the lib folder/inside a folder  on the same level as the lib folder, then include it on the project's **_pubspec.yaml_**.\n\n```yaml\n# For example, the file is placed inside assets folder,\n# which is located on the same level with the lib folder\nassets:\n    - assets/JMdict.gz\n```\n\nThen call the **_initFromAsset_** method\n```dart\nimport 'package:jm_dict/jm_dict.dart';\n\nJMDict().initFromAsset(assetPath: \"assets/JMdict.gz\",);\n```\nWhy init from the gz file? The real XML file has the size of ±100MBs, which is too large to be   included locally as an asset\n\n### Provide from File\nLet's say you obtained the content of JMdict.gz, which is the JMdict XML file somewhere, you can  call the **_initFromFile_** method.\n```dart\nimport 'package:jm_dict/jm_dict.dart';\nimport 'package:path_provider/path_provider.dart' as PathProvider;\n\nfinal tempDir = await PathProvider.getTemporaryDirectory();\nfinal File jmDictXmlFile = File(\"${tempDir.uri.getFilePath()}JMdict\",);\n\nJMDict().initFromFile(xmlFile: jmDictXmlFile,);\n```\n\n### Provide Online\nYou can provide the JMdict.gz file by downloading it. This plugin can download it from a default URL, or  you can provide an alternative download URL.\n```dart\nimport 'package:jm_dict/jm_dict.dart';\n\nJMDict().initFromNetwork();\n\n/// with alternative download URL\nJMDict().initFromNetwork(\n  archiveUri: Uri.parse(\n    \"https://mystorage.somewhere.com/download/JMdict.gz\",\n  ),\n);\n```\n**Note**: this will take a while, since it will download a file with a size of ±20 MBs, on a slower connection, might   take minutes.\n\n## Searching Entries\n### Basic Search Usage\nLook for results by providing a single keyword.\n```dart\nimport 'package:jm_dict/jm_dict.dart';\n\nfinal dict = JMDict();\n\n/// Returns result that has romaji readings of \"kensaku\", or if the glossary/meaning\n/// contains the word \"kensaku\"\ndict.search(\n  keyword: \"kensaku\",\n)\n\n/// Should return the same result as the above one, but might return less results since\n/// glossaries usually don't contain kana\ndict.search(\n  keyword: \"けんさく\",\n);\n\n/// This will return more specific results, looking for entries that contain this\n/// kanji keyword\ndict.search(\n  keyword: \"検索\",\n);\n```\n\n### Limiting Results/Pagination\nYou can provide additional argument to limit the search result count, and how many results to skip.\n```dart\nimport 'package:jm_dict/jm_dict.dart';\n\nfinal dict = JMDict();\n\n/// Limit search results to 10\ndict.search(\n  keyword: \"sakai\", limit: 10,\n);\n\n/// Skip first 10 results\ndict.search(\n  keyword: \"sakai\", offset: 10,\n);\n\n/// Limit search results to 10, skips the first 20 results\ndict.search(\n  keyword: \"saka\", limit: 10, offset: 20,\n);\n```\n\n## Limitations\nThere are some use cases to consider when searching:\n- Searching using mixed keywords won't work, e.g \"hige男\", \"kamisatoけ\". This will be considered in future  versions\n- Each entry in the dictionary has more accessible traits, which is available on search results, e.g: dialects,   word category, etc. For this release, the query process will only look for keywords in kana, romaji, and   kanji texts only and further filters can be created manually, e.g using **_List.where_**. This will be considered   in future releases as well.\n- Sorting isn't available for now. You can use **_List.sort_** for now and specify your own sorting preferences.\n- There's a consideration of writing certain entries into the local database, to reduce the DB size. For now   this plugin writes the whole file.\n\n## Attribution and Credits\n\n[![CC BY-SA 3.0][cc-by-sa-image]][cc-by-sa]\n\n[cc-by-sa]: http://creativecommons.org/licenses/by-sa/3.0/\n[cc-by-sa-image]: https://licensebuttons.net/l/by-sa/3.0/88x31.png\n[cc-by-sa-shield]: https://img.shields.io/badge/License-CC%20BY--SA%204.0-lightgrey.svg\nThis package uses the [JMdict/EDICT](http://www.edrdg.org/wiki/index.php/JMdict-EDICT_Dictionary_Project) dictionary file. This file is the property of  the [Electronic Dictionary Research and Development Group](http://www.edrdg.org/), and is used in conformance with the Group's [licence](http://www.edrdg.org/edrdg/licence.html) which are made available under [Creative Commons Attribution-ShareAlike 3.0 Unported][cc-by-sa].","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsneruno%2Fjm_dict","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsneruno%2Fjm_dict","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsneruno%2Fjm_dict/lists"}