1

I am trying to use wikiprep (https://github.com/avian2/wikiprep) to parse wikipedia dump (in Feb 2014) and generate a XXX.hgw.xml file from the dump.

I followed the usage on Github site above: installed all Perl modules as prerequisites; Build and install wikiprep successfully (wikiprep program appeared in perl5/bin directory). When I execute wikiprep, it says:

Use of the encoding pragma is deprecated at /home/tutran/perl5/bin/wikiprep line 32. Use of the encoding pragma is deprecated at /home/tutran/perl5/lib/perl5/Wikiprep/languages.pm line 7. syntax error at /home/tutran/perl5/lib/perl5/Wikiprep/Disambig.pm line 9, near "->import qw/ extractWikiLinks /" Compilation failed in require at /home/tutran/perl5/bin/wikiprep line 52. BEGIN failed--compilation aborted at /home/tutran/perl5/bin/wikiprep line 52.

This the line 9:

Wikiprep::Link->import qw/ extractWikiLinks /;

Expected output: options I can use with wikiprep. I also cannot make test for the program. I installed it on Ubuntu 14.04 LTS. My Perl version is 5.18.02.

I don't know anything about perl language so I can't do anything with the "syntax error" here!

JNYRanger
  • 6,829
  • 12
  • 53
  • 81
Tu Tran
  • 101
  • 9

2 Answers2

1

You may need enable ut8 in your script. PLace this two lines before you start using this module:

use utf8;
use open qw( :encoding(cp866) :std );
  • Where should I put this? In the `Wikiprep/Disambig.pm` before line 9, or somewhere else? – shrx Jul 30 '15 at 12:27
1

In /usr/local/bin/ wikiprep change line 135 i'e (Wikiprep::Templates->import qw( %templates includeTemplates );) to : Wikiprep::Templates->import(qw( %templates includeTemplates ));

and in file /usr/local/share/perl/5.18.2/Wikiprep/Disambig.pm change Wikiprep::Link->import qw/ extractWikiLinks /; to Wikiprep::Link->import(qw/ extractWikiLinks /);