Skip to content

Commit

Permalink
fixed bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiratara committed Mar 21, 2009
1 parent 877c84b commit e7df84b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
Revision history for WWW-YahooJapan-KanaAddress

0.1.4 Sat, 21 Mar 2009
fix bug. (Yahoo! side HTML had been changed again.)

0.1.3 Mon Jan 12 20:30:00 2009
fix bug. (Yahoo! side HTML had been changed.)

Expand Down
2 changes: 1 addition & 1 deletion README
@@ -1,4 +1,4 @@
WWW-YahooJapan-KanaAddress version 0.1.3
WWW-YahooJapan-KanaAddress version 0.1.4

INSTALLATION

Expand Down
8 changes: 5 additions & 3 deletions lib/WWW/YahooJapan/KanaAddress.pm
Expand Up @@ -6,8 +6,9 @@ use warnings;
use strict;
use Carp;

use version; our $VERSION = qv('0.1.3');
use version; our $VERSION = qv('0.1.4');

use Encode;
use LWP::UserAgent;
use URI::Escape;

Expand Down Expand Up @@ -168,9 +169,10 @@ sub _get_kana_dict{
my $ua = $self->{ua};
my $res = $ua->get($url);
my $c = $res->content();
Encode::from_to($c, 'utf8', 'eucJP');
my %ret = ();
while ($c =~ m{<dd[^>]+><div class="ruby">(.+?)</div>(.+?)</dd>}g) {
my ($kana, $kanji) = $self->_strip_tag($1, $2);
while ($c =~ m{<ruby[^>]*>.*?<a[^>]*>(.+?)</a>.*?<rt>(.+?)</rt>.*?</ruby>}g) {
my ($kanji, $kana) = $self->_strip_tag($1, $2);
$ret{$kanji} = $kana;
}
return \%ret;
Expand Down

0 comments on commit e7df84b

Please sign in to comment.