2017 © Pedro Peláez
 

library urbandictionary

A package that helps in managing urban words (slang)

image

demola/urbandictionary

A package that helps in managing urban words (slang)

  • Saturday, April 2, 2016
  • by andela-araimi
  • Repository
  • 1 Watchers
  • 2 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Urban Dictionary

Coverage Status Scrutinizer Code Quality Build Status, (*1)


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., (*2)

Design


Classes, (*3)

  • UrbanWords: Contains an array where urban words are stored., (*4)

  • DictionaryEngine: Contain methods that add new word, retrieve the whole dictionary, retrieve word, update existing word, and delete word in the urban dictionary., (*5)

  • RankWord: Contain methods that rank words based on the number of times they occurred in the sentence., (*6)

Installation


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

    $ composer require demola/urbandictionary

Usage


The dictionary contains urban words with their meaning and usage, (*8)

  • Create a dictionaryManager instance, (*9)

     $dictionaryManager = new DictionaryEngine();
  • Add urban words to the dictionary, (*10)

           $dictionaryManager->add('word', 'description', 'sampleSentence'); // This returns true
  • Retrieve a word from the dictionary, (*11)

           $data = $dictionaryManager->retrieve('word');
  • Retrieve the whole dictionary, (*12)

           $data = $dictionaryManager->retrieveAll();              
  • Update a word, its meaning and its sample sentence, (*13)

         $data = $dictionaryManager->update('word', newDescription', 'newSampleSentence');
  • Delete a word in the urban dictionary, (*14)

         $dictionaryManager->delete('word'); // This returns true
  • Rank words in a sentence, (*15)

    • create a wordOccurence instance, (*16)

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

Testing


Run the following command in the urban-dictionary directory:, (*17)

      ~ phpunit

Change log


Please check out CHANGELOG file for information on what has changed recently., (*18)

Contributing


Please check out CONTRIBUTING file for detailed contribution guidelines., (*19)

Security


If you discover any issue, kindly contact ademola.raimi@andela.com, (*20)

Credits


Urban Dictionary is maintained by Raimi Ademola., (*21)

License


UrbanDictionary is released under the MIT Licence. See the bundled LICENSE file for more details., (*22)

The Versions

02/04 2016

dev-master

9999999-dev https://github.com/andela-araimi/Checkpoint-one.git

A package that helps in managing urban words (slang)

  Sources   Download

MIT

The Requires

 

The Development Requires

by Raimi Ademola

urban words