Giter Club home page Giter Club logo

php-kakasi's Introduction

php-kakasi
==========

This extension is Wrapper Program of KAKASI. 

KAKASI Project : http://kakasi.namazu.org/index.html.ja


Function overview
-----------------

This program has 2 function.
KAKASI_MORPHEME(string $word) :  This function generate a morpheme word arrray based on $word. 
KAKASI_CONVERT(string $word)  :  This function generate a wordset-object based on the argument. 

wordset-object has 4 member variable.
base : original word
hira : reprocessed word in Hiragana 
kata : reprocessed word in Katakana 
alph : reprocessed word in Alphabet 


How to install 
--------------

+--- Download and Compile 

$ git clone [email protected]:kokukuma/php-kakasi.git  
$ cd php-kakasi/kakasi
$ phpize
$ ./configure
$ make 
$ make install 


+--- Write the configuration in php.ini 

$ cat /etc/php.ini | grep kakasi 
extension=kakasi.so


Example usage 
-------------

+--- Japanese language morphological analysis 

$wordset = KAKASI_MORPHEME("狩野達也君");
var_dump($wordset);

--->    array(3) {
           [0]=>
           string(6) "狩野"
           [1]=>
           string(6) "達也"
           [2]=>
           string(3) "君"


+--- Character conversion 

$wordset = KAKASI_CONVERT("狩野タツヤくん"); 
var_dump($wordset);

--->	object(stdClass)#2 (4) {
		  ["base"]=>
		  string(21) "狩野タツヤくん"
		  ["hira"]=>
		  string(21) "かのたつやくん"
		  ["kata"]=>
		  string(21) "カノタツヤクン"
		  ["alph"]=>
		  string(14) "kanotatsuyakun"
		}

Author
------

Tatsuya Karino <[email protected]> 

---

php-kakasi's People

Contributors

kokukuma avatar

Stargazers

 avatar studenttwok avatar ieb avatar 蚂蚁 avatar Evan Owens avatar Nhan Nguyen avatar  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.