Text::CaboCha::Chunk - CaboCha Chunk Object
use Text::CaboCha; my $cabocha = Text::CaboCha->new(); my $tree = $cabocha->parse($text); my $token_size = $tree->token_size; for (my $i = 0; $i < $token_size; $i++) { my $token = $tree->token($i); if ($token->chunk) { my $chunk = $token->chunk; # do something } } my $chunk_size = $tree->chunk_size; for (my $i = 0; $i < $chunk_size; $i++) { my $chunk = $tree->chunk($i); # do something } # You can get the chunk value from chunk object using below methods $chunk->link; $chunk->head_pos; $chunk->func_pos; $chunk->token_size; $chunk->token_pos; $chunk->score; $chunk->feature_list; # array reference $chunk->additional_info; $chunk->feature_list_size;
Text::CaboCha::Chunk encapsulates the cabocha chunk object.
Text::CaboCha
Copyright (C) Kei Kamikawa.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html
Kei Kamikawa <x00.x7f@gmail.com> @codehex
To install Text::CaboCha, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::CaboCha
CPAN shell
perl -MCPAN -e shell install Text::CaboCha
For more information on module installation, please visit the detailed CPAN module installation guide.