clbecker / perl-wiktionary-parser Goto Github PK
View Code? Open in Web Editor NEWClient and parser of documents pulled from the wiktionary api
Client and parser of documents pulled from the wiktionary api
The module doesn't install very well:
t/03_parsing.t ............. 1/?
# Failed test 'section's normalized language is Gaelic'
# at t/03_parsing.t line 114.
# got: 'Scottish Gaelic'
# expected: 'Gaelic'
# Failed test 'lexeme's tagged normalized language name is Gaelic'
# at t/03_parsing.t line 126.
# got: 'Scottish Gaelic'
# expected: 'Gaelic'
# Looks like you failed 2 tests of 12.
t/03_parsing.t ............. Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/12 subtests
At present senses are not being added to pronunciation objects. Adding the line
senses => $args{senses},
to the sub Wiktionary::Parser::Section::Pronunciation::add_pronunciation seems to fix this.
sub Wiktionary::Parser::Section::Pronunciation::add_pronunciation {
my $self = shift;
my %args = @_;
my $meta = {};
my $lang = $args{language} || '__language_undefined__';
my $pronunciation = Wiktionary::Parser::Section::Pronunciation::Representation->new(
representation => $args{representation},
pronunciation => $args{pronunciation},
context => $args{context},
senses => $args{senses},
);
push @{$self->{pronunciation}{$lang}},$pronunciation;
}
I ran this script and received this issue perhaps 1/5 times. Not sure how this gets caught.
Can't call method "get_sections" on an undefined value at /usr/local/share/perl/5.20.2/Wiktionary/Parser/Document.pm line 358.
Wiktionary::Parser::Document::get_classifications(Wiktionary::Parser::Document=HASH(0x3a365b0), "class", "Wiktionary::Parser::Section::Synonym") called at /usr/local/share/perl/5.20.2/Wiktionary/Parser/Document.pm line 297
Sometimes Perl would cite this line as a problem:
Can't call method "get_synonyms" on an undefined value
my $synonyms = $document->get_synonyms();
If you put the version number in quotes:
our $VERSION = '0.11';
you won't see the problem where version 0.10 gets turned into 0.1 as seen in the repository.
# Failed test 'use Wiktionary::Parser;'
# at t/00-load.t line 6.
# Tried to use 'Wiktionary::Parser'.
# Error: Bareword "Locale::Codes::Language::LOCALE_LANG_ALPHA_3" not al
# Compilation failed in require at /home/djg/.cpanplus/5.14.2/build/Wiktiona
# BEGIN failed--compilation aborted at /home/djg/.cpanplus/5.14.2/build/Wikt
# Compilation failed in require at /home/djg/.cpanplus/5.14.2/build/Wiktiona
# BEGIN failed--compilation aborted at /home/djg/.cpanplus/5.14.2/build/Wikt
# Compilation failed in require at /home/djg/.cpanplus/5.14.2/build/Wiktiona
# BEGIN failed--compilation aborted at /home/djg/.cpanplus/5.14.2/build/Wikt
# Compilation failed in require at (eval 4) line 2.
# BEGIN failed--compilation aborted at (eval 4) line 2.
# Testing Wiktionary::Parser , Perl 5.014002, /usr/bin/perl
# Looks like you failed 1 test of 1.
FAILED--Further testing stopped.
make: *** [test_dynamic] Error 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.