PHP code example of ksanyok / text-humanize

1. Go to this page and download the library: Download ksanyok/text-humanize 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/ */

    

ksanyok / text-humanize example snippets



use TextHumanize\TextHumanize;

$th = new TextHumanize();

$result = $th->humanize("Text to process", "en", [
    "profile" => "web",
    "intensity" => 70,
]);
echo $result->text;
echo $result->changeRatio;

$ai = $th->detectAi("Check this text", "en");
echo $ai["score"] . " — " . $ai["verdict"];
bash
# PHP
cd php/ && composer install

# TypeScript
cd js/ && npm install
bash
cd php/ && composer install && vendor/bin/phpunit