GithubHelp home page GithubHelp logo

duguying / pinyin-php Goto Github PK

View Code? Open in Web Editor NEW
29.0 4.0 2.0 842 KB

`pinyin-php` is a php extension which could translate Chinese character into Chinese PinYin.

License: MIT License

PHP 0.97% C 93.72% CMake 4.08% M4 0.99% Shell 0.24%
php-extension pinyin-php

pinyin-php's Introduction

pinyin-php


Build Status travis

pinyin-php is a php extension which could translate Chinese character into Chinese PinYin.

build and install

linux

build the extension

phpize
configure
make
make test

configuration

add following into php.ini

pinyin.chars=/path/to/chars.csv
pinyin.words=/path/to/words.csv
pinyin.locale="en_GB.UTF-8"		[optional]

usage

<?php
echo pinyin(""),"\n";
echo pinyin("わたしわ阿飞, and my English name is Rex Lee. 网名是独孤影! ^_^。下面是一段多音分词歧义测试,这个人无伤无臭味。"),"\n";
?>

License

MIT License

pinyin-php's People

Contributors

bitdeli-chef avatar duguying avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pinyin-php's Issues

英文版系统无法使用翻译

英文版系统无法使用翻译,因为setlocale将系统环境统一设置为zh_CN.utf8了,在英文版系统上应该直接查询。pinyin_translate中应该判定当前环境为en_US时直接查询,若为zh_CN则先转为宽字节。

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.