version 1.2, 2003/01/08 21:40:21
|
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 UNICKS, ">unicks"; |
open UNICKS, ">$DUMPDIR/unicks"; |
open STDERR, ">errors"; |
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 75 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 113 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 151 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; |