Giter VIP home page Giter VIP logo

kana2initial's Introduction

kana2initial

ひらがなをローマ字の頭文字に変換するだけ

Install

通常

Packagist には登録してないので、 KanaToInitial.php をDLなりコピペして好きなところに置く。

どうしても composer で管理したい

利用するプロジェクトの composer.json に以下を追加する。

"repositories": {
    "kana2initial": {
        "type": "vcs",
        "url": "https://github.com/shimoning/kana2initial.git"
    }
},

"require": {
    "shimoning/kana2initial": ">=0.0.1"
},

その後以下でインストールする。

composer update shimoning/kana2initial

Usage

基本

KanaToInitial::convert('ひらがな'); // -> H

初期化関数

ヘボン式やら行の扱いを変更できる。 static なので、一度変更すると移行 convert を呼び出すときにその設定がそのまま利用される。 デフォルトではどちらも初期値は false で無効になっている。

KanaToInitial::init($hebon, $replaceR2L)

ヘボン式

KanaToInitial::init(true);
KanaToInitial::convert('ふらふら'); // -> F

ら行を R じゃなくて L にしたい

KanaToInitial::init(false, true);
KanaToInitial::convert('らくらく'); // -> L

License

MIT

kana2initial's People

Contributors

shimonhaga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.