NAME

Lingua::FreeLing2::Word::Analysis - Interface to FreeLing2 Analysis object

SYNOPSIS

use Lingua::FreeLing2::Word::Analysis;

# obtain the list of analysis
my $list_of_analysis = $word->analysis;

# create empty analysis object
my $analysis = Lingua::FreeLing2::Analysis->new();

my $data = $analysis->to_hash;

DESCRIPTION

This module interfaces to the Analysis object from FreeLing2. Usually you do not need to create this kind of object, unless you are hacking deep in the FreeLing2 library. The usual usage is to retrieve a list of possible analysis for a specific word using the analysis method on Lingua::FreeLing2::Word objects.

CONSTRUCTOR

new

At the present moment there is one only (empty) constructor. Returns an Lingua::FreeLing2::Word::Analysis object.

ACESSORS

These methods let you query an Analysis object:

to_hash

Retrieve a reference to a hash that includes the analysis lemma, parole (POS) and probability.

ACESSORS/SETTER

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;
parole

Query the current analysis parole (POS). Supply a string to the method to set the analysis parole.

my $pos = $analysis->parole;
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::FreeLing2::Word objects.

my $list_of_tokens = $analysis->retokenizable;

SEE ALSO

Lingua::FreeLing2(3) for the documentation table of contents. The freeling library for extra information, or perl(1) itself.

AUTHOR

Alberto Manuel Brandão Simões, <ambs@cpan.org>

Jorge Cunha Mendes <jorgecunhamendes@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2011 by Projecto Natura