Lingua::Treebank::HeadFinder - Head-finding in Lingua::Treebank
use Lingua::Treebank; my @utterances = Lingua::Treebank->from_penn_file($filename); foreach (@utterances) { # $_ is a Lingua::Treebank::Const now foreach ($_->get_all_terminals) { # $_ is a Lingua::Treebank::Const that is a terminal (word) print $_->word(), ' ' $_->tag(), "\n"; } print "\n\n"; }
Lingua::Treebank::HeadFinder is an object that reads a Magerman-style head-finding list and performs headfinding on Lingua::Treebank::Const trees.
The L::TB::HeadFinder object is initialized from a list like the one in
To do
To install Lingua::Treebank, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::Treebank
CPAN shell
perl -MCPAN -e shell install Lingua::Treebank
For more information on module installation, please visit the detailed CPAN module installation guide.