Created
December 17, 2012 19:41
-
-
Save xavivars/4321337 to your computer and use it in GitHub Desktop.
Script to remove incorrect words from a file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment