Download the PHP package heidilabs/markov-php without Composer

On this page you can find all versions of the php package heidilabs/markov-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package markov-php

markov-php

Warning: this project is highly experimental.

Usage

Just clone and run composer install to create the autoloader. Not necessary if you just want to use the CLI script.

Using the Library in your Project

markov-php is available on Packagist for installation through Composer. heidilabs/markov-php

    $ composer require heidilabs/markov-php "~0.2"

Demos

Word Chain

CLI:

    $ php chainer.php -r demos/resources/mobydick.txt

example output:

to cast anchor in the deep; for heavy chains are being dragged along the cycloid, my soapstone for example, will

Script:

    <?php

    require_once(__DIR__ . '/../vendor/autoload.php');

    $sample = file_get_contents(__DIR__ . '/resources/nietzsche.txt');

    $chain = new MarkovPHP\WordChain($sample, 2);
    $sentence = $chain->generate(10);

    echo "YOUR PIECE OF WISDOM FROM NIETZSCHE<br><br>";
    echo $sentence;

example output:

must be contrary to their pride, and also more mysterious, than one thinks: the capable man in the purity of his character

Word Chain - Theme

CLI:

    $ php chainer.php -r demos/resources/mobydick.txt -t love

example output:

love of neatness in seamen; some of whom would not have that ferule and buckle-screw; I'll be ready for them

    <?php
    require_once(__DIR__ . '/../vendor/autoload.php');

    $sample = file_get_contents(__DIR__ . '/resources/nietzsche.txt');

    $chain = new MarkovPHP\WordChain($sample, 2);
    $theme = "hate";
    $sentence = $chain->generate(10, $theme);

    echo "YOUR PIECE OF WISDOM FROM NIETZSCHE, ABOUT: $theme<br><br>";
    echo $sentence;

example output:

they hate thee, and me, and half-and-half, and impure!-- Ah, I cast hail-showers into the depths. Violently will my breast then heave;

Mixed Source

Combines two different sources and creates a simple chain with two connected parts:

    <?php
    require_once(__DIR__ . '/../vendor/autoload.php');

    $sample1 = file_get_contents(__DIR__ . '/resources/nietzsche.txt');
    $sample2 = file_get_contents(__DIR__ . '/resources/mobydick.txt');

    $chain = new \MarkovPHP\MixedSourceChain($sample1, $sample2);
    $sentence = $chain->generate();

    echo "RESULT:<br>";
    echo $sentence;

example output:

do so, proves that he is probably not only strong, she keeps so many moody secrets. The schools composing none


All versions of markov-php with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package heidilabs/markov-php contains the following files

Loading the files please wait ....