.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 turned on, 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 3pm" .TH Pod::Spell 3pm "2016-04-29" "perl v5.22.1" "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.20 .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 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\*(L" or \*(R"\f(CW\*(C`Foo::Bar\*(C'\fR\*(L" or \*(R"hashref"). .PP This class provides no new public methods. All methods of interest are inherited from Pod::Parser (which see). The especially interesting ones are \f(CW\*(C`parse_from_filehandle\*(C'\fR (which without arguments takes from \s-1STDIN\s0 and sends to \s-1STDOUT\s0) and \f(CW\*(C`parse_from_file\*(C'\fR. But you can probably just make do with the examples in the synopsis though. .PP This class works by filtering out words that look like Perl or any form of computerese (like "\f(CW$thing\fR\*(L" or \*(R"\f(CW\*(C`N>7\*(C'\fR\*(L" or \&\*(R"\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" .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 \s-1POD\s0 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 \fB\f(BIgetline()\fB\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 \fB\f(BIparse_from_filehandle()\fB\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 "\*(L", \*(R"\-\*(L" or \*(R"<&STDIN\*(L" is given then the \s-1STDIN\s0 filehandle is used for input (and no open or close is performed). If no input filename is specified then \*(R"\-" is implied. Filehandle references, or objects that support the regular \s-1IO\s0 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 \*(L"\-\*(R" or \*(L">&STDOUT\*(R" is given then the \s-1STDOUT\s0 filehandle is used for output (and no open or close is performed). If the special output filename \*(L">&STDERR\*(R" is given then the \&\s-1STDERR\s0 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 \*(L"\-\*(R" is implied. Alternatively, filehandle references or objects that support the regular \&\s-1IO\s0 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" Pod::Parser, which Pod::Spell extends, is extremely naive about character encodings. The \f(CW\*(C`parse_from_file\*(C'\fR method does not apply any PerlIO encoding layer. If your Pod file is encoded in \s-1UTF\-8,\s0 your data will be read incorrectly. .PP You should instead use \f(CW\*(C`parse_from_filehandle\*(C'\fR and manage the input and output layers yourself. .PP .Vb 3 \& binmode($_, ":utf8") for ($infile, $outfile); \& $my ps = Pod::Spell\->new; \& $ps\->parse_from_filehandle( $infile, $outfile ); .Ve .PP If your output destination cannot handle \s-1UTF\-8,\s0 you should set your output handle to Latin\-1 and tell Pod::Spell to strip out words with wide characters. .PP .Vb 4 \& binmode($infile, ":utf8"); \& binmode($outfile, ":encoding(latin1)"); \& $my ps = Pod::Spell\->new( no_wide_chars => 1 ); \& $ps\->parse_from_filehandle( $infile, $outfile ); .Ve .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 \*(L"stopwords\*(R" 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 \*(L"!\*(R" are \&\fIdeleted\fR from the stopword list \*(-- so \*(L"!qux\*(R" deletes \*(L"qux\*(R" 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 \*(L"perl\*(R" would permit \*(L"perl\*(R", \*(L"Perl\*(R", and (less interestingly) \*(L"\s-1PERL\*(R", \s0\*(L"pERL\*(R", \&\*(L"PerL\*(R", et cetera. However, a Wordlist entry of \*(L"Perl\*(R" catches only \*(L"Perl\*(R", not \*(L"perl\*(R". So if you wanted to make sure you said only \*(L"Perl\*(R", never \*(L"perl\*(R", 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 \*(L"Perl\*(R" would be weeded out of the Pod::Spell\-formatted version of your document, but any instances of the word \*(L"perl\*(R" would be left in (unless they were in a C<...> or F<...> style). .PP You can have several \*(L"=for stopwords\*(R" 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 \*(L"stopwords\*(R" region, you have to use \*(L":stopwords\*(R", as here: .PP .Vb 2 \& =for :stopwords \& virtE .Ve .PP \&...meaning that you're adding a stopword of \*(L"virtù\*(R". If you left the \*(L":\*(R" out, that would mean you were adding a stopword of \&\*(L"virtE\*(R" (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 "BUGS AND LIMITATIONS" .IX Header "BUGS AND LIMITATIONS" .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 \s-1POD. \s0 Stopwords must be added \fBbefore\fR they show up in the \s-1POD.\s0 .SS "finding the wordlist" .IX Subsection "finding the wordlist" Pod::Spell uses File::ShareDir::ProjectDistDir if you're getting errors about the wordlist being missing, chances are it's a problem with its heuristics. Set \f(CW\*(C`PATH_ISDEV_DEBUG=1\*(C'\fR or \f(CW\*(C`PATH_FINDDEV_DEBUG=1\*(C'\fR, or both in your environment for debugging, and then file a bug with File::ShareDir::ProjectDistDir if necessary. .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" Pod::Wordlist .PP Pod::Parser .PP podchecker also known as Pod::Checker .PP perlpod, perlpodspec .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" .IP "\(bu" 4 David Golden .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) 2016 by Olivier Mengué. .PP This is free software, licensed under: .PP .Vb 1 \& The Artistic License 2.0 (GPL Compatible) .Ve