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.
At the present moment there is one only (empty) constructor. Returns an
These methods let you query an Analysis object:
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.
Query the current analysis lemma. Supply a string to the method to set the analysis lemma.
my $lemma = $analysis->lemma;
Query the current analysis tag (POS). Supply a string to the method to set the analysis tag.
my $pos = $analysis->tag;
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;
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, <firstname.lastname@example.org>
Jorge Cunha Mendes <email@example.com>
Copyright (C) 2011 by Projecto Natura