NAME

Pod::Definitions::Heuristic -- Apply heuristics to headings defined in Pod, presumably in English, for indexing and cross-referencing

VERSION

version 0.04

SYNOPSIS

my $h = Pod::Headings::Heuristic->new(
            text => "Splitting the infinitive");
$h->clean();  # returns "Infinitive, splitting the"

DESCRIPTION

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.

METHODS

new

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

clean

Applies the keyword-finding heuristics on text in 'text' and returns a best guess version with the keyword in first position.

text

The content of the text to be parsed.

SEE ALSO

Pod::Headings Pod::Definitions

SUPPORT

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.

AUTHOR

This module was written and is maintained by William Lindley <wlindley@cpan.org>.