PHPackages                             demola/urbandictionary - 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. demola/urbandictionary

ActiveLibrary

demola/urbandictionary
======================

A package that helps in managing urban words (slang)

20[1 issues](https://github.com/andela-araimi/Checkpoint-one/issues)PHP

Since Apr 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/andela-araimi/Checkpoint-one)[ Packagist](https://packagist.org/packages/demola/urbandictionary)[ RSS](/packages/demola-urbandictionary/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

**Urban Dictionary**
====================

[](#urban-dictionary)

[![Coverage Status](https://camo.githubusercontent.com/0580aa20d3c0fe714c8ab49e7a194efe18ea08fec8d1bc0574f805f92d202ba6/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f616e64656c612d617261696d692f436865636b706f696e742d6f6e652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/andela-araimi/Checkpoint-one?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/bcce5619f893e4e013ef3e45aa114c013b381a408a6ba653ba1fc25c925c077d/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f616e64656c612d617261696d692f436865636b706f696e742d6f6e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/andela-araimi/Checkpoint-one/?branch=master) [![Build Status](https://camo.githubusercontent.com/95d4dc91e43719b783ed98cd3a07bf1e82aa7c47f19fbb1304bc8a5cf964dd30/68747470733a2f2f7472617669732d63692e6f72672f616e64656c612d617261696d692f436865636b706f696e742d6f6e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/andela-araimi/Checkpoint-one)

---

The Urban dictionary is the collation of urban words. It is a package that stores meaning and usage of words in a multi associative array. The package allows for addition, editing, updating and retrieving of words in the dictionary.

**Design**
----------

[](#design)

---

Classes

- UrbanWords: Contains an array where urban words are stored.
- DictionaryEngine: Contain methods that add new word, retrieve the whole dictionary, retrieve word, update existing word, and delete word in the urban dictionary.
- RankWord: Contain methods that rank words based on the number of times they occurred in the sentence.

**Installation**
----------------

[](#installation)

---

To install this package, PHP 5.5+ and composer are required. After these requirements have been met, type the following code

```
    $ composer require demola/urbandictionary

```

**Usage**
---------

[](#usage)

---

The dictionary contains urban words with their meaning and usage

- Create a dictionaryManager instance

    ```
      $dictionaryManager = new DictionaryEngine();

    ```
- Add urban words to the dictionary

    ```
     	   $dictionaryManager->add('word', 'description', 'sampleSentence'); // This returns true

    ```
- Retrieve a word from the dictionary

    ```
     	   $data = $dictionaryManager->retrieve('word');

    ```
- Retrieve the whole dictionary

    ```
     	   $data = $dictionaryManager->retrieveAll();

    ```
- Update a word, its meaning and its sample sentence

    ```
     	 $data = $dictionaryManager->update('word', newDescription', 'newSampleSentence');

    ```
- Delete a word in the urban dictionary

    ```
     	 $dictionaryManager->delete('word'); // This returns true

    ```
- Rank words in a sentence

    - create a wordOccurence instance

        ```
         $wordOccurence = new RankWord;

         $ranking = $wordOccurence->rankWord($word));

        ```

**Testing**
-----------

[](#testing)

---

Run the following command in the urban-dictionary directory:

```
      ~ phpunit

```

**Change log**
--------------

[](#change-log)

---

Please check out [CHANGELOG](https://github.com/andela-araimi/Checkpoint-one/blob/master/CHANGELOG.md/%22CHANGELOG%22) file for information on what has changed recently.

**Contributing**
----------------

[](#contributing)

---

Please check out [CONTRIBUTING](https://github.com/andela-araimi/Checkpoint-one/edit/master/CONTRIBUTING.md/%22CONTRIBUTING%22) file for detailed contribution guidelines.

**Security**
------------

[](#security)

---

If you discover any issue, kindly contact

**Credits**
-----------

[](#credits)

---

Urban Dictionary is maintained by Raimi Ademola.

**License**
-----------

[](#license)

---

UrbanDictionary is released under the [MIT Licence](https://github.com/andela-araimi/Checkpoint-one/blob/master/LICENSE.md/%22MIT%20License%22). See the bundled LICENSE file for more details.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor4

4 contributors hold 50%+ of commits

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/f0e258a6b7938213c1fcb4f47a28c6a48b19a51891fe5f81c98414ad00b9b62e?d=identicon)[andela-araimi](/maintainers/andela-araimi)

---

Top Contributors

[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (29 commits)")[![frankdejonge](https://avatars.githubusercontent.com/u/534693?v=4)](https://github.com/frankdejonge "frankdejonge (13 commits)")[![RobLoach](https://avatars.githubusercontent.com/u/25086?v=4)](https://github.com/RobLoach "RobLoach (7 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (5 commits)")[![reinink](https://avatars.githubusercontent.com/u/882133?v=4)](https://github.com/reinink "reinink (5 commits)")[![marcqualie](https://avatars.githubusercontent.com/u/101022?v=4)](https://github.com/marcqualie "marcqualie (4 commits)")[![ravage84](https://avatars.githubusercontent.com/u/625761?v=4)](https://github.com/ravage84 "ravage84 (4 commits)")[![colinodell](https://avatars.githubusercontent.com/u/202034?v=4)](https://github.com/colinodell "colinodell (4 commits)")[![hassankhan](https://avatars.githubusercontent.com/u/1781985?v=4)](https://github.com/hassankhan "hassankhan (3 commits)")[![browner12](https://avatars.githubusercontent.com/u/5232313?v=4)](https://github.com/browner12 "browner12 (3 commits)")[![Princessdada](https://avatars.githubusercontent.com/u/106841602?v=4)](https://github.com/Princessdada "Princessdada (3 commits)")[![alexbilbie](https://avatars.githubusercontent.com/u/77991?v=4)](https://github.com/alexbilbie "alexbilbie (2 commits)")[![kdubuc](https://avatars.githubusercontent.com/u/895661?v=4)](https://github.com/kdubuc "kdubuc (2 commits)")[![EmanueleMinotto](https://avatars.githubusercontent.com/u/417201?v=4)](https://github.com/EmanueleMinotto "EmanueleMinotto (2 commits)")[![mAAdhaTTah](https://avatars.githubusercontent.com/u/4371429?v=4)](https://github.com/mAAdhaTTah "mAAdhaTTah (2 commits)")[![assertchris](https://avatars.githubusercontent.com/u/200609?v=4)](https://github.com/assertchris "assertchris (2 commits)")[![schmittjoh](https://avatars.githubusercontent.com/u/197017?v=4)](https://github.com/schmittjoh "schmittjoh (1 commits)")[![Anahkiasen](https://avatars.githubusercontent.com/u/1321596?v=4)](https://github.com/Anahkiasen "Anahkiasen (1 commits)")[![barryvdh](https://avatars.githubusercontent.com/u/973269?v=4)](https://github.com/barryvdh "barryvdh (1 commits)")[![bencorlett](https://avatars.githubusercontent.com/u/181919?v=4)](https://github.com/bencorlett "bencorlett (1 commits)")

### Embed Badge

![Health badge](/badges/demola-urbandictionary/health.svg)

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

PHPackages © 2026

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