Martin Hamilton > Text-Thesaurus-ISO-1.0 > Text::Thesaurus::ISO

Download:
Text-Thesaurus-ISO-1.0.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.0   Source  

NAME ^

Text::Thesaurus::ISO - A class to handle ISO thesaurii

SYNOPSIS ^

  use Text::Thesaurus::ISO;

  $thes = new Text::Thesaurus::ISO;
  $thes->open("myisothesfile");
  $thes->reopen("myisothesfile");
  %entry = $thes->terminfo("dumpy");
  @broaderterms = $thes->broader("dumpy");
  @narrowerterms = $thes->narrower("dumpy");
  $dateentered = $thes->dateentered("dumpy");
  $datechanged = $thes->datechanged("dumpy");
  @alternatives = $thes->alternatives("dumpy");
  @sources = $thes->sources("dumpy");
  @links = $thes->links("dumpy");
  @scopenotes = $thes->scopenote("dumpy");
  @historynotes = $thes->history("dumpy");

DESCRIPTION ^

This module defines an abstract ROADS Thesaurus object and a number of methods that operate on these objects. These methods allow new Thesaurus objects to be created, specify what Thesaurus file to use, retrieve all the information from the thesaurus concerning a given term, find broader terms for a given term and find narrower terms for a given term.

METHODS ^

new

This creates a new (empty) thesaurus object.

open

Opens an ISO thesaurus file specified by its single parameter. It also checks if the backend database exists for this file and if not, creates it.

reopen

Opens an ISO thesaurus file specified by its single parameter. This method always reindexes the ISO thesaurus file, and so should be called if the ISO thesaurus file has been changed since the last time the index was generated. Note that this call can be quite time consuming, especially on a large thesaurus file, so its probably best avoided in interactive systems (have a batch script that periodically updates the thesaurus indexes behind the scenes instead).

terminfo

Takes a term (a word or phrase) and returns all the information for that term from its thesaurus record. The information is returned in a hash array keyed on the attribute name in the ISO thesaurus record (ie BT, TERM, UF, etc).

broader

Takes a term and returns a list of all the broader terms for it.

narrower

Takes a term and returns a list of all the narrower terms for it.

dateentered

Takes a thesaurus term as a parameter and returns the date that the term's record was entered into the thesaurus file. Returns an undef value if the term does not exist in the thesaurus file or if there is no entry date recorded.

datechanged

Takes a thesaurus term as a parameter and returns the date that the term's record was last changed in the thesaurus file. Returns an undef value if the term does not exist in the thesaurus file or if there is no changed date recorded.

alternatives

Takes a thesaurus term as a parameter and returns an array of alternative terms based on that.

sources

Takes a thesaurus term as a parameter and returns an array of source statements that detail where the term was extracted from.

links

Takes a thesaurus term as a parameter and returns an array of links to other terms in the thesaurus.

scopenote

Takes a thesaurus term as a parameter and returns an array of scope notes applying to that term. The scope notes often provide human readable descriptions of the term and the its limits.

history

Takes a thesaurus term as a parameter and returns an array of historical notes. These are usually human readable comments made when major changes have been made to the thesaurus that effect the specified term's entry.

BUGS ^

None known of as yet. It is intended that more methods will be added in the future to specifically retreive various parts of the thesaurus record which will hopefully make the terminfo method obsolete. Also note that this version has only been tested against a single ISO thesaurus file (a demonstration version of the Art and Architecture Thesaurus) - feedback of bugs with other thesaurii are most welcome.

COPYRIGHT ^

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

It was developed by the Department of Computer Studies at Loughborough University of Technology, as part of the ROADS project. ROADS is funded under the UK Electronic Libraries Programme (eLib), and the European Commission Telematics for Research Programme.

AUTHOR ^

Jon Knight <j.p.knight@lut.ac.uk> Martin Hamilton <m.t.hamilton@lut.ac.uk>

syntax highlighting: