Acme-CPANAuthors-Japanese
view release on metacpan or search on metacpan
bin/unregistered_japanese_authors view on Meta::CPAN
#!perl
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Acme::CPANAuthors::Utils qw( cpan_authors );
use Acme::CPANAuthors::Japanese;
use Lingua::JA::Romaji::Valid;
use Time::Piece;
use Getopt::Long qw/:config gnu_compat/;
GetOptions(\my %opts, qw/update module exception/);
my $validator = Lingua::JA::Romaji::Valid->new('liberal');
my %known = Acme::CPANAuthors::Japanese->authors;
my %exceptions = _exceptions();
my @authors;
foreach my $author ( cpan_authors->authors ) {
my $email = $author->email;
my $name = lc $author->name or next;
my $id = $author->pauseid;
next if $known{$id};
next if $exceptions{$id};
next unless $validator->as_fullname( $name )
|| $validator->as_name( $name );
# next unless $email and $email =~ /(\.(com|org|net|jp)|CENSORED)$/i;
push @authors, $author;
}
print "num of candidates: " , (scalar @authors), "\n";
foreach my $author ( sort { $a->pauseid cmp $b->pauseid } @authors ) {
my $id = $author->pauseid;
my $name = $author->name;
my $mail = $author->email;
print qq{ $id => '$name', # ($mail)\n};
$exceptions{$id} = $known{$id} = [$name, $mail];
}
if ($opts{exception}) {
my $file = __FILE__;
open my $in, '<', $file or die $!;
open my $out, '>', "$file.tmp" or die $!;
my $flag;
while(<$in>) {
if (/^sub _exceptions/) {
print $out $_;
$flag = 1;
next;
}
if ($flag && /^\)\}/) {
for my $id (sort keys %exceptions) {
if (ref $exceptions{$id}) {
print $out " $id => '$exceptions{$id}[0]', # $exceptions{$id}[1]\n";
} else {
print $out " $id => '$exceptions{$id}',\n";
}
}
$flag = 0;
}
if ($flag) {
my ($id, $name, $comment) = /^\s+(\w+)\s*=>\s*'(.+?)',(?:\s*#\s*(.+))?$/;
if ($id && $name && $comment) {
$exceptions{$id} = [$name, $comment];
}
next;
}
print $out $_;
}
close $in;
close $out;
rename "$file.tmp" => $file or die $!;
}
if ($opts{update}) {
my $file = "$FindBin::Bin/../lib/Acme/CPANAuthors/Japanese.pm";
open my $in, '<', $file or die $!;
open my $out, '>', "$file.tmp" or die $!;
my $flag;
while(<$in>) {
if (/our \$VERSION = /) {
my $ymd = substr(Time::Piece->new->strftime('%Y%m%d'), 2);
print $out "our \$VERSION = '0.$ymd';\n";
next;
}
if (/^use Acme::CPANAuthors::Register/) {
print $out $_;
for my $id (sort keys %known) {
if (ref $known{$id}) {
printf $out " %-9s => '%s', # (%s)\n", $id, $known{$id}[0], $known{$id}[1];
} else {
printf $out " %-9s => '%s',\n", $id, $known{$id};
}
}
$flag = 1;
next;
}
if ($flag && /^\)/) {
$flag = 0;
}
print $out $_ unless $flag;
}
close $in;
close $out;
rename "$file.tmp" => $file;
}
# these authors have names which can be readable as Japanese
sub _exceptions {(
AANARI => 'Ali Anari',
AARONJJ => 'Aaron Johnson',
ABATIE => 'Alan Batie',
ABBYPAN => 'Pan Lanlan',
ADEO => 'Adekunle Olonoh',
ADITYA => 'Aditya Wasudeo',
AESOP => 'AA',
AKISSANE => 'Aidan Kissane',
ALANC => 'Alan Champion',
AMBROSEUS => 'Eugene Samonenko',
AMMODULES => 'Aaron Noraa',
ANAK => 'Mario Rossano',
ANARION => 'Anarion',
ANBU => 'Anbalagan Pugaleesan',
ANDOT => 'MA Bingyao',
ANEI => 'Ailin Nemui',
ANNADURAI => 'Anna Durai',
ANTIPASTA => 'Joe Papperello',
ANTRO => 'Antonio Rosella',
ARACKHAEN => 'Sami Lehtimaki',
AREGGIORI => 'areggiori',
ATTILA => 'attila',
BARTENDER => 'Maroun',
BEANS => 'Ben',
BEDOSHI => 'Bedoshi',
BEN => 'Ben Laurie',
BENBETA => 'Ben Beta',
BENH => 'Benjamin Hare',
BEPPU => 'John Beppu',
BERETTA => 'Joshua Moore',
BIJUA => 'Biju A',
BINOJOHN => 'Bino John',
BINWIND => 'Bin Hu',
BIOJETONE => 'mecha',
BKOLERA => 'Ben Kolera',
BLX => 'lorenzo bellotti',
BOD => 'Ian Boddison',
BOLILA => 'Joao Bolila',
BOMBUP => 'no name',
BOXZOU => 'Bo Zou',
BSAGO => 'Benjamin Sago',
BUGONI => 'Piero Bugoni',
BUNTAR => 'ben',
CAIO => 'Eh',
CGLEE => 'Chae Lee',
CHAROITEL => 'Charoite Lee',
CHAROVARK => 'Charoite Lee',
CHUNZI => 'chunzi',
COMPASS => 'Pan Luo',
CORNO => 'Ian Hansen',
CSELT => 'Emma Tonkin',
CYLFHX => 'yalin chai',
DALEAMON => 'Dale Amon',
DANMOORE => 'Dan Moore',
DAREOLA => 'Domingo Areola',
DBEUSEE => 'Don Beusee',
DEBAJYOTI => 'Debajyoti Dutta',
DEEPAN => 'deepan',
bin/unregistered_japanese_authors view on Meta::CPAN
SATRAC => 'John Monteiro',
SDAGUE => 'Sean Dague',
SEEBERG => 'Yuanhao Li',
SEGAN => 'Sean Egan',
SENDU => 'Sendu Bala',
SHANHE => 'Shan He',
SHAO => 'li yantao',
SHARAN => 'Sharanabasu',
SHIKIN => 'Iurii Shikin',
SHNTKZ => 'Mauro Panigada',
SIDIBE => 'Samba SIDIBE',
SIERRA => 'Mike Sierra',
SIMOTRONE => 'Simone Tampieri',
SKYLOADER => 'jaemin choi',
SMAPDY => 'Sean Heaton',
SMSO => 'Shimin Shuai',
SNOOPYBBT => 'Emanuele Santoro',
SODASODA => 'Ilya Soda',
SPOT => 'Jussi Kinnula',
SSHINE => 'Simon Shine',
SUJAI => 'SujaiSojan',
SUNGO => 'sungo',
SYAMAL => 'Syamala Tadigadapa',
SYXANASH => 'Simone',
TABULO => 'TABULO RASA',
TALINA => 'TALINA',
TANAMI => 'Tanami', # ???
TANTALOR => 'John Tantalo',
TAO => 'TAO',
TEYNA => 'Tina John',
THOC => 'Ben',
THUNDERA => 'Mauro Ribeiro',
TIMELLO => 'Tiago Mello',
TMAEK => 'Tommi Maekitalo',
TMM => 'Toma Mazilu',
TTG => 'John',
TWL => 'Mule Te',
USEOPENID => 'Alan Batie',
VAGUE => 'Jari Matilainen',
VEDGE => 'Julien Nadeau',
WAHYUDI => 'Wahyudi',
WAIDER => 'Ronan Waide',
WARRENHUA => 'Warren',
YKAR => 'Yuri Karaban',
YSAGADE => 'Yati Sagade',
YULESHOW => 'Wanshu Shao',
ZANDY => 'John Chain',
ZARA => 'Zara Mage',
ZEMAN => 'Dan Zeman',
ZIALI => 'Ali Zia',
ZITSEN => 'Linhe Huo',
ZIYA => 'Ziya Suzen',
ZLOBUS => 'Yu Ya', # ???
ZORRO => 'ARUN',
)}
__END__
=head1 NAME
unregistered_japanese_authors - try to find unregistered Japanese CPAN authors
=head1 SYNOPSIS
> unregistered_japanese_authors
=head1 DESCRIPTION
You can use this to find Pause IDs whose real name looks like Japanese.
=head1 AUTHOR
Kenichi Ishigaki, E<lt>ishigaki at cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2007 by Kenichi Ishigaki.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
=cut
( run in 1.017 second using v1.01-cache-2.11-cpan-5c0b1e786e0 )