Changeset 2511
- Timestamp:
- 12/05/07 23:32:58 (5 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/WebService-YahooJP-TextParse/trunk/lib/WebService/YahooJP/TextParse.pm
r2497 r2511 46 46 47 47 $XML::Simple::PREFERRED_PARSER = 'XML::Parser'; 48 my $parser = XML::Simple->new; #(forcearray => 1);48 my $parser = XML::Simple->new; 49 49 $self->{result} = $parser->XMLin($res->content); 50 $self->{ iter} = Array::Iterator::BiDirectional->new($self->{result}->{ma_result}->{word_list}->{word});51 52 $self->{iter};50 $self->{word} = $self->{result}->{ma_result}->{word_list}->{word}; 51 $self->{word} = [ $self->{word} ] if ref($self->{word}) and ref($self->{word}) eq 'HASH'; 52 return wantarray ? @{ $self->{word} } : Array::Iterator::BiDirectional->new($self->{word}); 53 53 } 54 54 … … 64 64 use WebService::YahooJP::TextParse; 65 65 66 my $ma = WebService::YahooJP::TextParse->new(%$config); # $config = { appid: "your-app-id" }; 66 my $config = { appid => "your-app-id" }; 67 my $ma = WebService::YahooJP::TextParse->new(%$config); 67 68 my $text = "some japanese sentense"; 68 69 my $iter = $ma->analysis($text);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)