GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  LINGUA::HAN::PINYIN (3)

.ds Aq ’

NAME

Lingua::Han::PinYin - Retrieve the Mandarin(PinYin) of Chinese character(HanZi).

CONTENTS

SYNOPSIS



  use Lingua::Han::PinYin;

  my $h2p = Lingua::Han::PinYin->new();

  # han2pinyin
  my $pinyin = $h2p->han2pinyin("XXX"); # woaini
  my @result = $h2p->han2pinyin("XX"); # @result = (ai, ni);



DESCRIPTION

Convert Mandarin to its spell

    RETURN VALUE

Usually, it returns its pinyin/spell.

if not (I mean it’s not a Chinese character), returns the original word.

    OPTION

tone => 1|0 default is 0. if 1, return <B>kua4B> instead of <B>kuaB>



    my $h2p = Lingua::Han::PinYin->new(tone => 1);
    print $h2p->han2pinyin("X"); #wo3
    my @result = $h2p->han2pinyin("XX"); # @result = (ai4, ni3);



unicode => 1|0 default is 0, if 1, return <B>kua\k:`B> instead of <B>kua4B> OR <B>kuaB>



    my $h2p = Lingua::Han::PinYin->new(unicode => 1);
    print $h2p->han2pinyin("XX"); # ye\k:`we\k:`n



capitalize => 1|0 default is 0, if 1, will capitalize each pinyin word



    my $h2p = Lingua::Han::PinYin->new(capitalize => 1);
    print $h2p->han2pinyin("XXXX"); # HanYuPinYin



    METHODS

han2pinyin


    print $h2p->han2pinyin("XX"); #lin2dao4
    print $h2p->han2pinyin("I love XXX a"); #i love yuruihua a



han2pinyin1 for 1 chinese letter at a time, han2pinyin1 is faster



    # if you are sure to pass 1 Chinese letter at a time, han2pinyin1 is faster
    print $h2p->han2pinyin1("X"); # wo



gb2pinyin if you are sure your encoding is GB2312, gb2pinyin is faster



    print $h2p->gb2pinyin("I love XXXXXXX Ah"); # I love XhanyuXpinXyin Ah



SEE ALSO

Unicode::Unihan

AUTHORS

Fayland Lam, <fayland at gmail.com>

Tong Sun, <suntong at cpan.org>

COPYRIGHT

Copyright (c) 2005-2012 *AUTHORS* All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

See <http://www.perl.com/perl/misc/Artistic.html>

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 LINGUA::HAN::PINYIN (3) 2015-10-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.