NAME

Pod::Wordlist::Author::TABULO - Add words for spell checking POD à la TABULO

VERSION

version 1.000002

SYNOPSIS

# in some Dist::Zilla::PluginBundle::Foo

sub configure {

    my $stopwords = Pod::Wordlist::Author::TABULO->new;
    $self->add_plugin(
        [ 'Test::PodSpelling' => { stopwords => [ sort keys %{ $stopwords->wordlist } ] } ],
    );
}

DESCRIPTION

This is an EXPERIMENTAL module for my personal use within my authoring workflows (especially with Dist::Zilla).

It's there because I don't want to lose my time adding the same stopwords in multiple places.

You shouldn't use this module. Everything in and about it is subject to change without prior notice or deprecation cycles.

Even if it doesn't manage to eat your cat, it can surely put bad words in your mouth :-)

Currently, the extra stopwords injected include: some monikers, aliases (e.g. TABULON), CPAN IDs, technical terms, and other words commonly used (by me) that are not included in the default word list.

METHODS

learn_stopwords_from (OVERRIDDEN from parent)

Like the inherited learn_stopwords method, but this one accepts any number of arguments which will be learned in a loop.

So, it basically saves you loop.

learn_stopwords_from

Like the inherited learn_stopwords method, but this one also accepts, in addition to simple scalars, any number of things that appear to be capable of providing textual content, such as:

* simple scalar * IO::Handle (which will be read from) * Any object that can do lines_utf8(), such as and instance of Path::Tiny

HOW IT WORKS

This module sub-classes Pod::Wordlist and overrides its wordlist method, injecting a bunch words to the returned wordlist.

Unlike Pod::Wordlist::hanekomu (DEPRECATED), this module does NOT do anything behind the scenes:

Namely, it doesn't directly interact with Test::Spelling. Therefore, merely loading this module will NOT automagically add its stopwords for spell-checking.

Instead, it just sits there and provides the same API as Pod::Wordlist, augmenting the stopwords provided by that module.

So, in order to benefit from it, one needs to somehow tell Test::Spelling to actually make use of it (which is construed as a feature).

First, I thought that could easily be achieved since the Dist::Zilla plugin [Test::PodSpelling] advertises just such a configuration parameter (wordlist) that could have been given within dist.ini or thru a PluginBundle, which is how I intended to use it.

Apparently not... From what I gather, even though Dist::Zilla::Plugin::Test::PodSpelling does indeed pass the buck ( wordlist) along, the underlying modules (Test::PodSpelling and Pod::Spelling) merely ignore that setting... Perhaps a bug report or a PR is due for at least one of those.authoring.

Anyhow, in the end, I had to grab the stopwords provided by this module and shove those into the stopwords parameter of the Dist::Zilla plugin [Test::PodSpelling]. That seems to work like a charm.

For the moment, this had to be done in my personal PluginBundle since you can't execute code in dist.ini. It's kind of a shame, but it works!

DEFAULT STOPWORD SOURCES (a.k.a. default @teachers)

By default, this module will acquire its wordlist from any or all of the below sources:

* $DIST_SHARE_DIR/stopwords (of this distro)

* <DATA> section (of this module)

Those sources result in what I call the "DELTA" dictionary (as opposed to the ENTIRE dictionary that would include the wordlist from Pod::Wordlist as well).authoring.ext/Dist-Milla/lib/Dist/Milla.pm

Since I<DELTA> is the default, you can get the I<DELTA> dictionary like below :

   my $lexicon = Pod::Wordlist::Author::TABULO->new();
   $stopwords = $lexicon->wordlist()       # This will get you the I<delta>.

If you want the ENTIRE wordlist (including also wordlist from Pod::Wordlist), you would have to do:

stopwords is expected to be a plain text file with whitespace separated words in it.

# Line comments are honored

So are side comments      # like this

CREDITS

Adopted the initial code from Pod::Wordlist::hanekomu (DEPRECATED), but the mechanism of hooking into the spell-checking is entirely different.

SEE ALSO

* Pod::Wordlist * Test::Spelling * Dist::Zilla::Plugin::Test::PodSpelling

AUTHORS

Tabulo[n] <dev@tabulo.net>

LEGAL

This software is copyright (c) 2021 by Tabulo[n].

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.