PHPackages                             rb/polygen-php - 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. rb/polygen-php

ActiveLibrary

rb/polygen-php
==============

A PHP implementation of Polygen - A random sentence generator.

v1.2.1(3y ago)10211LGPL-3.0-onlyPHPPHP ^5.6 || ^7.0CI failing

Since May 23Pushed 3y ago2 watchersCompare

[ Source](https://github.com/RBastianini/polygen-php)[ Packagist](https://packagist.org/packages/rb/polygen-php)[ RSS](/packages/rb-polygen-php/feed)WikiDiscussions dev Synced 2mo ago

READMEChangelog (4)Dependencies (6)Versions (5)Used By (0)

Polygen-PHP
===========

[](#polygen-php)

[Polygen](https://github.com/alvisespano/Polygen) is a tool that parses text files containing a grammar definition and generates text according to that definition. Polygen-PHP does the same, but in PHP 5.6+ and is compatible with the same grammar files, so now you can use Polygen on your website even if it's on a shared hosting service.

For example, the following grammar file

```
S ::= this is Subject and is Quantity Adjective;
Subject ::= a grammar | polygen;
Quantity ::= rather | quite | very;
Adjective ::= interesting | remarkable | dumb;

```

might result in the following sentences being generated:

- this is a grammar and is rather dumb
- this is polygen and is quite remarkable
- this is a grammar and is very interesting

... and so on.

There are many more features in the language, check out the [official Polygen documentation](http://htmlpreview.github.io/?https://github.com/alvisespano/Polygen/blob/dca27bd02613613d60a0e024c1668e8459de7288/docs/polygen-spec_EN.html)to learn everything about it.

Installation
------------

[](#installation)

You can install Polygen-PHP using composer: `composer require rb/polygen-php`

Usage instructions
------------------

[](#usage-instructions)

```
