The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WordLists::Sense - Class for senses in wordlists, dictionaries, etc.

SYNOPSIS

  use WordLists::Sense;
  my $sense = WordLists::Sense->new();
  $sense->set('hw', 'head');
  $sense->set('pos', 'noun');
  $sense->set_pos('verb'); # alternative
  $sense->has('pos'); # returns 1
  $sense->get('pos'); # returns 'verb'
  $sense->to_string; # returns "head\tverb" - however it is better to do this from within a wordlist
  my $another_sense = WordLists::Sense->new({hw=>'head', pos=>'verb'});

This class is a very simple class which is little more than a blessed hash with accessors set, get, and has.

The following attributes are 'special' - treated no differently by this module but by others:

  • hw - ('headword') - all searches will be keyed to this

  • pos - ('part of speech') - this is a discriminator for finer control

  • dict - ('dictionary') - this is set by a WordLists::Dict object when the sense is added to that object to assert provenance

BUGS

Please use the Github issues tracker.

LICENSE

Copyright 2011-2012 © Cambridge University Press. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.