Lingua-YaTeA
view release on metacpan or search on metacpan
lib/Lingua/YaTeA/Option.pm view on Meta::CPAN
package Lingua::YaTeA::Option;
use strict;
use warnings;
our $VERSION=$Lingua::YaTeA::VERSION;
sub new
{
my ($class,$name,$value) = @_;
my $this = {};
bless ($this,$class);
$this->{NAME} = $name;
$this->{VALUE} = $value;
return $this;
}
sub getName
{
my ($this) = @_;
return $this->{NAME};
}
sub getValue
{
my ($this) = @_;
return $this->{VALUE};
}
sub update
{
my ($this,$new_value,$message_set,$display_language) = @_;
my $old_value = $this->getValue;
$this->{VALUE} = $new_value;
if(defined $message_set)
{
print STDERR "WARNING: " . $this->getName . ": " . $message_set->getMessage('OPTION_VALUE_UPDATE')->getContent($display_language) . "\"" . $new_value . "\" (";
print STDERR $message_set->getMessage('OLD_OPTION_VALUE')->getContent($display_language) . "\"". $old_value . "\")\n";
}
}
1;
__END__
=head1 NAME
Lingua::YaTeA::Option - Perl extension for option of the term extraction process
=head1 SYNOPSIS
use Lingua::YaTeA::Option;
Lingua::YaTeA::Option->new($name, $value);
=head1 DESCRIPTION
The module implements the option used by the term extractor. Options
are used to define the term extraction process.
=head1 METHODS
=head2 new()
new($name,$value);
This method creates a Option object and sets its fields C<NAME> and
C<VALUE> with the variable C<name> and C<$value>.
=head2 getName()
getName();
The method returns the name of the option.
=head2 getValue()
getValue();
The method returns the value of the option.
=head2 update()
update($new_value,$message_set,$display_language);
The method updates the value of the option with the new value
C<$new_value>.
The variables C<$message_set> and C<$display_language> are used for
displaying a warning or error message.
( run in 3.407 seconds using v1.01-cache-2.11-cpan-9789f410c06 )