NAME

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

SYNOPSIS

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;

DESCRIPTION

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.

CONSTRUCTOR

new

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

ACESSORS

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.

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

SEE ALSO

Lingua::FreeLing3(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