Pod::Definitions::Heuristic -- Apply heuristics to headings defined in Pod, presumably in English, for indexing and cross-referencing
version 0.04
my $h = Pod::Headings::Heuristic->new( text => "Splitting the infinitive"); $h->clean(); # returns "Infinitive, splitting the"
This class assumes that headings are written in American English (c.f., "Choice-of-language:-American-English" in perldocstyle) and in a style typical of Pod pages written for CPAN. A set of heuristics are applied to select keywords and place them at the start of the heading.
For example:
What is the Q function? -> Q function How can I blip the blop? -> Blip the blop Why doesn't my socket have a packet? -> Socket have a packet Where are the pockets on the port? -> Pockets on the port I need to reap the zombie -> Reap the zombie What does the error "Disk full" mean? -> Disk full What about backwards compatibility? -> Backwards compatibility Reaping the zombie from proctab -> Zombie, reaping from proctab $c = Mojo::Path->new() -> new $el->clear_parse_result -> clear_parse_result is_block => bool (1) -> is_block
Currently, captialization (other than rewrites of type type shown above) is mostly left for the caller to handle.
Creates a new object of type Pod::Headings::Heuristic. To this should be passed a list of items to be saved as a hash in the object. The only item currently required or defined is 'text'.
Applies the keyword-finding heuristics on text in 'text' and returns a best guess version with the keyword in first position.
The content of the text to be parsed.
Pod::Headings Pod::Definitions
This module is managed in an open GitLab repository, https://gitlab.com/wlindley/Pod-Definitions. Feel free to fork and contribute, or to clone and send patches.
This module was written and is maintained by William Lindley <wlindley@cpan.org>.
To install Pod::Definitions, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::Definitions
CPAN shell
perl -MCPAN -e shell install Pod::Definitions
For more information on module installation, please visit the detailed CPAN module installation guide.