WordLists::Common
use WordLists::Common qw(pretty_doubles pretty_singles); print pretty_doubles (pretty_singles ( qq{"That's right," she said, "I was told to 'get lost!'".} ) );
This provides common functions and values of relevance to wordlists - such as normalising parts of speech and typographic dashes and quotes. Exportable functions and values include:
@sPosWords, a list of things which look like parts of speech (to help parsing things like "head verb", "head up", "head noun")
@sPosWords
A function pretty_endash replacing space + hyphen + space with space + en-dash + space.
pretty_endash
A function pretty_doubles replacing double quotes with 'smart' double quotes.
pretty_doubles
A function pretty_singles replacing apostrophe/single-quote with 'smart' single quotes.
pretty_singles
A function norm_spacing
norm_spacing
A function custom_norm which takes several options:
custom_norm
lc - if true, lowercases the string.
lc
uc - if true, uppercases the string. Overrides lc.
uc
trim_space - if true, removes initial and final space, and also condenses repeating white space to a single \x20.
trim_space
\x20
alnum_only - if true, removes characters other than alphabetic ones or digits.
alnum_only
brackets - if this is 'kill', removes the contents of any () brackets; if 'ignore', removes the brackets themselves.
brackets
()
squares - if this is 'kill', removes the contents of any [] brackets; if 'ignore', removes the brackets themselves.
squares
[]
accents - if true, removes accents and modifier characters from letters.
accents
sb - if true, replaces 'sb' with 'someone'.
sb
sth - if true, replaces 'sth' with 'something'.
sth
A function generic_norm_hw which returns a word without accents or characters other than [a-z0-9].
generic_norm_hw
A function generic_norm_pos for normalising parts of speech so that 'v' and 'verb' match.
generic_norm_pos
A function generic_minimal_pos which will normalise parts of speech and reduce them to 'minimal' ones.
generic_minimal_pos
A function uniques which will reduce a list to the unique members.
uniques
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.