Skip to content

Instantly share code, notes, and snippets.

@xavivars
Created December 17, 2012 19:41
Show Gist options
  • Save xavivars/4321337 to your computer and use it in GitHub Desktop.
Save xavivars/4321337 to your computer and use it in GitHub Desktop.
Script to remove incorrect words from a file
use strict;
use warnings;
use Text::Aspell;
my $speller = Text::Aspell->new;
die unless $speller;
$speller->set_option('lang','en-US');
$speller->set_option('sug-mode','fast');
while(<>){
s/(\w+)/$speller->check($1) ? $1: ''/ge;
print
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment