NAME

WordNet::Insert - Perl modules for calculating where in WordNet a lemma should be inserted.

SYNOPSIS

Basic Usage Example

use WordNet::Insert;

my $insert = WordNet::Insert->new();

$insert->stopList('s/\b(the|is|at)\b//'); $insert->setCleanUp(1); $insert->preProcessing(); $insert->toggleCompareGlosses(1,1,0); $insert->setBonus(25); $insert->toggleRefineSense(0);

$insert->insertFile('data/temptrial','outdata/outtemptrial');

DESCRIPTION

Introduction

Function

The following function is defined:

Methods

The following methods are defined in this package:

Public methods

$obj->new()

The constructor for WordNet::Insert objects.

Parameters: none.

Return value: the new blessed object

$obj->getError()

Allows the object to check if any errors have occurred. Returns an array ($error, $errString), where $error value equal to 1 represents a warning and greater than that represents an error and $errString contains the possible error.

Parameter: None

Returns: array of the form ($error, $errorString).

$obj->insertFile($input_file, $output_file)

Attempts to insert each word from input file into WordNet, outputs results to output file.

Parameter: location of input file and output file respectively

Returns: nothing

$obj->insert($wordPosGloss)

Takes in single lemma with gloss and returns best insertion point in WordNet.

Parameter: Lemma string in format of 'word\tpos\tdef' NOTE: String must only be separated by \t no space.

Returns: Array in format of ('

$obj->stopList($newStopList)

Takes in new stop list, in regex form

Parameter:the new stop list in regex substitution form s/.../g?

Returns: nothing

$obj->setCleanUp($switch)

Allows the user to toggle whether or not glosses should be cleaned up.

Parameter: 0 or 1 to turn clean up off or on respectively

Returns: nothing

$obj->addCleanUp($cleanUp)

Allows the user to add their own regex for cleaning up the glosses.

Parameter: Regex representing the cleanup the user wants performed.

Returns: Nothing

$obj->preProcessing()

Highly increases speed of program by making as many outside calls as possible and storing outside info to be used later.

Parameter: none

Returns: nothing

$obj->processLemma(@inLemma)

Determines where the OOV Lemma should be inserted into WordNet, returns the output.

Parameter: the lemma to be inserted in array form (lemma, part-of-speech, item-id, definition, def source)

Returns: chosen lemma in array form (item-id, WordNet sense, operation)

$obj->toggleCompareGlosses($hype,$hypo,$syns)

Toggles which glosses are used in score sense. by default, the sense, the sense's hypernyms' glosses,hyponyms' glosses, and synsets' glosses are turned on. This method allows for toggling of hypes,hypos,synsets, by passing in three parameters, 1 for on and 0 for off. Example: toggleCompareGlosses(0,0,0) toggles all three off.

Parameters: 0 or 1 for toggling hypernyms, hyponyms, and synset comparisons.

Returns: nothing

$obj->setBonus($bonus)

Allows the user to set the bonus that will be used when scoring lemmas that contain the new lemma.

Parameter: the multiplier that should be used in calculating the bonus.

Returns: nothing

$obj->scoreSense(@inLemma, $compareSense)

Calculates a score for the passed sense then returns that score.

Parameters: the in lemma in array form (lemma, part-of-speech, item-id, definition, def source) and the sense that the lemma is being compared to.

Returns: a score of how related the in lemma is to the compareSense.

$obj->getExtendedGloss($compareSense)

Calculates the extended gloss based on which glosses are toggled and returns an array which contains the full glosses.

Parameter: the sense which the extended gloss is based on

Returns: an array which contains the extended gloss

$obj->toggleRefineSense($toggle)

Allows user to toggle refineSense() on/off.

Parameter: 0 or 1 to toggle the refine sense method on or off respectively in the processLemma method.

Returns: nothing

$obj->refineSense(@inLemma, $highSense)

Refines chosen sense, by determing which numbered sense should be chosen.

Parameters: the in lemma in form of (lemma, part-of-speech, item-id, definition, def source) and the sense which currently bests matches the inlemma.

Returns:the new highest scoring sense

2 POD Errors

The following errors were encountered while parsing the POD:

Around line 114:

You forgot a '=back' before '=head2'

Around line 120:

=over without closing =back