NAME
Lingua::FreeLing3::Word - Interface to FreeLing3 Word object
SYNOPSIS
use Lingua::FreeLing3::Word;
my $empty_word = Lingua::FreeLing3::Word->new;
my $hello_word = Lingua::FreeLing3::Word->new('hello');
DESCRIPTION
Interface to the FreeLing3 word object.
new
The new
constructor returns a new Lingua::FreeLing3::Word
object. If a parameter is passed, it is interpreted as the word form, and it is automatically set. Otherwise, an empty word object is returned.
as_hash
Returns a reference to a hash with the form, lemma and tag (POS) of the word.
lemma
Returns the word lemma
, if set. Note that this value can't be set directly. You can create word analysis, associate them to the word, and then select the desired analysis (setting up the lemma value).
my $word_lemma = $word->lemma;
tag
Returns the word tag
(POS), if set. Again, note that this value can't be set directly. You can create word analysis, associate them to the word, and then select the desired analysis (setting up the tag value).
my $word_pos = $word->tag;
analysis
Returns a list of possible analysis. You can pass an extra option FeatureStructure
to obtain the analysis as a list of hashes (list of feature structures), instead of Lingua::FreeLing3::Word::Analysis objects.
my $list = $word->analysis(FeatureStructure => 1);
TODO: it is missing the option to add an analysis, or set the full set at once.
form
Set/retrieve word form.
my $word_form = $word->form;
lc_form
Retrieve lowercase word form.
my $lc_form = $word->lc_form;
is_multiword
Returns a true value is the word is a multiword.
get_mw_words
For a multiword word, this method returns an array of its constituent words.
TODO
There are a lot of methods to interface with the Word object that are currently not implemented. They should be made available as soon as there is time.
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>
COPYRIGHT AND LICENSE
Copyright (C) 2011-2012 by Projecto Natura