{"id":21740537,"url":"https://github.com/writecrow/tag_converter","last_synced_at":"2026-04-20T19:31:29.321Z","repository":{"id":48319396,"uuid":"91184839","full_name":"writecrow/tag_converter","owner":"writecrow","description":"Convert files tagged with corpus metadata to JSON, PHP, or XML.","archived":false,"fork":false,"pushed_at":"2021-08-01T20:33:25.000Z","size":506,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-08-23T19:25:45.605Z","etag":null,"topics":["corpus","php-library"],"latest_commit_sha":null,"homepage":"https://tag-converter.markfullmer.com","language":"PHP","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/writecrow.png","metadata":{"files":{"readme":"README.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}},"created_at":"2017-05-13T15:44:34.000Z","updated_at":"2021-08-01T20:33:27.000Z","dependencies_parsed_at":"2022-08-19T10:22:36.686Z","dependency_job_id":null,"html_url":"https://github.com/writecrow/tag_converter","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/writecrow/tag_converter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Ftag_converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Ftag_converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Ftag_converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Ftag_converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/writecrow","download_url":"https://codeload.github.com/writecrow/tag_converter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/writecrow%2Ftag_converter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062253,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["corpus","php-library"],"created_at":"2024-11-26T06:13:54.956Z","updated_at":"2026-04-20T19:31:29.305Z","avatar_url":"https://github.com/writecrow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Corpus-tagged Text Converter\n\n[![Circle CI](https://circleci.com/gh/writecrow/tag_converter.svg?style=shield)](https://circleci.com/gh/writecrow/tag_converter)\n\nA PHP library for converting files tagged with corpus metadata to JSON, PHP,\nor XML.\n\n![Screenshot of Conversion](https://raw.githubusercontent.com/writecrow/tag_converter/master/demo/tagging-example.png)\n\n## History\nCorpus linguistics researchers use a markup-like syntax to provide metadata\nabout texts. For consumption by applications, this syntax needs to be converted\ninto a more universal, machine-readable format. The format chosen was JSON.\n\n## Basic Usage\nThe included `/demo/index.php` file contains a conversion form demonstration.\n\nMake your code aware of the TagConverter class via your favorite method (e.g.,\n`use` or `require`)\n\nThen pass a string of text into the class:\n```php\n$text = TagConverter::json('\u003cMyTag: 123\u003eMy tagged text here');\necho $text;\n// Returns {\"MyTag\":\"123\",\"text\":\"My tagged text here\"}\n\n$text = TagConverter::php('\u003cMyTag: 123\u003eMy tagged text here');\necho $text;\n// Returns array('MyTag' =\u003e '123', 'text' =\u003e 'My tagged text here')\n\n$text = TagConverter::xml('\u003cMyTag: 123\u003eMy tagged text here');\necho $text;\n// Returns \u003c?xml version=\"1.0\"?\u003e\u003croot\u003e\u003cMyTag\u003e123\u003c/MyTag\u003e\u003ctext\u003eMy tagged text here\u003c/text\u003e\u003c/root\u003e\n```\n\n## Expected input format\nThe corpus style tagging syntax expected by the library is defined as follows:\n1. Tags must be wrapped in ```\u003c``` and ```\u003e```\n2. Tag names and tag values may only alphanumeric characters, spaces,\nunderscores, and hypens.\n3. Tag names must be separated from tag values by a ```:```\n4. Spaces at the beginning at end of tag names or tag values are ignored;\nspaces within tag values will be preserved\n5. Everything not wrapped in ```\u003c``` and ```\u003e``` will be considered \"text\"\n\n\n| Status | Tag Example | Explanation\n| --- | --- | --- |\n| Good | ```\u003cMyTag:SomeText\u003e``` | |\n| Good | ```\u003cMy Tag:Some Text\u003e``` | Spaces in tag names \u0026 values OK |\n| Good | ```\u003c My Tag : Some Text \u003e``` | Spaces padding tag names \u0026 values OK|\n| Good | ```\u003c My-Tag : Some_Text \u003e``` | Underscores \u0026 hyphens OK|\n| Good | ```\u003c My-Tag : Value 1 | Value 2 \u003e``` | Pipe separators for multiple values|\n| Good | ```\u003c My-Tag : Value 1 ; Value 2 \u003e``` | Semicolon separators for multiple values|\n| Bad | ```\u003c My/Tag : Some:Text \u003e``` | Other characters not OK|\n\n## Testing\nUnit Tests can be run (after ```composer install```) by executing ```vendor/bin/phpunit```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritecrow%2Ftag_converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwritecrow%2Ftag_converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwritecrow%2Ftag_converter/lists"}