version 1.1, 2001/12/05 00:56:57
|
version 1.7, 2005/12/10 00:03:55
|
Line 1
|
Line 1
|
|
#!/usr/bin/perl -w |
#!/usr/local/bin/perl -w |
|
|
|
=head1 NAME |
=head1 NAME |
|
|
Line 24 makeauthors.pl
|
Line 23 makeauthors.pl
|
|
|
use dbchgk; |
use dbchgk; |
|
|
|
my $DUMPDIR = $ENV{DUMPDIR} || "../dump"; |
|
|
do "chgk.cnf"; |
do "chgk.cnf"; |
use locale; |
use locale; |
use POSIX qw (locale_h); |
use POSIX qw (locale_h); |
open NICKS, "<$nicksfile" or die "Can not open nicks"; |
open NICKS, "<$nicksfile" or die "Can not open nicks"; |
open SSNICKS, "<$ssnicksfile" or die "Can not open ssnicks"; |
open SSNICKS, "<$ssnicksfile" or die "Can not open ssnicks"; |
open UNKNOWN, ">uauthors"; |
open UNKNOWN, ">$DUMPDIR/uauthors"; |
open STDERR, ">errors"; |
open UNICKS, ">$DUMPDIR/unicks"; |
|
open STDERR, ">$DUMPDIR/errors"; |
my ($thislocale); |
my ($thislocale); |
if ($^O =~ /win/i) { |
if ($^O =~ /win/i) { |
$thislocale = "Russian_Russia.20866"; |
$thislocale = "Russian_Russia.20866"; |
Line 74 while (<NICKS>)
|
Line 76 while (<NICKS>)
|
$name{$nick}= ucfirst lc $name; |
$name{$nick}= ucfirst lc $name; |
$surname=ucfirst lc $surname; |
$surname=ucfirst lc $surname; |
$surname=~s/\-(.)/"-". uc $1/ge; |
$surname=~s/\-(.)/"-". uc $1/ge; |
|
$surname=~s/\'(.)/"'". uc $1/ge; |
$surname{$nick}= $surname; |
$surname{$nick}= $surname; |
|
|
} |
} |
Line 112 while (<AUTHORS>)
|
Line 115 while (<AUTHORS>)
|
($number,$descr)=m/^(\d+)\s+(.*)$/g; |
($number,$descr)=m/^(\d+)\s+(.*)$/g; |
$nick='unknown'; |
$nick='unknown'; |
} |
} |
$nick=~s/\s*$//; |
# if ($nick=~s/\s*$//) |
$descr=~s/([\.\,\:\!\?])/$1 /g; |
$descr=~s/([\.\,\:\!\?])/$1 /g; |
$descr=~s/\\n/ /g; |
$descr=~s/\\n/ /g; |
$descr=~s/^\s+//g; |
$descr=~s/^\s+//g; |
Line 131 while (<AUTHORS>)
|
Line 134 while (<AUTHORS>)
|
|
|
foreach $as(keys %unknick) |
foreach $as(keys %unknick) |
{ |
{ |
print "$as \n ", (join "\n ", (grep {$nick{$_}=~/$as/} keys %nick)); |
print UNICKS "$as \n ", (join "\n ", (grep {$nick{$_}=~/$as/} keys %nick)); |
print "\n"; |
print UNICKS "\n"; |
} |
} |
|
|
%forbidden=checktable('equalto')? getequalto : (); |
%forbidden=checktable('equalto')? getequalto : (); |
Line 150 while (($QuestionId, $author)=getrow,$Qu
|
Line 153 while (($QuestionId, $author)=getrow,$Qu
|
$author=~s/\s+$//mg; |
$author=~s/\s+$//mg; |
$author=~s/\s+/ /mg; |
$author=~s/\s+/ /mg; |
$author=uc $author; |
$author=uc $author; |
|
$author=~s/£/Å/mg; |
if ($nick = $nick{$author}) |
if ($nick = $nick{$author}) |
{ |
{ |
my @a=split ' ',$nick; |
my @a=split ' ',$nick; |