PHPackages                             refactor73/autotextgen - 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. refactor73/autotextgen

ActiveLibrary

refactor73/autotextgen
======================

A simple document driven text generation written in PHP

0.0.1(5y ago)012MITPHPPHP ^7.4

Since Sep 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/refactor73/auto-text-gen)[ Packagist](https://packagist.org/packages/refactor73/autotextgen)[ Docs](https://gitlab.com/crisk/autotextgen)[ RSS](/packages/refactor73-autotextgen/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

auto-text-gen
=============

[](#auto-text-gen)

A simple document driven text composer.

Description
-----------

[](#description)

Writing natural language text blocks based on context and decisions parsed from a JSON document. The context contains the properties of the JSON document itself and can be added to the text as ${variables}, while the decision table contains bool values based on pre executed custom conditions and are used in \[IF $decision\] control structures.

Example
-------

[](#example)

```
$context = Context::fromArray([
    'trend' => 10,
    'total' => 90,
]);

$decisionTable = DecisionTable::fromArray([
    'isNegative' => false,
]);

$textComposer = new TextComposer($decisionTable, $context);

$result = $textComposer->compose(
    '{In dieser Woche|Aktuell} ist der Wert um ${trend} auf ${total} Punkte ' .
    '[IF $isNegative] gefallen [ELSE] gestiegen [ENDIF].'
);
```

Possible result are:

```
In dieser Woche ist der Wert um 10 auf 90 Punkte gestiegen.

```

or

```
Aktuell ist der Wert um 10 auf 90 Punkte gestiegen.

```

Manipulators
------------

[](#manipulators)

SyntaxDescription{synonym1|synonym2|synonym3}Random choose a synonym out of list${var}Variable name from context\[IF $decision\] ... \[ENDIF\]if control structure\[IF $decision\] ... \[ELSE\] ... \[ENDIF\]if else control structureUse case
--------

[](#use-case)

Generating varied text for a customer metric report based on a JSON document.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

2056d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/973688082e4e4f0c56f99a4f23731f68363b8f381cbdfd9764150eba4563a558?d=identicon)[refactor73](/maintainers/refactor73)

---

Top Contributors

[![refactor73](https://avatars.githubusercontent.com/u/57440806?v=4)](https://github.com/refactor73 "refactor73 (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/refactor73-autotextgen/health.svg)

```
[![Health](https://phpackages.com/badges/refactor73-autotextgen/health.svg)](https://phpackages.com/packages/refactor73-autotextgen)
```

PHPackages © 2026

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