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
CONSTRUCTOR
new
-
The
new
constructor returns a newLingua::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.
ACESSORS
The word object has some simple accessors to retrieve some information:
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.
ACESSORS/SETTER
The following accessors also work as setters if an extra argument is supplied.
form
-
Set/retrieve word form.
my $word_form = $word->form;
in_dict
-
Returns true if the word was found in the dictionary, false otherwise. FIXME: at the moment this method is always returning true.
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>
Jorge Cunha Mendes <jorgecunhamendes@gmail.com>
COPYRIGHT AND LICENSE
Copyright (C) 2011 by Projecto Natura