PHPackages                             wilson/cp1 - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wilson/cp1

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wilson/cp1
==========

simple urban dictionary

16PHP

Since Oct 22Pushed 10y ago1 watchersCompare

[ Source](https://github.com/andela-womokoro/urban_dictionary)[ Packagist](https://packagist.org/packages/wilson/cp1)[ RSS](/packages/wilson-cp1/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

UrbanDictionary
===============

[](#urbandictionary)

[![Build Status](https://camo.githubusercontent.com/83c8dfdb55a02939b56052af421421488e544fe1d6c5528c18e639037d3bf44b/68747470733a2f2f7472617669732d63692e6f72672f616e64656c612d776f6d6f6b6f726f2f757262616e5f64696374696f6e6172792e737667)](https://travis-ci.org/andela-womokoro/urban_dictionary)

Urban dictionary is a package that stores urban words (slangs) and their meanings in an associative array. It also stores examples of how each urban word is used. The meaning of urban words can be edited, and words can be deleted from the dictionary.

The package also ranks words in a sentence based on the number of occurrence of each word in any given sentence.

Design
------

[](#design)

The package contains the following classes

- UrbanWords: contains the array where urban words are stored i.e. the dictionary
- Crud: contains methods to read words from the dictionary, add new words, update the meaning of existing words, and delete words.
- Ranking: contains methods to count the occurrences of words in any given sentence and rank the words based on their occurrence.

Install
-------

[](#install)

via composer

```
$ composer require wilson/cp1

```

Usage
-----

[](#usage)

- Add urban words to the dictionary

```
$array = ["slang"=>"word", "description"=>"meaning of word", "sample-sentence"=>"example usage"];
Crud::create($array);

```

- Retrieve all words in the dictionary

```
$arr = Crud::getAll();

```

- Retrieve a single word from the dictionary

```
$arr = Crud::find("word");

```

- Update a word, its meaning, or its sample sentence

```
Crud::update("word", "field to update", "new value");

```

- Delete a word

```
Crud::delete("word");

```

- Rank words in a sentence

```
$sampleSentence = "a sample sentence...";
print_r(Ranking::rank($sampleSentence));

```

Testing
-------

[](#testing)

If the folder containing your test classes is "tests"

```
$ phpunit tests

```

Change log
----------

[](#change-log)

Please check out [CHANGELOG](CHANGELOG.md) file for information on what has changed recently.

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

[](#contributing)

Please check out [CONTRIBUTING](CONTRIBUTING.md) file for detailed contribution guidelines.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

Urban Dictionary is maintained by Wilson Omokoro.

License
-------

[](#license)

UrbanDictionary is released under the MIT Licence. See the bundled [LICENSE](LICENSE.md) file for more details.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f588bc98eb99d3574ab04692cc6d9238e1f2c43aa67856a6791f606d57e2d386?d=identicon)[wil](/maintainers/wil)

---

Top Contributors

[![wilmkr](https://avatars.githubusercontent.com/u/13233311?v=4)](https://github.com/wilmkr "wilmkr (34 commits)")

### Embed Badge

![Health badge](/badges/wilson-cp1/health.svg)

```
[![Health](https://phpackages.com/badges/wilson-cp1/health.svg)](https://phpackages.com/packages/wilson-cp1)
```

###  Alternatives

[fishpig/magento2-wordpress-integration

Securely integrate WordPress and Magento 2.

83369.2k7](/packages/fishpig-magento2-wordpress-integration)

PHPackages © 2026

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