Changeset 18767
- Timestamp:
- 09/03/08 23:57:42 (5 years ago)
- Location:
- lang/perl/Lingua-JA-Gal/trunk
- Files:
-
- 1 removed
- 4 modified
-
. (modified) (1 prop)
-
MANIFEST.SKIP (modified) (1 diff)
-
Makefile.PL (modified) (1 diff)
-
lib/Lingua/JA/Gal.pm (modified) (5 diffs)
-
t/03_export.t (deleted)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Lingua-JA-Gal/trunk
-
Property
svn:ignore set
to
MANIFEST
-
Property
svn:ignore set
to
-
lang/perl/Lingua-JA-Gal/trunk/MANIFEST.SKIP
r18108 r18767 13 13 \.shipit 14 14 ^t/9\d_.*\.t 15 ^ share/lexicon.pl15 ^dat/ -
lang/perl/Lingua-JA-Gal/trunk/Makefile.PL
r18108 r18767 1 1 use inc::Module::Install; 2 2 3 name 'Lingua-JA-Gal'; 3 4 all_from 'lib/Lingua/JA/Gal.pm'; 4 5 5 build_requires 'Test::More'; 6 build_requires 'YAML'; 7 8 requires 'File::ShareDir'; 6 requires 'File::ShareDir' => '1.00'; 9 7 requires 'Unicode::Japanese'; 10 8 11 yaml2pl('dat/lexicon.yaml' => 'share/lexicon.pl');9 test_requires 'Test::More'; 12 10 13 install_share ;11 install_share qw( module Lingua::JA::Gal ), 'share'; 14 12 auto_include; 15 13 16 14 WriteAll; 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 8 8 use Unicode::Japanese; 9 9 10 use base 'Exporter'; 11 our @EXPORT_OK = qw( text2gal ); 12 13 our $Lexicon = do { 10 our $Lexicon ||= do { 14 11 my $file = module_file(__PACKAGE__, 'lexicon.pl'); 15 12 do $file; 16 13 }; 17 18 *text2gal = \&gal;19 14 20 15 sub gal { … … 79 74 Lingua::JA::Gal->gal("こんにちは"); 80 75 81 %optionscan take76 C<\%options> can take 82 77 83 78 =over 4 84 79 85 =item rate80 =item C<rate> 86 81 87 82 for converting rate. default is 100. … … 91 86 Lingua::JA::Gal->gal($text, { rate => 0 }); # nothing 92 87 93 =item callback88 =item C<callback> 94 89 95 90 if you want to do your own way. … … 109 104 =back 110 105 111 = item text2gal( $text, [ \%options ] )106 =back 112 107 113 is alias to gal(), exportable. 108 =head1 SEE ALSO 114 109 115 use Lingua::JA::Gal qw( text2gal ); 116 print text2gal("こんにちは"); 110 L<http://ja.wikipedia.org/wiki/%E3%82%AE%E3%83%A3%E3%83%AB%E6%96%87%E5%AD%97> 117 111 118 =back 112 L<http://coderepos.org/share/browser/lang/perl/Lingua-JA-Gal> (repository) 119 113 120 114 =head1 AUTHOR … … 127 121 it under the same terms as Perl itself. 128 122 129 =head1 SEE ALSO130 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 135 123 =cut
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)