App-SocialSKK
view release on metacpan or search on metacpan
inc/Test/Base/Filter.pm view on Meta::CPAN
sub dumper {
no warnings 'once';
require Data::Dumper;
local $Data::Dumper::Sortkeys = 1;
local $Data::Dumper::Indent = 1;
local $Data::Dumper::Terse = 1;
Data::Dumper::Dumper(@_);
}
sub escape {
$self->assert_scalar(@_);
my $text = shift;
$text =~ s/(\\.)/eval "qq{$1}"/ge;
return $text;
}
sub eval {
$self->assert_scalar(@_);
my @return = CORE::eval(shift);
return $@ if $@;
lib/App/SocialSKK/Plugin/Eijiro.pm view on Meta::CPAN
sub get_candidates {
my ($self, $text) = @_;
return if ($text || '') eq '';
$text = Jcode->new($text, 'euc')->utf8;
my $uri = URI->new('http://eowbeta.alc.co.jp/eow/sg/?q=');
$uri->query_param(q => $text);
my $res = $self->ua->get($uri);
if ($res->is_success) {
map {
my $word = uri_unescape($_);
Jcode->new($word, 'utf8')->euc;
} $res->content =~ m!<word>(.+?)</word>!g;
}
}
1;
__END__
=head1 NAME
( run in 0.555 second using v1.01-cache-2.11-cpan-73692580452 )