WordLists::Sense - Class for senses in wordlists, dictionaries, etc.
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.
set
get
has
The following attributes are 'special' - treated no differently by this module but by others:
hw - ('headword') - all searches will be keyed to this
hw
pos - ('part of speech') - this is a discriminator for finer control
pos
dict - ('dictionary') - this is set by a WordLists::Dict object when the sense is added to that object to assert provenance
dict
Please use the Github issues tracker.
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.
To install WordLists::Tag, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WordLists::Tag
CPAN shell
perl -MCPAN -e shell install WordLists::Tag
For more information on module installation, please visit the detailed CPAN module installation guide.