On Oct 4, 2006, at 3:16 PM, brian d foy wrote:

Not really. :) The spell checking is done by external programs, and the
Pod::Spell module outputs something that doesn't have all of the
original docs in it.  You can find out if there are spelling errors,
but
you don't get back something that fixes it, and it's not interactive.

Gotcha. You want something like the interactive mode in ispell/ aspell/Emacs, but with smarts about what's prose and what's code.

I cooked up a prototype POD filter for ispell. ispell isn't as cool as aspell, but it supports external filters.

  https://svn.clotho.com/public/ispell-perl/

Hopefully I haven't reinvented any wheels...
Use it like the following cmdline. It prompts you for every misspelled word and writes the file back out with changes.

  ispell -F ispell-perl-filter program.pl

Implementation details: ispell filters take in code and output the *exact same number of bytes* with text you don't want checked turned into whitespace. I used PPI to find the POD in a roundtrip-safe way. I had to hand-roll a POD parser, because Pod::Parser is lossy (at minimum, it drops "=cut").

A future version of this should try to use Pod::Parser like Pod::Spell does.

Chris

--
Chris Dolan, Software Developer, Clotho Advanced Media Inc.
608-294-7900, fax 294-7025, 1435 E Main St, Madison WI 53703
vCard: http://www.chrisdolan.net/ChrisDolan.vcf

Clotho Advanced Media, Inc. - Creators of MediaLandscape Software (http://www.media-landscape.com/) and partners in the revolutionary Croquet project (http://www.opencroquet.org/)


Reply via email to