承接 john-kariuki/urban-words 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

john-kariuki/urban-words

Composer 安装命令:

composer require john-kariuki/urban-words

包简介

Urban words, CheckpointOne Andela

README 文档

README

![Build Pass] (https://travis-ci.org/andela-jkariuki/CheckpointOne.svg?branch=master) Scrutinizer Code Quality Coverage Status

Urban Dictionary Agnostic PHP Package

Andela Checkpoint One.

Urban Words Manager

An urban words dictionary, Urban Word CRUD and Ranking System for word occurence in a sentence.

Word Rank Manager

Rank the occurence of words in a sentence.

#TIA

Installation

add the package to your projects folder

composer require john-kariuki/urban-words

Install packages using composer

composer install

Usage

Let's get using Urban Words

<?php
require 'vendor/autoload.php';

use John\Cp\UrbanWordsDatastore;
use John\Cp\UrbanWordsManager;
use John\Cp\WordRankManager;
use John\Exceptions\UrbanWordException;
use John\Exceptions\WordRankManagerException;
use John\Exceptions\WordManagerException;

//Class UrbanWordsDatastore contains a static array of urban words
print_r(UrbanWordsDatastore::$data);

/**
    * Class UrbanWordsManager performs CRUD methods on the $data array in UrbanWordsDataStore
    * Methods:
    * addWord(word, desc, sentence)
    * readWord(word)
    * updateWord(word, foo, bar, foobar)
    * deleteWord(word)
*/
try {

    $urbanWord = new UrbanWordsManager();

    //Add new word, description and sentence
    print_r($urbanWord->addWord('Bae', 'Endearing term for lover', 'Your bae has a bae'));

    //Pass slang word to read
    print_r($urbanWord->readWord('Bae'));

    //Update slang word details
    print_r($urbanWord->updateWord("Bae", "Foo", "Bar", "Foo Bar"));

    //Pass slang word to delete
    print_r($urbanWord->deleteWord('Turnt'));

    print_r($urbanWord->getWords());

} catch (WordManagerException $e) {
    echo $e->errorMessage();
}

//Class WordRankManager returns the frequency of occurence of a word in a sentence


try {
    $sentence = new WordRankManager("The big brown fox is just a big brown fox jumping up all in the lazy dog's business");
    print_r($sentence->ranker());
} catch (WordRankManagerException $e) {
    echo $e->errorMessage();
}

Contributing

Contributions are welcome and will be fully credited.

We accept contributions via Pull Requests on Github.

Pull Requests

  • PSR-2 Coding Standard - The easiest way to apply the conventions is to install PHP Code Sniffer.

  • Add tests! - Your patch won't be accepted if it doesn't have tests.

  • Document any change in behaviour - Make sure the README.md and any other relevant documentation are kept up-to-date.

  • Consider our release cycle - We try to follow SemVer v2.0.0. Randomly breaking public APIs is not an option.

  • Create feature branches - Don't ask us to pull from your master branch.

  • One pull request per feature - If you want to do more than one thing, send multiple pull requests.

  • Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.

Security

If you discover any security related issues, please email me at John Kariuki or create an issue.

Credits

John kariuki

License

The MIT License (MIT)

Copyright (c) 2016 John kariuki john.kariuki@andela.com

This is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-01-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固