Changeset 6288
- Timestamp:
- 02/06/08 15:58:41 (10 months ago)
- Location:
- lang/perl/Encode-JP-Mobile/trunk
- Files:
-
- 2 modified
- 1 moved
-
Rakefile (modified) (1 diff)
-
tools/BUILD (modified) (1 diff)
-
tools/convert-map-scrape.pl (moved) (moved from lang/perl/Encode-JP-Mobile/trunk/tools/make-convert-map.pl) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/Encode-JP-Mobile/trunk/Rakefile
r5448 r6288 40 40 end 41 41 42 unoh_files = %w(e2is i2es s2ie) 43 file 'dat/convert-map-utf8.yaml' => unoh_files.map {|x| "dat/conv/emoji_#{x}.txt" } do 44 sh "#{perl} tools/make-convert-map.pl > dat/convert-map-utf8.yaml" 45 end 46 directory 'dat/conv/' 47 unoh_files.each do |f| 48 file "dat/conv/emoji_#{f}.txt" => ['dat/conv/'] do 49 sh "wget http://labs.unoh.net/emoji_#{f}.txt -O dat/conv/emoji_#{f}.txt" 50 end 42 file 'dat/convert-map-utf8.yaml' do 43 sh "#{perl} tools/convert-map-scrape.pl > dat/convert-map-utf8.yaml" 51 44 end 52 45 -
lang/perl/Encode-JP-Mobile/trunk/tools/BUILD
r5231 r6288 22 22 23 23 # Optional: build convert-utf8-map.yaml 24 # ./tools/ make-convert-map.pl24 # ./tools/convert-map-scrape.pl 25 25 26 26 # Make x-utf8-*.ucm -
lang/perl/Encode-JP-Mobile/trunk/tools/convert-map-scrape.pl
r5448 r6288 2 2 3 3 # http://labs.unoh.net/2007/02/post_65.html to dat/convert-map-utf8.yaml 4 # mkdir dat/conv; download emoji_*.txt to dat/conv/emoji_*.txt 5 # perl tools/make-convert-map.pl > dat/convert-map-utf8.yaml 4 # perl tools/convert-map-scrape.pl > dat/convert-map-utf8.yaml 6 5 7 use utf8;8 6 use Encode; 9 7 use Encode::JP::Mobile 0.09; 10 use File::Slurp qw(slurp);8 use LWP::Simple; 11 9 use YAML; 12 10 11 my %files; 12 for my $file (qw( emoji_e2is.txt emoji_i2es.txt emoji_s2ie.txt )) { 13 $files{$file} = decode('cp932', get("http://labs.unoh.net/$file")); 14 } 15 13 16 my $no2uni = {}; 14 for my $file (qw( emoji_e2is.txt emoji_i2es.txt emoji_s2ie.txt )) { 15 my @line = slurp "dat/conv/$file"; 16 for my $line (@line) { 17 for my $file (keys %files) { 18 for my $line (split /\n/, $files{$file}) { 17 19 next unless $line =~ /^%/; 18 20 my ($no, $byte) = split "\t", $line; … … 33 35 34 36 my %map; 35 for my $file (qw( emoji_e2is.txt emoji_i2es.txt emoji_s2ie.txt )) { 36 my @line = slurp "dat/conv/$file"; 37 38 for my $line (@line) { 37 for my $file (keys %files) { 38 for my $line (split /\n/, $files{$file}) { 39 39 next unless $line =~ /^%/; 40 40 chomp $line; 41 $line = decode 'cp932', $line;42 41 43 42 $file eq 'emoji_i2es.txt' && do { … … 71 70 } 72 71 73 print YAML::Dump \%map; 72 binmode STDOUT, ":utf8"; 73 print YAML::Dump(\%map);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)