albertofem/jpnforphp-bundle

JpnForPhp Symfony2 扩展集成

dev-master 2014-11-14 19:15 UTC

This package is not auto-updated.

Last update: 2024-09-14 15:28:29 UTC


README

build status Scrutinizer Code Quality

整合jpnforphp库到Symfony2框架。

更多信息:http://mbilbille.github.io/jpnforphp/

安装

在composer中要求它

composer require albertofem/jpnforphp-bundle dev-master

安装它

composer update albertofem/jpnforphp-bundle

将其添加到您的扩展中

$bundles = array(
    ...,
    new AFM\Bundle\JpnForPhpBundle\JpnForPhpBundle()
);

使用方法

此扩展旨在提供访问库的命令

检查一句话

php app/console jpnforphp:analyze:inspect 素晴らしいです

输出

Analyzing: 素晴らしいです

Sentence length: 7
Total hiragana: 5
Total katakana: 0
Total Kanji: 2
Total non-japanese characters: 0
Punctuation marks: No

转写服务

定义服务以访问转写器

$hepburn = $this->container->get('jpnforphp.transliterator.romaji.hepburn')
$hepburn->transliterate('ローマジ で かいて');