WordLists::Tag::Tagger
my $tagger = WordLists::Tag::Tagger->new(); my $wl = $tagger->get_wordlist('The quick brown fox jumped over the lazy dog');
Uses Lingua::EN::Tagger to do various things with strings, chielfly to create a WordLists::WordList out of a document, e.g. to use as a basis for a glossary.
Uses Lingua::EN::Tagger to create a WordLists::WordList out of a string (e.g. a manuscript).
Lingua::EN::Tagger allows splitting into sentences, and these sentences become eg fields in the WordLists::Senses generated.
eg
Only the first instance of each headword / part of speech combination is entered into the list, unless the third argument has a key keep_repeats with a true value.
keep_repeats
The fields populated are: hw, pos, eg, and poscode, which is the original part of speech code outputted by the tagger.
hw
pos
poscode
The third argument is a hashref which allows you to configure several options.
callback_on_add_sense should be a coderef. It is passed the sense immediately before it is added to the wordlist, e.g. if you want to add a unit.
callback_on_add_sense
callback_on_make_sense should be a coderef. It is passed the sense before the wordlist is tested for inclusion. This is an opportunity to further normalise parts of speech.
callback_on_make_sense
keep_repeats is a flag, which, if set, prevents the code from removing repetitions.
ignore is a wordlist or arrayref whose elements are WordLists::Sense objects or plain hashrefs of the form {hw=>'head', pos =>'n'}, or headwords as strings. If these words are found, they are not added to the list. (not yet implemented!)
ignore
{hw=>'head', pos =>'n'}
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.