{"id":20893390,"url":"https://github.com/anezih/add_inflections","last_synced_at":"2025-05-12T22:33:05.563Z","repository":{"id":168399159,"uuid":"618116499","full_name":"anezih/add_inflections","owner":"anezih","description":"Add inflection information to any dictionary format supported by PyGlossary.","archived":false,"fork":false,"pushed_at":"2025-03-20T07:44:55.000Z","size":57126,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T13:11:19.503Z","etag":null,"topics":["dictionary-conversion","hunspell","inflection","mobi","morphology","onyx-boox","pyglossary","spylls","stardict"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anezih.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-03-23T19:36:54.000Z","updated_at":"2025-03-20T07:44:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"f206d801-bbb3-40b2-b642-ea9fa4681dcc","html_url":"https://github.com/anezih/add_inflections","commit_stats":null,"previous_names":["anezih/add_inflections"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anezih%2Fadd_inflections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anezih%2Fadd_inflections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anezih%2Fadd_inflections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anezih%2Fadd_inflections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anezih","download_url":"https://codeload.github.com/anezih/add_inflections/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253833456,"owners_count":21971421,"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-conversion","hunspell","inflection","mobi","morphology","onyx-boox","pyglossary","spylls","stardict"],"created_at":"2024-11-18T10:15:39.831Z","updated_at":"2025-05-12T22:33:00.522Z","avatar_url":"https://github.com/anezih.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Add inflection information to any dictionary format supported by PyGlossary.\r\n\r\n# Usage\r\n```\r\npython add_inflections.py --help\r\n```\r\n```\r\nusage: add_inflections.py [-h] -i INPUT_DICTIONARY_PATH [-u UNMUNCHED_PATH] [--glos-infl-sources INFL_GLOS_SOURCE_PATHS [INFL_GLOS_SOURCE_PATHS ...]]\r\n                          [--glos-infl-source-formats  [...]] [-hu  [...]] [--input-format] [--output-format] [-p] [-c] [-k]\r\n\r\nAdd inflection information to any dictionary format supported by PyGlossary.\r\n\r\noptions:\r\n  -h, --help            show this help message and exit\r\n  -i INPUT_DICTIONARY_PATH, --input-dictionary INPUT_DICTIONARY_PATH\r\n                        Input dictionary path. (default: None)\r\n  -u UNMUNCHED_PATH, --unmunched-json UNMUNCHED_PATH\r\n                        \u003clanguage\u003e.json(.gz) (default: None)\r\n  --glos-infl-sources INFL_GLOS_SOURCE_PATHS [INFL_GLOS_SOURCE_PATHS ...]\r\n                        Paths of dictionaries that will be used as an inflection source by-themselves or together with unmunched json file. Separate\r\n                        multiple sources with a space between them. (default: [])\r\n  --glos-infl-source-formats  [ ...]\r\n                        --glos-infl-sources dictionary format(s), allowed values are same as --input-format. Separate multiple formats with a space\r\n                        between them. (default: [])\r\n  -hu  [ ...], --hunspell-dic-paths  [ ...]\r\n                        Paths of the Hunspell .dic or .aff files. Separate multiple sources with a space between them. (default: [])\r\n  --input-format        Allowed values: Aard2Slob, ABCMedicalNotes, Almaany, AppleDictBin, BabylonBgl, CC-CEDICT, cc-kedict, CrawlerDir, Csv, Dicformids,\r\n                        Dictcc, Dictcc_split, DictOrg, Dictunformat, DigitalNK, ABBYYLingvoDSL, Dictfile, Edlin, FreeDict, GettextPo, Info, IUPACGoldbook,\r\n                        JMDict, JMnedict, LingoesLDF, OctopusMdict, Stardict, StardictTextual, Tabfile, Wordset, Xdxf, Zim (default: None)\r\n  --output-format       Allowed values: Aard2Slob, AppleDict, CrawlerDir, Csv, Dicformids, DictOrg, DictOrgSource, DiktJson, Epub2, Kobo, Dictfile, Mobi,\r\n                        Edlin, GettextPo, HtmlDir, Info, Json, LingoesLDF, Sql, Stardict, StardictTextual, Tabfile, Yomichan (default: Stardict)\r\n  -p, --add-prefixes    Add prefixes from the unmunched json. (default: False)\r\n  -c, --add-cross-products\r\n                        Add cross products from the unmunched json. (default: False)\r\n  -k, --keep            Keep existing inflections. (default: False)\r\n```\r\n\r\n## Example Usage\r\nTo illustrate, in order to add inflections from multiple sources to a DSL dictionary and saving the output in Stardict Textual Dictionary Format call the script as below:\r\n\r\n```\r\npython .\\add_inflections.py -i .\\test\\fra_tur.dsl -u .\\inflection_data\\French.json.gz --glos-infl-sources '.\\test\\MOBI_FR.xml' .\\test\\Babylon_FR.xml --glos-infl-source-formats StardictTextual StardictTextual -hu .\\test\\fr.dic --output-format StardictTextual\r\n```\r\n\r\nIn the example above we have used 4 inflection sources:\r\n- French.json.gz from the inflection_data folder,\r\n- MOBI_FR.xml StardictTextual dictionary,\r\n- Babylon_FR.xml StardictTextual dictionary,\r\n- fr.dic Hunspell dictionary\r\n\r\n### Some Notes:\r\n- If you omit the `--input-format`, PyGlossary will try to infer the format from the file extension.\r\n- If you omit the `--output-format`, output will default to StarDict format.\r\n- It is safer to specify all --glos-infl-sources formats in the --glos-infl-source-formats rather than expecting PyGlossary to infer them.\r\n\r\n# Required Packages\r\n\r\n```\r\npip install pyglossary==4.6.1\r\npip install spylls\r\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanezih%2Fadd_inflections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanezih%2Fadd_inflections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanezih%2Fadd_inflections/lists"}