https://github.com/piedweb/textanalyzer
[PHP] Semantic Analysis : Extract Expressions from a text and order it by density.
https://github.com/piedweb/textanalyzer
Last synced: 4 months ago
JSON representation
[PHP] Semantic Analysis : Extract Expressions from a text and order it by density.
- Host: GitHub
- URL: https://github.com/piedweb/textanalyzer
- Owner: PiedWeb
- License: mit
- Created: 2019-01-08T14:11:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-20T15:52:18.000Z (over 5 years ago)
- Last Synced: 2025-04-24T05:34:00.489Z (about 1 year ago)
- Language: PHP
- Homepage: https://dev.piedweb.com/
- Size: 18.6 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Text Analyzer
[](https://github.com/PiedWeb/TextAnalyzer/tags)
[](LICENSE)
[](https://github.com/PiedWeb/TextAnalyzer/actions)
[](https://scrutinizer-ci.com/g/PiedWeb/TextAnalyzer)
[](https://codecov.io/gh/PiedWeb/TextAnalyzer/branch/main)
[](https://shepherd.dev/github/PiedWeb/TextAnalyzer)
[](https://packagist.org/packages/piedweb/text-analyzer)
Semantic Analysis : Extract Expressions from a text and order it by density.
## Install
Via [Packagist](https://img.shields.io/packagist/dt/piedweb/text-analyzer.svg?style=flat)
``` bash
$ composer require piedweb/text-analyzer
```
## Usage
``` php
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
``` bash
$ composer test
```
## Contributing
Please see [contributing](https://dev.piedweb.com/contributing)
## Credits
- [PiedWeb](https://piedweb.com)
- [All Contributors](https://github.com/PiedWeb/:package_skake/graphs/contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.