PHPackages                             masroore/keyword-density - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. masroore/keyword-density

ActiveLibrary[File &amp; Storage](/categories/file-storage)

masroore/keyword-density
========================

Keyword density analyzer. Word frequency counter.

0.0.2.1(1y ago)03992MITPHPPHP ^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4

Since Jun 12Pushed 1y ago1 watchersCompare

[ Source](https://github.com/masroore/php-keyword-density)[ Packagist](https://packagist.org/packages/masroore/keyword-density)[ Docs](https://github.com/masroore/php-keyword-density)[ RSS](/packages/masroore-keyword-density/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (15)Versions (4)Used By (0)

PHP Keyword Density, Word Frequency
===================================

[](#php-keyword-density-word-frequency)

[![Latest Version on Packagist](https://camo.githubusercontent.com/43be3403e6d090886c912c14a30339daed76bb2f61dd623b14cdcc519b2d8bfc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6173726f6f72652f6b6579776f72642d64656e736974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masroore/keyword-density)[![GitHub Tests Action Status](https://camo.githubusercontent.com/33b9993fcea29db9bd6795f151ced2172e56d47c2fbdbea9c8da978cfa23b716/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6173726f6f72652f7068702d6b6579776f72642d64656e736974792f72756e2d74657374733f6c6162656c3d7465737473)](https://github.com/masroore/keyword-density/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/a71fc3a28a59ffd4bbcf80b3c6965f1d705feacf254e6093a030102b080a8b29/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6d6173726f6f72652f7068702d6b6579776f72642d64656e736974792f436865636b253230262532306669782532307374796c696e673f6c6162656c3d636f64652532307374796c65)](https://github.com/masroore/php-keyword-density/actions?query=workflow%3A%22Check+%26+fix+styling%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/25995d6943df24ab3fff43f7550606f47e86725994f109f87324a1aae6fc6d6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6173726f6f72652f6b6579776f72642d64656e736974792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/masroore/keyword-density)

Calculates the keyword density of a text as described in [Wikipedia](https://en.wikipedia.org/wiki/Keyword_density). Counts the frequency usage of each word in a text.

Keyword density is the percentage of times a keyword or phrase appears on a text compared to the total number of words on the text. The word frequency counter PHP package can be used to count the frequency usage of each word in a text.

Installation
------------

[](#installation)

> **Requires [PHP 8.0+](https://php.net/releases/)**

You can install the package via composer:

```
composer require masroore/keyword-density
```

Usage
-----

[](#usage)

```
$kw = new Kaiju\KeywordDensity\KeywordDensity();
$kw->setText($text);
print_r($kw->getPopularWords());
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Thank you for considering to contribute to this project. All the contribution guidelines are mentioned [here](CONTRIBUTING.md).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Masroor Ehsan](https://github.com/masroore)
- [All Contributors](../../contributors)

License
-------

[](#license)

This project is an open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance46

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~509 days

Total

3

Last Release

412d ago

PHP version history (2 changes)0.0.1PHP ^8.0 || ^8.1

0.0.2.1PHP ^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/200963?v=4)[Masroor Ehsan](/maintainers/masroore)[@masroore](https://github.com/masroore)

---

Top Contributors

[![masroore](https://avatars.githubusercontent.com/u/200963?v=4)](https://github.com/masroore "masroore (12 commits)")

---

Tags

phphtmlfilewordtextkeywordsseofrequencyanalyzerdensityword frequencykeyword density

###  Code Quality

TestsPest

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/masroore-keyword-density/health.svg)

```
[![Health](https://phpackages.com/badges/masroore-keyword-density/health.svg)](https://phpackages.com/packages/masroore-keyword-density)
```

###  Alternatives

[blueimp/jquery-file-upload

File Upload widget for jQuery.

141.5M18](/packages/blueimp-jquery-file-upload)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
