Lingua::FreeLing3::Word::Analysis - Interface to FreeLing3 Analysis object
use Lingua::FreeLing3::Word::Analysis; # obtain the list of analysis my $list_of_analysis = $word->analysis; # create empty analysis object my $analysis = Lingua::FreeLing3::Analysis->new(); my $data = $analysis->as_hash;
This module interfaces to the Analysis object from FreeLing3. Usually you do not need to create this kind of object, unless you are hacking deep in the FreeLing3 library. The usual usage is to retrieve a list of possible analysis for a specific word using the analysis method on Lingua::FreeLing3::Word objects.
analysis
new
At the present moment there is one only (empty) constructor. Returns an Lingua::FreeLing3::Word::Analysis object.
Lingua::FreeLing3::Word::Analysis
These methods let you query an Analysis object:
as_hash
Retrieve a reference to a hash that includes the analysis lemma, tag (POS) and probability.
These methods let you access an object information or, if you pass any argument to the method, set that information.
lemma
Query the current analysis lemma. Supply a string to the method to set the analysis lemma.
my $lemma = $analysis->lemma;
tag
Query the current analysis tag (POS). Supply a string to the method to set the analysis tag.
my $pos = $analysis->tag;
prob
Query the current analysis probability. Note that some analysis might not have a probability associated. In that case, the method returns undef (not zero). Therefore, you should not use this method in boolean context but rather in definedness context.
my $prob = $analysis->prob;
retokenizable
This method lets you query if the word can be retokenizable. That is, if there is another way to represent this string. A common example for the Portuguese language is "da" that is also represented by "de a".
Returns undef if the analysis is not retokenizable. Otherwise, return a list of Lingua::FreeLing3::Word objects.
my $list_of_tokens = $analysis->retokenizable;
Lingua::FreeLing3(3) for the documentation table of contents. The freeling library for extra information, or perl(1) itself.
Alberto Manuel Brandão Simões, <ambs@cpan.org>
Jorge Cunha Mendes <jorgecunhamendes@gmail.com>
Copyright (C) 2011 by Projecto Natura
To install Lingua::FreeLing3, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::FreeLing3
CPAN shell
perl -MCPAN -e shell install Lingua::FreeLing3
For more information on module installation, please visit the detailed CPAN module installation guide.