{"id":23029672,"url":"https://github.com/antononcube/raku-dsl-entity-geographics","last_synced_at":"2025-04-02T20:25:41.286Z","repository":{"id":71383663,"uuid":"347645151","full_name":"antononcube/Raku-DSL-Entity-Geographics","owner":"antononcube","description":"Raku package with grammars for geographic entities.","archived":false,"fork":false,"pushed_at":"2024-06-16T14:15:15.000Z","size":877,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-08T11:13:07.789Z","etag":null,"topics":["geographic-data","grammar-parser","named-entity-recognition","raku"],"latest_commit_sha":null,"homepage":"https://raku.land/zef:antononcube/DSL::Entity::Geographics","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/antononcube.png","metadata":{"files":{"readme":"README-work.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-03-14T13:31:24.000Z","updated_at":"2024-06-16T14:15:18.000Z","dependencies_parsed_at":"2024-01-09T05:42:34.129Z","dependency_job_id":"51ff54ee-6d96-4c99-859f-3000b50300fa","html_url":"https://github.com/antononcube/Raku-DSL-Entity-Geographics","commit_stats":{"total_commits":70,"total_committers":2,"mean_commits":35.0,"dds":0.2857142857142857,"last_synced_commit":"85fdf6fb32b12c19d6a0ffb3e74fa73b3b7fe6d5"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-DSL-Entity-Geographics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-DSL-Entity-Geographics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-DSL-Entity-Geographics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antononcube%2FRaku-DSL-Entity-Geographics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antononcube","download_url":"https://codeload.github.com/antononcube/Raku-DSL-Entity-Geographics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246886495,"owners_count":20849874,"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":["geographic-data","grammar-parser","named-entity-recognition","raku"],"created_at":"2024-12-15T14:16:42.015Z","updated_at":"2025-04-02T20:25:41.263Z","avatar_url":"https://github.com/antononcube.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSL::Entity::Geographics\n\n\n[![MacOS](https://github.com/antononcube/Raku-DSL-Entity-Geographics/actions/workflows/macos.yml/badge.svg)](https://github.com/antononcube/Raku-DSL-Entity-Geographics/actions/workflows/macos.yml)\n[![Linux](https://github.com/antononcube/Raku-DSL-Entity-Geographics/actions/workflows/linux.yml/badge.svg)](https://github.com/antononcube/Raku-DSL-Entity-Geographics/actions/workflows/linux.yml)\n[![Win64](https://github.com/antononcube/Raku-DSL-Entity-Geographics/actions/workflows/windows.yml/badge.svg)](https://github.com/antononcube/Raku-DSL-Entity-Geographics/actions/workflows/windows.yml)\n[![https://raku.land/zef:antononcube/DSL::Entity::Geographics](https://raku.land/zef:antononcube/DSL::Entity::Geographics/badges/version)](https://raku.land/zef:antononcube/DSL::Entity::Geographics)\n[![License: Artistic-2.0](https://img.shields.io/badge/License-Artistic%202.0-0298c3.svg)](https://opensource.org/licenses/Artistic-2.0)\n\n\nRaku grammar classes for geographic entities (names.)\n\nThis package is closely related, but independent of \n[Data::Geographics](https://raku.land/zef:antononcube/Data::Geographics), [AAp5].\n\n## Installation\n\nFrom [Zef ecosystem](https://raku.land):\n\n```\nzef install DSL::Entity::Geographics\n```\n\nFrom GitHub:\n\n```\nzef install https://github.com/antononcube/Raku-DSL-Entity-Geographics.git\n```\n\n## Examples\n\n### Basic entity name retrieval\n\nHere we show how the entity ID is retrieved using an adjective:\n\n```perl6\nuse DSL::Entity::Geographics;\n\nToGeographicEntityCode('Brazilian');\n```\n\n### Identifiers\n\nThe known cities are have identifier in the form: `\u003ccountry\u003e.\u003cprovince\u003e.\u003ccity\u003e`.\nThe names in the identifiers have underscore characters (\"_\") instead of spaces.\nFor example: \n\n```\nUnited_States.Nevada.Las_Vegas\n```\n\n**Remark:** Both packages \"DSL::Entity::Geographics\" and \"Data::Geographics\" have \nthe same identifiers. \n\n### City specs\n\nThere is a dedicated function for parsing city names together with a state- or country name:\n\n```perl6\nentity-city-and-state-name('Chicago, IL')\n```\n\nIf the adverb `:exhaustive` (or just `:ex`) is used then all matches for city name in country (like USA)\nare returned:\n\n```perl6\n.say for entity-city-and-state-name('Atlanta United States'):ex\n```\n\nA city name without a specified country or state is considered a generic city name if found in the \ngazeteer database:\n\n```perl6\nsay entity-city-and-state-name('Miama');\n```\n\n**Remark:** Misspellings are recognized and allowed:\n\n### Grammar parsing\n\nOne of the main motivations for this package is to be able to use known country names and related adjectives\nas grammar tokens. For example, in packages like [\"DSL::English::FoodPreparationWorkflows\"](https://github.com/antononcube/Raku-DSL-English-FoodPreparationWorkflows), [AAp4].\n\nHere are few grammar parsing examples:\n\n```perl6\nuse DSL::Entity::Geographics::Grammar;\n\nmy $pCOMMAND = DSL::Entity::Geographics::Grammar.new;\n\n$pCOMMAND.set-resources(DSL::Entity::Geographics::resource-access-object());\n\nsay $pCOMMAND.parse('Argentina', rule =\u003e 'geographic-entity-command');\n```\n\n```perl6\nsay $pCOMMAND.parse('United States of America', rule =\u003e 'geographic-entity-command');\n```\n\nAgain, misspellings are recognized and allowed:\n\n```perl6\nsay $pCOMMAND.parse('Indianapolia, Indiana', rule =\u003e 'entity-city-and-state-name');\n```\n\n\n## References\n\n[AAp1] Anton Antonov,\n[DSL::Shared Raku package](https://github.com/antononcube/Raku-DSL-Shared),\n(2020),\n[GitHub/antononcube](https://github.com/antononcube).\n\n[AAp2] Anton Antonov,\n[DSL::Entity::Jobs Raku package](https://github.com/antononcube/Raku-DSL-Entity-Jobs),\n(2021),\n[GitHub/antononcube](https://github.com/antononcube).\n\n[AAp3] Anton Antonov,\n[DSL::Entity::Foods Raku package](https://github.com/antononcube/Raku-DSL-Entity-Foods),\n(2021),\n[GitHub/antononcube](https://github.com/antononcube).\n\n[AAp4] Anton Antonov,\n[DSL::English::FoodPreparationWorkflows Raku package](https://github.com/antononcube/Raku-DSL-English-FoodPreparationWorkflows),\n(2021),\n[GitHub/antononcube](https://github.com/antononcube).\n\n[AAp5] Anton Antonov,\n[Data::Geographics Raku package](https://github.com/antononcube/Raku-Data-Geographics),\n(2024),\n[GitHub/antononcube](https://github.com/antononcube).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantononcube%2Fraku-dsl-entity-geographics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantononcube%2Fraku-dsl-entity-geographics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantononcube%2Fraku-dsl-entity-geographics/lists"}