View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Daniel Perrett > WordLists > WordLists::Tag::Tagger


Annotate this POD


New  2
Open  0
View/Report Bugs




        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.

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.

The fields populated are: hw, pos, eg, and poscode, which is the original part of speech code outputted by the tagger.

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_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.

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!)


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.

syntax highlighting: