Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
将汉字转为拼音 (全拼)
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
MIT-LICENSE
README
Rakefile
dist.yml
init.rb
install.rb
uninstall.rb

README

Pinyin
======

将汉字转为拼音
  def test_full
    assert_equal("", Pinyin.full(nil))
    assert_equal("yedongkai", Pinyin.full("叶冬开"))
    assert_equal("yedongkaiabcyedong", Pinyin.full("叶冬开abc叶冬"))

    assert_equal "yedongkai|xiedongkai", Pinyin.full("叶冬开", nil, true)
  end

  def test_abbr
    assert_equal("cjp", Pinyin.abbr("曹靖鹏"))

    assert_equal("gjp|hjp", Pinyin.abbr("红靖鹏", nil, true))
  end

  def test_abbr_else
    assert_equal("caojp", Pinyin.abbr_else("曹靖鹏"))
  end


Introduction goes here.


Example
=======

Example goes here.

Reference
=========
http://qingdaonet.org/dic/pinin.htm


Copyright (c) 2009 [name of plugin creator], released under the MIT license
Something went wrong with that request. Please try again.