{"id":20452836,"url":"https://github.com/axtk/glyphmap","last_synced_at":"2025-10-24T05:52:27.997Z","repository":{"id":162709057,"uuid":"636910594","full_name":"axtk/glyphmap","owner":"axtk","description":"Nonlinear custom translit converter","archived":false,"fork":false,"pushed_at":"2024-10-22T08:37:32.000Z","size":432,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T14:48:08.464Z","etag":null,"topics":["romanization","translit","transliteration"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/glyphmap","language":"TypeScript","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/axtk.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,"publiccode":null,"codemeta":null}},"created_at":"2023-05-06T00:34:57.000Z","updated_at":"2024-10-22T08:37:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"1136a491-e632-4a0e-90a1-f610fb504564","html_url":"https://github.com/axtk/glyphmap","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fglyphmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fglyphmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fglyphmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/axtk%2Fglyphmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/axtk","download_url":"https://codeload.github.com/axtk/glyphmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248658268,"owners_count":21140914,"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":["romanization","translit","transliteration"],"created_at":"2024-11-15T11:10:32.844Z","updated_at":"2025-10-24T05:52:27.988Z","avatar_url":"https://github.com/axtk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# glyphmap\n\n- Converts texts based on custom transliteration rulesets;\n- Supports conditional conversion based on the environment of a character.\n\n## Command-line interface\n\n```\nnpx glyphmap \u003ctext\u003e -c \u003cconfig_location\u003e [-o \u003coutput_path\u003e]\nnpx glyphmap -i \u003cinput_path\u003e -c \u003cconfig_location\u003e [-o \u003coutput_path\u003e]\n```\n\n`\u003cconfig_location\u003e` is either a file path or a URL.\n\n***Example***\n\n```\nnpx glyphmap \"привет\" -c https://raw.githubusercontent.com/axtk/translit/master/configs/ru.json\n\u003e privet\n```\n\nNote that this package doesn't bring along specific rulesets. The URL in the example above is an external ruleset.\n\n## Code-based usage\n\nInstallation: `npm i glyphmap`\n\n```js\nimport { transform } from \"glyphmap\";\n\nlet { output } = transform(\"text\", config);\n```\n\n## Transform config\n\nThe following examples show parts of JSON configs with comments added here for simplicity which shouldn't be included in `.json` files (since comments are disallowed by the JSON format).\n\n***Example 1***\n\n```\n{\n  \"map\": [\n    {\n      // Maps \"и\" to \"i\"\n      \"key\": \"и\",\n      \"to\": \"i\",\n    },\n    {\n      \"key\": \"я\",\n      \"to\": \"ja\",\n    }\n  ]\n}\n```\n\n***Example 2***\n\n```\n{\n  \"def\": {\n    \"consonant\": [\n      \"б\", \"в\", \"г\", \"д\", \"ж\", \"з\", \"й\", \"к\", \"л\", \"м\", \"н\",\n      \"п\", \"р\", \"с\", \"т\", \"ф\", \"х\", \"ц\", \"ч\", \"ш\", \"щ\"\n    ],\n  },\n  \"map\": [\n    {\n      \"key\": \"я\",\n      // Matches \"я\" in \"жя\", \"чя\", \"шя\", or \"йя\".\n      \"from\": [[\"ж\", \"ч\", \"ш\", \"й\"], \"я\"],\n      // `~` leaves the character [\"ж\", \"ч\", \"ш\", \"й\"] unchanged with\n      // this particular rule, while \"я\" is mapped to \"a\".\n      \"to\": [\"~\", \"a\"]\n    },\n    {\n      \"key\": \"я\",\n      // Matches \"я\" in \"\u003cconsonant\u003eя\". `'#consonant'` refers to the\n      // `consonant` entry of the config's `def` above, which simplifies\n      // the reuse of character groups. Note that some consonants have\n      // already been handled by the rule above, so this rule will not\n      // be applied for those consonants allowing for cascadable rules\n      // (the order of the rules matters).\n      \"from\": [\"#consonant\", \"я\"],\n      \"to\": [\"~\", \"ia\"]\n    }\n  ],\n  // Disregards the listed characters when the environment of the input\n  // characters is figured out. (In this example, it's the acute accent\n  // used as a stress mark.)\n  \"ignore\": [\"\\u0301\"]\n}\n```\n\n***Example 3***\n\n```\n{\n  \"def\": {\n    \"vowel\": [\n      \"а\", \"е\", \"ё\", \"и\", \"о\", \"у\", \"ы\", \"э\", \"ю\", \"я\"\n    ]\n  },\n  \"map\": [\n    {\n      \"key\": \"и\",\n      // `NOT` negates the following character group.\n      \"from\": [\"и\", \"й\", \"NOT #vowel\"],\n      \"to\": [\"í\", \"\", \"~\"]\n    },\n    {\n      \"key\": \"и\",\n      // `OTHER` excludes the current `key` from the following group.\n      \"from\": [\"OTHER #vowel\", \"и\"],\n      \"to\": [\"~\", \"í\"]\n    }\n  ]\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtk%2Fglyphmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxtk%2Fglyphmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxtk%2Fglyphmap/lists"}