ropendev/expression

Text Analyser: Extract Expression from a text and order it by density.

0.0.6 2019-01-06 07:53 UTC

This package is auto-updated.

Last update: 2024-12-07 02:17:02 UTC


README

Install

Via Packagist

Usage

use \rOpenDev\curl\CurlRequest;

...
// Configure
$test = new \rOpenDev\ExtractExpression\ExtractExpression();
$test->onlyInSentence     = true; // Default value: FALSE
$test->expressionMaxWords = 5;    // Max expression size in words
$test->keepTrail          = 5; // Don't keep trail for less than 3 occurences found ine one text
$test->addContent("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed...");

// Get Results
$test->getExpressions(int max = 0); // @return array with expression => number
$test->getTrail('expression'); // @return array with sentence where we find expression (best with onlyInSentence = true)
$test->getTrails(); // @return array with expression => array trails

$test->getWordNumber(); // @return int

Contribute

To send a pull resquest

  1. Please check if test are still running without error (phpunit)
  2. Check coding standard before to commit : php-cs-fixer fix src --rules=@Symfony --verbose && php-cs-fixer fix src --rules='{"array_syntax": {"syntax": "short"}}' --verbose

Contributors

Latest Version Build Status Quality Score Total Downloads