Alvis-Convert
view release on metacpan or search on metacpan
lib/Alvis/Wikipedia/XMLDump.pm view on Meta::CPAN
package Alvis::Wikipedia::XMLDump;
use warnings;
use strict;
$Alvis::Wikipedia::XMLDump::VERSION = '0.1';
use Storable;
use Parse::MediaWikiDump;
use Digest::MD5;
use Encode;
use Data::Dumper;
use Alvis::Wikipedia::WikitextParser;
use Alvis::Wikipedia::Variables;
use Alvis::Wikipedia::CatGraph;
use Alvis::Canonical;
########################################################################
#
# Exported constants
#
#######################################################################
# Record output formats
our ($OUTPUT_HTML,
$OUTPUT_ALVIS
)=(0..1);
############################################################################
#
# Error message stuff
#
############################################################################
my ($ERR_OK,
$ERR_VAR,
$ERR_PARSER,
$ERR_FIRST_PASS,
$ERR_SECOND_PASS,
$ERR_TEMPL_ADD,
$ERR_EXPAND,
$ERR_DUMP,
$ERR_TABLE_PARSE,
$ERR_REC_CB,
$ERR_HTML,
$ERR_CAN_DOC_CONV,
$ERR_ALVIS,
$ERR_BUILD_CAT_GRAPH,
$ERR_CATEGORIES,
$ERR_XML_PARSER,
$ERR_CAN_DOC_CONVERSION,
$ERR_ID,
$ERR_TITLE,
$ERR_CAT_PAGE_LINKS_ADD,
$ERR_CAT_GRAPH,
$ERR_LOAD_TEMPLATES,
$ERR_CAT_GRAPH_DUMP,
$ERR_UNK_OUTPUT_FORMAT
)=(0..23);
my %ErrMsgs=($ERR_OK=>"",
$ERR_VAR=>"Unable to instantiate Alvis::Wikipedia::Variables.",
$ERR_PARSER=>
"Unable to instantiate Alvis::Wikipedia::WikitextParser.",
$ERR_FIRST_PASS=>"The first pass over the records failed.",
$ERR_SECOND_PASS=>"The main pass over the records failed.",
$ERR_TEMPL_ADD=>"Adding the definition of a template failed.",
$ERR_EXPAND=>"Variable and template expansion failed.",
$ERR_DUMP=>"Opening the SQL dump file failed.",
$ERR_TABLE_PARSE=>"Parsing a subtable failed.",
$ERR_REC_CB=>"Record handling callback failed.",
$ERR_HTML=>"Wikitext -> HTML failed.",
( run in 1.345 second using v1.01-cache-2.11-cpan-39bf76dae61 )