FrameNet::WordNet::Detour::Frame - A class representing one single frame.


FrameNet-WordNet-Detour documentation Contained in the FrameNet-WordNet-Detour distribution.

Index


Code Index:

NAME

Top

FrameNet::WordNet::Detour::Frame - A class representing one single frame.

SYNOPSIS

Top

  my $frame = {$result->get_best_frames}->[0];

  print "Frame ".$frame->name."\n";
  print "Weight ".$frame->weight."\n";
  print "Fees: ".join(",", @{$frame->fees});

METHODS

Top

Note: Some of the methods allow writing of properties. This is only used during the creation of the module and should not be used and needed at all.

new
name

If an argument is provided, the name of the frame is set to that value. The method returns the name (after assignment to a provided value, if appropriate).

weight

Same as name, except that it works for the weight instead of the name.

fees

Several Uses: If called without arguments, it returns the list of frame evoking elements in list context and a reference to that list in scalar context. Can also be called with an argument, that list replaces the current value.

sims

Same as fees, except that it works on the list of similarities of the fees.

get_name ( )

Returns the name of the frame

get_weight ( )

Returns the weight of the frame

BUGS

Top

Please report bugs to mailto:reiter@cpan.org.

COPYRIGHT

Top


FrameNet-WordNet-Detour documentation Contained in the FrameNet-WordNet-Detour distribution.

package FrameNet::WordNet::Detour::Frame;

require Exporter;
our @ISA = qw(Exporter);
our $VERSION = "0.99";

use strict;
use warnings;

sub new {
    my $class = shift;
    my $self = { 'fees' => [],
		 'sims' => [] };
    return bless $self, $class;
}

sub fees {
    my $self = shift;
    return $self->{'fees'};
}

sub sims {
    my $self = shift;
    return $self->{'sims'};
}

sub _fees_add {
    my ($self, $fee) = @_;
    push(@{$self->{'fees'}},$fee);
}

sub _sims_add {
    my ($self, $sim) = @_;
    push(@{$self->{'sims'}},$sim);
}

sub _add_weight {
  my $self = shift;
  my $w = shift;
  $self->{'weight'} += $w;
}

sub weight {
    my ($self,$w) = @_;
    if (defined $w) {
	$self->{'weight'} = $w;
    };
    return $self->{'weight'};
};

sub name {
    my ($self,$name) = @_;
    if (defined $name) {
	$self->{'name'} = $name;
    };
    return $self->{'name'};
};

sub get_name {
    my ($self,$name) = @_;
    if (defined $name) {
	return $self->name($name);
    };
    return $self->name;
};

sub get_weight {
    my ($self,$weight) = @_;
    if (defined $weight) {
	return $self->weight($weight);
    };
    return $self->weight;
};



1;


__END__


## DOCUMENTATION ##