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)0107MITPHPCI 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 3w 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 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

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

1795d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4305692?v=4)[Mark Fullmer](/maintainers/markfullmer)[@markfullmer](https://github.com/markfullmer)

![](https://avatars.githubusercontent.com/u/27739911?v=4)[Corpus &amp; Repository of Writing (Crow)](/maintainers/writecrow)[@writecrow](https://github.com/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

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M45](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[moonshine/layouts-field

Field for repeating groups of fields for MoonShine

108.5k](/packages/moonshine-layouts-field)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

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