Skip to content

Instantly share code, notes, and snippets.

@nazarov-yuriy
Last active January 29, 2016 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazarov-yuriy/fbfd694ca8dc8b2c8df4 to your computer and use it in GitHub Desktop.
Save nazarov-yuriy/fbfd694ca8dc8b2c8df4 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use Text::Aspell;
sub main() {
my $str = "Уважаемые пассажиры, во избежание травм держитесь за поручни";
my $speller = Text::Aspell->new;
die unless $speller;
$speller->set_option('lang', 'ru_RU');
for my $word (split /[, ]+/, $str) {
for my $i (grep{$_%2==0} (0..length($word)-1)) {
my $copy = $word;
substr($copy, $i, 2) = "";
print "$copy\n" if $speller->check($copy);
}
}
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment