piedweb/text-analyzer

Semantic Analysis : Extract Expressions from a text and order it by density.

v0.0.4 2021-01-20 15:31 UTC

This package is auto-updated.

Last update: 2022-01-20 18:04:37 UTC


README

Open Source Package

Text Analyzer

Latest Version Software License GitHub Tests Action Status Quality Score Code Coverage Type Coverage Total Downloads

Semantic Analysis : Extract Expressions from a text and order it by density.

Install

Via Packagist

$ composer require piedweb/text-analyzer

Usage

use \PiedWeb\ExpressionHarvester\MultiAnalyzer;

$test = new MultiAnalyzer($onlyInSentence = true, $expressionMaxWords = 5, $keepTrail = 5);

$result = $test->addContent("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed...");  // @return \PiedWeb\TextAnalyzer\Analysis
    $result->getExpressions(); // @return array
    $result->getTrails(); // @return array
    $result->getTrail('expression'); // @return array
    $result->getWordNumber(); // @çeturn int

$results = $test->exec(); // @return \PiedWeb\TextAnalyzer\Analysis
    // same methods except in get expression, the value for each expression is not anymore his number

Testing

$ composer test

Contributing

Please see contributing

Credits

License

The MIT License (MIT). Please see License File for more information.