[PerlWikiBot] SF.net SVN: perlwikibot:[51] trunk/no-interwiki
Status: Pre-Alpha
Brought to you by:
rotemliss
From: <am...@us...> - 2008-07-30 18:08:37
|
Revision: 51 http://perlwikibot.svn.sourceforge.net/perlwikibot/?rev=51&view=rev Author: amire80 Date: 2008-07-30 18:08:45 +0000 (Wed, 30 Jul 2008) Log Message: ----------- Count pages without interwiki per namespace. Modified Paths: -------------- trunk/no-interwiki/eo.strings.txt trunk/no-interwiki/he.strings.txt trunk/no-interwiki/prepare_noiw_list.pl Modified: trunk/no-interwiki/eo.strings.txt =================================================================== --- trunk/no-interwiki/eo.strings.txt 2008-07-30 17:48:29 UTC (rev 50) +++ trunk/no-interwiki/eo.strings.txt 2008-07-30 18:08:45 UTC (rev 51) @@ -29,6 +29,7 @@ User Vikipediisto User talk Vikipediista diskuto Image Dosiero +article space (nomspace de artikoloj) # Other other alia Modified: trunk/no-interwiki/he.strings.txt =================================================================== --- trunk/no-interwiki/he.strings.txt 2008-07-30 17:48:29 UTC (rev 50) +++ trunk/no-interwiki/he.strings.txt 2008-07-30 18:08:45 UTC (rev 51) @@ -29,6 +29,7 @@ User משתמש User talk שיחת משתמש Image תמונה +article space (מרחב ערכים) # Other other אחר Modified: trunk/no-interwiki/prepare_noiw_list.pl =================================================================== --- trunk/no-interwiki/prepare_noiw_list.pl 2008-07-30 17:48:29 UTC (rev 50) +++ trunk/no-interwiki/prepare_noiw_list.pl 2008-07-30 18:08:45 UTC (rev 51) @@ -146,10 +146,7 @@ # This monstrosity basically says: | and optional spaces $PATTERN{param_sep} = qr{\s*\Q$MW_SYNTAX{param_sep}\E\s*}xms; -Readonly my @INCLUDE_NAMESPACES => ( - q{}, # Empty is a specific case - 'category', -); +Readonly my @INCLUDE_NAMESPACES => ('article space', 'category',); # # Constants for date processing @@ -342,6 +339,11 @@ exit; +sub namespace { + my ($page) = @_; + return $page->namespace() || $STRING{'article space'}; +} + sub find_iwless { PAGE: while (my $page = $dump->page()) { @@ -357,7 +359,7 @@ next PAGE if ($page_counter < $option{start_from}); - my $namespace = $page->namespace() || 'main'; + my $namespace = namespace($page); $namespace_count{$namespace}++; # Skipping cases: @@ -402,7 +404,7 @@ ) = @_; INFO(q(does not have iw link.)); - $statistics{'has no interwiki link'}++; + $statistics{'has no interwiki link'}->{ namespace($page) }++; # Now we need to search for no_iw templates # and parse their parameters - date and type @@ -1020,7 +1022,7 @@ sub is_in_namespace { my ($page, @namespaces) = @_; - return $page->namespace() ~~ [ map { get_string($_) } @namespaces ]; + return namespace($page) ~~ [ map { get_string($_) } @namespaces ]; } sub is_category { @@ -1173,6 +1175,12 @@ while (not defined $statistics{count_iw}->[ --$max_iw_index ]) { } } + INFO('pages without interwiki links per namespace'); + foreach my $namespace (keys %{ $statistics{'has no interwiki link'} }) { + INFO( + "$namespace: $statistics{'has no interwiki link'}->{$namespace}"); + } + INFO("\nNAMESPACES"); foreach my $namespace (sort keys %namespace_count) { INFO("$namespace: $namespace_count{$namespace}"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |