PHPackages                             writecrow/tag\_converter - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. writecrow/tag\_converter

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

writecrow/tag\_converter
========================

Converts tagged textfiles to JSON, PHP or XML

1.5(4y ago)0106MITPHPCI failing

Since May 13Pushed 4y ago4 watchersCompare

[ Source](https://github.com/writecrow/tag_converter)[ Packagist](https://packagist.org/packages/writecrow/tag_converter)[ Docs](https://tag-converter.markfullmer.com/)[ RSS](/packages/writecrow-tag-converter/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (7)Used By (0)

Corpus-tagged Text Converter
============================

[](#corpus-tagged-text-converter)

[![Circle CI](https://camo.githubusercontent.com/e9d0c8df48ae3d9c904945591202b36415b6588aa48d44a4c5d5f160ddd599c1/68747470733a2f2f636972636c6563692e636f6d2f67682f777269746563726f772f7461675f636f6e7665727465722e7376673f7374796c653d736869656c64)](https://circleci.com/gh/writecrow/tag_converter)

A PHP library for converting files tagged with corpus metadata to JSON, PHP, or XML.

[![Screenshot of Conversion](https://raw.githubusercontent.com/writecrow/tag_converter/master/demo/tagging-example.png)](https://raw.githubusercontent.com/writecrow/tag_converter/master/demo/tagging-example.png)

History
-------

[](#history)

Corpus linguistics researchers use a markup-like syntax to provide metadata about texts. For consumption by applications, this syntax needs to be converted into a more universal, machine-readable format. The format chosen was JSON.

Basic Usage
-----------

[](#basic-usage)

The included `/demo/index.php` file contains a conversion form demonstration.

Make your code aware of the TagConverter class via your favorite method (e.g., `use` or `require`)

Then pass a string of text into the class:

```
$text = TagConverter::json('My tagged text here');
echo $text;
// Returns {"MyTag":"123","text":"My tagged text here"}

$text = TagConverter::php('My tagged text here');
echo $text;
// Returns array('MyTag' => '123', 'text' => 'My tagged text here')

$text = TagConverter::xml('My tagged text here');
echo $text;
// Returns 123My tagged text here
```

Expected input format
---------------------

[](#expected-input-format)

The corpus style tagging syntax expected by the library is defined as follows:

1. Tags must be wrapped in ``
2. Tag names and tag values may only alphanumeric characters, spaces, underscores, and hypens.
3. Tag names must be separated from tag values by a `:`
4. Spaces at the beginning at end of tag names or tag values are ignored; spaces within tag values will be preserved
5. Everything not wrapped in `` will be considered "text"

StatusTag ExampleExplanationGood``Good``Spaces in tag names &amp; values OKGood`< My Tag : Some Text >`Spaces padding tag names &amp; values OKGood`< My-Tag : Some_Text >`Underscores &amp; hyphens OKGood```&lt; My-Tag : Value 1Value 2 &gt;```Good`< My-Tag : Value 1 ; Value 2 >`Semicolon separators for multiple valuesBad`< My/Tag : Some:Text >`Other characters not OKTesting
-------

[](#testing)

Unit Tests can be run (after `composer install`) by executing `vendor/bin/phpunit`

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~308 days

Recently: every ~294 days

Total

6

Last Release

1747d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/97841a43aa432072be5449d3a5a32869c123982b174cb8c1b7eb2010181e8949?d=identicon)[markfullmer](/maintainers/markfullmer)

![](https://www.gravatar.com/avatar/bfa4c33dc0c7ac05dbdd31f28413070cd3d1b02f67c7ba788d706a0b684e5fa4?d=identicon)[writecrow](/maintainers/writecrow)

---

Top Contributors

[![markfullmer](https://avatars.githubusercontent.com/u/4305692?v=4)](https://github.com/markfullmer "markfullmer (29 commits)")

---

Tags

corpusphp-libraryconversioncorpus

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/writecrow-tag-converter/health.svg)

```
[![Health](https://phpackages.com/badges/writecrow-tag-converter/health.svg)](https://phpackages.com/packages/writecrow-tag-converter)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M284](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M229](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M65](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M345](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
