PHP code example of svetlyi / markov-based-text-gen

1. Go to this page and download the library: Download svetlyi/markov-based-text-gen library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

svetlyi / markov-based-text-gen example snippets


$sentence = 'any entry showing that sector 123 is occupied';
$model = new Model(1);
$model->learnFromSentence($sentence);
echo $model->generateSentence(10);