Lingua::FreeLing3::Word - Interface to FreeLing3 Word object
use Lingua::FreeLing3::Word; my $empty_word = Lingua::FreeLing3::Word->new; my $hello_word = Lingua::FreeLing3::Word->new('hello');
Interface to the FreeLing3 word object.
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.
Returns a reference to a hash with the form, lemma and tag (POS) of the word.
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;
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;
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.
Set/retrieve word form.
my $word_form = $word->form;
Retrieve lowercase word form.
my $lc_form = $word->lc_form;
Returns a true value is the word is a multiword.
For a multiword word, this method returns an array of its constituent words in array context. In scalar context returns the multiword as a string (words concatenated by a whitespace).
Returns undef if word is not a multiword.
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.
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, <email@example.com>
Copyright (C) 2011-2012 by Projecto Natura