.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Pod::Spell 3" .TH Pod::Spell 3 2023-07-26 "perl v5.38.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Pod::Spell \- a formatter for spellchecking Pod .SH VERSION .IX Header "VERSION" version 1.26 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 2 \& use Pod::Spell; \& Pod::Spell\->new\->parse_from_file( \*(AqFile.pm\*(Aq ); \& \& Pod::Spell\->new\->parse_from_filehandle( $infile, $outfile ); .Ve .PP Also look at podspell .PP .Vb 1 \& % perl \-MPod::Spell \-e "Pod::Spell\->new\->parse_from_file(shift)" Thing.pm |spell |fmt .Ve .PP \&...or instead of piping to spell or \f(CW\*(C`ispell\*(C'\fR, use \f(CW\*(C`>temp.txt\*(C'\fR, and open \&\fItemp.txt\fR in your word processor for spell-checking. .SH DESCRIPTION .IX Header "DESCRIPTION" Pod::Spell is a Pod formatter whose output is good for spellchecking. Pod::Spell is rather like Pod::Text, except that it doesn't put much effort into actual formatting, and it suppresses things that look like Perl symbols or Perl jargon (so that your spellchecking program won't complain about mystery words like "\f(CW$thing\fR" or "\f(CW\*(C`Foo::Bar\*(C'\fR" or "hashref"). .PP This class works by filtering out words that look like Perl or any form of computerese (like "\f(CW$thing\fR" or "\f(CW\*(C`N>7\*(C'\fR" or "\f(CW\*(C`@{$foo}{\*(Aqbar\*(Aq,\*(Aqbaz\*(Aq}\*(C'\fR", anything in C<...> or F<...> codes, anything in verbatim paragraphs (code blocks), and anything in the stopword list. The default stopword list for a document starts out from the stopword list defined by Pod::Wordlist, and can be supplemented (on a per-document basis) by having \&\f(CW"=for stopwords"\fR / \f(CW"=for :stopwords"\fR region(s) in a document. .SH METHODS .IX Header "METHODS" .SS new .IX Subsection "new" .Vb 1 \& Pod::Spell\->new(%options) .Ve .PP Creates a new Pod::Spell instance. Accepts several options: .IP debug 4 .IX Item "debug" When set to a true value, will output debugging messages about how the Pod is being processed. .Sp Defaults to false. .IP stopwords 4 .IX Item "stopwords" Can be specified to use an alternate wordlist instance. .Sp Defaults to a new Pod::Wordlist instance. .IP no_wide_chars 4 .IX Item "no_wide_chars" Will be passed to Pod::Wordlist when creating a new instance. Causes all words with characters outside the Latin\-1 range to be stripped from the output. .SS stopwords .IX Subsection "stopwords" .Vb 1 \& $self\->stopwords\->isa(\*(AqPod::WordList\*(Aq); # true .Ve .SS parse_from_filehandle($in_fh,$out_fh) .IX Subsection "parse_from_filehandle($in_fh,$out_fh)" This method takes an input filehandle (which is assumed to already be opened for reading) and reads the entire input stream looking for blocks (paragraphs) of POD documentation to be processed. If no first argument is given the default input filehandle \f(CW\*(C`STDIN\*(C'\fR is used. .PP The \f(CW$in_fh\fR parameter may be any object that provides a \fBgetline()\fR method to retrieve a single line of input text (hence, an appropriate wrapper object could be used to parse PODs from a single string or an array of strings). .SS parse_from_file($filename,$outfile) .IX Subsection "parse_from_file($filename,$outfile)" This method takes a filename and does the following: .IP \(bu 2 opens the input and output files for reading (creating the appropriate filehandles) .IP \(bu 2 invokes the \fBparse_from_filehandle()\fR method passing it the corresponding input and output filehandles. .IP \(bu 2 closes the input and output files. .PP If the special input filename "", "\-" or "<&STDIN" is given then the STDIN filehandle is used for input (and no open or close is performed). If no input filename is specified then "\-" is implied. Filehandle references, or objects that support the regular IO operations (like \f(CW\*(C`<$fh>\*(C'\fR or \f(CW\*(C`$fh\-) are also accepted; the handles must already be opened. .PP If a second argument is given then it should be the name of the desired output file. If the special output filename "\-" or ">&STDOUT" is given then the STDOUT filehandle is used for output (and no open or close is performed). If the special output filename ">&STDERR" is given then the STDERR filehandle is used for output (and no open or close is performed). If no output filehandle is currently in use and no output filename is specified, then "\-" is implied. Alternatively, filehandle references or objects that support the regular IO operations (like \f(CW\*(C`print\*(C'\fR, e.g. IO::String) are also accepted; the object must already be opened. .SH ENCODINGS .IX Header "ENCODINGS" If your Pod is encoded in something other than Latin\-1, it should declare an encoding using the "\f(CW\*(C`=encoding \fR\f(CIencodingname\fR\f(CW\*(C'\fR" in perlpod directive. .SH "ADDING STOPWORDS" .IX Header "ADDING STOPWORDS" You can add stopwords on a per-document basis with \&\f(CW"=for stopwords"\fR / \f(CW"=for :stopwords"\fR regions, like so: .PP .Vb 2 \& =for stopwords plok Pringe zorch snik !qux \& foo bar baz quux quuux .Ve .PP This adds every word in that paragraph after "stopwords" to the stopword list, effective for the rest of the document. In such a list, words are whitespace-separated. (The amount of whitespace doesn't matter, as long as there's no blank lines in the middle of the paragraph.) Plural forms are added automatically using Lingua::EN::Inflect. Words beginning with "!" are \&\fIdeleted\fR from the stopword list \-\- so "!qux" deletes "qux" from the stopword list, if it was in there in the first place. Note that if a stopword is all-lowercase, then it means that it's okay in \fIany\fR case; but if the word has any capital letters, then it means that it's okay \fIonly\fR with \fIthat\fR case. So a Wordlist entry of "perl" would permit "perl", "Perl", and (less interestingly) "PERL", "pERL", "PerL", et cetera. However, a Wordlist entry of "Perl" catches only "Perl", not "perl". So if you wanted to make sure you said only "Perl", never "perl", you could add this to the top of your document: .PP .Vb 1 \& =for stopwords !perl Perl .Ve .PP Then all instances of the word "Perl" would be weeded out of the Pod::Spell\-formatted version of your document, but any instances of the word "perl" would be left in (unless they were in a C<...> or F<...> style). .PP You can have several "=for stopwords" regions in your document. You can even express them like so: .PP .Vb 1 \& =begin stopwords \& \& plok Pringe zorch \& \& snik !qux \& \& foo bar \& baz quux quuux \& \& =end stopwords .Ve .PP If you want to use E<...> sequences in a "stopwords" region, you have to use ":stopwords", as here: .PP .Vb 2 \& =for :stopwords \& virtE .Ve .PP \&...meaning that you're adding a stopword of "virtù". If you left the ":" out, that would mean you were adding a stopword of "virtE" (with a literal E, a literal <, etc), which will have no effect, since any occurrences of virtE don't look like a normal human-language word anyway, and so would be screened out before the stopword list is consulted anyway. .SH CAVEATS .IX Header "CAVEATS" .ie n .SS "finding stopwords defined with ""=for""" .el .SS "finding stopwords defined with \f(CW=for\fP" .IX Subsection "finding stopwords defined with =for" Pod::Spell makes a single pass over the POD. Stopwords must be added \fBbefore\fR they show up in the POD. .SH HINT .IX Header "HINT" If you feed output of Pod::Spell into your word processor and run a spell-check, make sure you're \fInot\fR also running a grammar-check \-\- because Pod::Spell drops words that it thinks are Perl symbols, jargon, or stopwords, this means you'll have ungrammatical sentences, what with words being missing and all. And you don't need a grammar checker to tell you that. .SH "SEE ALSO" .IX Header "SEE ALSO" .IP \(bu 4 Pod::Wordlist .IP \(bu 4 Pod::Simple .IP \(bu 4 podchecker also known as Pod::Checker .IP \(bu 4 perlpod, perlpodspec .SH BUGS .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website or by email to bug\-Pod\-Spell@rt.cpan.org . .PP When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" .IP \(bu 4 David Golden .IP \(bu 4 Graham Knop .IP \(bu 4 Kent Fredric .IP \(bu 4 Mohammad S Anwar .IP \(bu 4 Olivier Mengué .IP \(bu 4 Paulo Custodio .SH AUTHORS .IX Header "AUTHORS" .IP \(bu 4 Sean M. Burke .IP \(bu 4 Caleb Cushing .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2023 by Olivier Mengué. .PP This is free software, licensed under: .PP .Vb 1 \& The Artistic License 2.0 (GPL Compatible) .Ve