Changeset 18767 for lang/perl

Show
Ignore:
Timestamp:
09/03/08 23:57:42 (6 years ago)
Author:
tomi-ru
Message:
Location:
lang/perl/Lingua-JA-Gal/trunk
Files:
1 removed
4 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/Lingua-JA-Gal/trunk

    • Property svn:ignore set to
      MANIFEST
  • lang/perl/Lingua-JA-Gal/trunk/MANIFEST.SKIP

    r18108 r18767  
    1313\.shipit 
    1414^t/9\d_.*\.t 
    15 ^share/lexicon.pl 
     15^dat/ 
  • lang/perl/Lingua-JA-Gal/trunk/Makefile.PL

    r18108 r18767  
    11use inc::Module::Install; 
     2 
    23name 'Lingua-JA-Gal'; 
    34all_from 'lib/Lingua/JA/Gal.pm'; 
    45 
    5 build_requires 'Test::More'; 
    6 build_requires 'YAML'; 
    7  
    8 requires 'File::ShareDir'; 
     6requires 'File::ShareDir' => '1.00'; 
    97requires 'Unicode::Japanese'; 
    108 
    11 yaml2pl('dat/lexicon.yaml' => 'share/lexicon.pl'); 
     9test_requires 'Test::More'; 
    1210 
    13 install_share; 
     11install_share qw( module Lingua::JA::Gal ), 'share'; 
    1412auto_include; 
    1513 
    1614WriteAll; 
    17  
    18 sub yaml2pl { 
    19     my ($yaml, $pl) = @_; 
    20      
    21     die "Please install YAML\n" unless eval { require YAML; 1 }; 
    22      
    23     use Data::Dumper; 
    24     local $Data::Dumper::Terse = 1; 
    25  
    26     mkdir 'share';  
    27     open my $in, '<:encoding(utf-8)', $yaml or die $!; 
    28     open my $out, '>', $pl or die $!; 
    29     print $out Dumper( YAML::LoadFile($in) ); 
    30     close $out; 
    31     close $in; 
    32 } 
  • lang/perl/Lingua-JA-Gal/trunk/lib/Lingua/JA/Gal.pm

    r18108 r18767  
    88use Unicode::Japanese; 
    99 
    10 use base 'Exporter'; 
    11 our @EXPORT_OK = qw( text2gal ); 
    12  
    13 our $Lexicon = do { 
     10our $Lexicon ||= do { 
    1411    my $file = module_file(__PACKAGE__, 'lexicon.pl'); 
    1512    do $file; 
    1613}; 
    17  
    18 *text2gal = \&gal; 
    1914 
    2015sub gal { 
     
    7974  Lingua::JA::Gal->gal("こんにちは"); 
    8075 
    81 %options can take 
     76C<\%options> can take 
    8277 
    8378=over 4 
    8479 
    85 =item rate 
     80=item C<rate> 
    8681 
    8782for converting rate. default is 100. 
     
    9186  Lingua::JA::Gal->gal($text, { rate =>   0 }); # nothing 
    9287 
    93 =item callback 
     88=item C<callback> 
    9489 
    9590if you want to do your own way. 
     
    109104=back 
    110105 
    111 =item text2gal( $text, [ \%options ] ) 
     106=back 
    112107 
    113 is alias to gal(), exportable. 
     108=head1 SEE ALSO 
    114109 
    115   use Lingua::JA::Gal qw( text2gal ); 
    116   print text2gal("こんにちは"); 
     110L<http://ja.wikipedia.org/wiki/%E3%82%AE%E3%83%A3%E3%83%AB%E6%96%87%E5%AD%97> 
    117111 
    118 =back 
     112L<http://coderepos.org/share/browser/lang/perl/Lingua-JA-Gal> (repository) 
    119113 
    120114=head1 AUTHOR 
     
    127121it under the same terms as Perl itself. 
    128122 
    129 =head1 SEE ALSO 
    130  
    131 L<http://ja.wikipedia.org/wiki/%E3%82%AE%E3%83%A3%E3%83%AB%E6%96%87%E5%AD%97> 
    132  
    133 L<http://coderepos.org/share/browser/lang/perl/Lingua-JA-Gal> (repository) 
    134  
    135123=cut